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 # Generated on Sun Apr 1 12:00:35 CEST 2012 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
576 d_libm_lib_version=''
579 d_localtime_r_needs_tzset=''
590 d_malloc_good_size=''
634 d_old_pthread_create_joinable=''
635 old_pthread_create_joinable=''
637 d_pthread_attr_setscope=''
676 sethostent_r_proto=''
693 setprotoent_r_proto=''
705 setservent_r_proto=''
743 d_sprintf_returns_strlen=''
755 perl_static_inline=''
760 d_stdio_ptr_lval_nochange_cnt=''
761 d_stdio_ptr_lval_sets_cnt=''
906 d_gdbm_ndbm_h_uses_prototypes=''
907 d_gdbmndbm_h_uses_prototypes=''
909 d_ndbm_h_uses_prototypes=''
984 d_inc_version_list=''
986 inc_version_list_init=''
1005 ignore_versioned_solibs=''
1069 d_perl_otherlibdirs=''
1077 api_versionstring=''
1083 version_patchlevel_string=''
1087 d_nv_preserves_uv=''
1088 d_nv_zero_is_allbits_zero=''
1099 nv_overflows_integers_at=''
1100 nv_preserves_uv_bits=''
1172 installsitehtml1dir=''
1175 installsitehtml3dir=''
1182 installsiteman1dir=''
1185 installsiteman3dir=''
1190 installsitescript=''
1207 d_stdio_stream_array=''
1208 stdio_stream_array=''
1225 usekernprocpathname=''
1226 ccflags_uselargefiles=''
1227 ldflags_uselargefiles=''
1228 libswanted_uselargefiles=''
1237 usensgetexecutablepath=''
1250 installvendorarch=''
1257 installvendorhtml1dir=''
1259 vendorhtml1direxp=''
1260 installvendorhtml3dir=''
1262 vendorhtml3direxp=''
1268 installvendorman1dir=''
1271 installvendorman3dir=''
1278 installvendorscript=''
1291 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1294 : We must find out about Eunice early
1296 if test -f /etc/unixtovms; then
1297 eunicefix=/etc/unixtovms
1299 if test -f /etc/unixtovms.exe; then
1300 eunicefix=/etc/unixtovms.exe
1303 : Set executable suffix now -- needed before hints available
1304 if test -f "/libs/version.library"; then
1307 elif test -f "/system/gnu_library/bin/ar.pm"; then
1310 elif test -n "$DJGPP"; then
1313 elif test -d c:/. -o -n "$is_os2" ; then
1320 : Trailing extension. Override this in a hint file, if needed.
1321 : Extra object files, if any, needed on this platform.
1324 : Possible local include directories to search.
1325 : Set locincpth to "" in a hint file to defeat local include searches.
1326 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1327 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1329 : no include file wanted by default
1332 : Enable -DEBUGGING and -DDEBUGGING from the command line
1337 : change the next line if compiling for Xenix/286 on Xenix/386
1338 xlibpth='/usr/lib/386 /lib/386'
1339 : Possible local library directories to search.
1340 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1341 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1343 : general looking path for locating libraries
1344 glibpth="/lib /usr/lib $xlibpth"
1345 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1346 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1347 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1348 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1350 : Private path used by Configure to find libraries. Its value
1351 : is prepended to libpth. This variable takes care of special
1352 : machines, like the mips. Usually, it should be empty.
1355 : default library list
1357 : some systems want to use only the non-versioned libso:s
1358 ignore_versioned_solibs=''
1359 : set usethreads on the Configure command line to enable threads.
1360 usereentrant='undef'
1361 : full support for void wanted by default
1367 : set useposix=false in your hint file to disable the POSIX extension.
1369 : set useopcode=false in your hint file to disable the Opcode extension.
1372 ccflags_uselargefiles=''
1373 ldflags_uselargefiles=''
1374 libswanted_uselargefiles=''
1375 : set usemultiplicity on the Configure command line to enable multiplicity.
1376 : set usesocks on the Configure command line to enable socks.
1377 : List of libraries we want.
1378 : If anyone needs extra -lxxx, put those in a hint file.
1379 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1380 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1381 : We probably want to search /usr/shlib before most other libraries.
1382 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1383 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1384 glibpth="/usr/shlib $glibpth"
1385 : Do not use vfork unless overridden by a hint file.
1388 : Find the basic shell for Bourne shell scripts
1392 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1395 if test -f "$xxx"; then
1398 : Build up a list and do a single loop so we can 'break' out.
1399 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1400 for xxx in sh bash ksh pdksh ash; do
1402 try="$try ${p}/${xxx}"
1406 if test -f "$xxx"; then
1409 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1412 elif test -f "$xxx.exe"; then
1423 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1425 Usually it's in /bin/sh. How did you even get this far?
1426 Please contact me (Perl Maintainers) at perlbug@perl.org and
1427 we'll try to straighten this all out.
1433 : see if sh knows # comments
1434 if `$sh -c '#' >/dev/null 2>&1`; then
1438 test -f $xcat$_exe || xcat=/usr/bin/cat
1439 if test ! -f $xcat$_exe; then
1440 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1441 if test -f $p/cat$_exe; then
1446 if test ! -f $xcat$_exe; then
1447 echo "Can't find cat anywhere!"
1451 echo "#!$xcat" >sharp
1454 ./sharp > today 2>/dev/null
1455 if test -s today; then
1458 echo "#! $xcat" > sharp
1461 ./sharp > today 2>/dev/null
1462 if test -s today; then
1470 echo "Your $sh doesn't grok # comments--I will strip them later on."
1473 echo "exec grep -v '^[ ]*#'" >spitshell
1475 $eunicefix spitshell
1476 spitshell=`pwd`/spitshell
1478 echo "I presume that if # doesn't work, #! won't work either!"
1483 : figure out how to guarantee sh startup
1485 '') startsh=${sharpbang}${sh} ;;
1497 : echo "Yup, it does."
1499 echo "Hmm... '$startsh' does not guarantee sh startup..."
1500 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1504 : Save command line options in file UU/cmdline.opt for later use in
1505 : generating config.sh.
1506 cat > cmdline.opt <<EOSH
1507 : Configure command line arguments.
1516 cat >>cmdline.opt <<EOSH
1517 config_arg$argn='$arg'
1519 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1522 arg_exp=`cat cmdl.opt`
1523 args_exp="$args_exp$args_sep'$arg_exp'"
1524 argn=`expr $argn + 1`
1529 : produce awk script to parse command line options
1530 cat >options.awk <<'EOF'
1532 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1534 len = length(optstr);
1535 for (i = 1; i <= len; i++) {
1536 c = substr(optstr, i, 1);
1537 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1548 if (substr(str, 1, 1) != "-") {
1549 printf("'%s'\n", str);
1553 for (i = 2; i <= len; i++) {
1554 c = substr(str, i, 1);
1556 printf("-%s\n", substr(str, i));
1562 printf("'%s'\n", substr(str, i + 1));
1575 : process the command line options
1576 set X `for arg in "$@"; do echo "X$arg"; done |
1577 sed -e s/X// | awk -f options.awk`
1582 : set up default values
1592 rm -f optdef.sh posthint.sh
1593 cat >optdef.sh <<EOS
1599 while test $# -gt 0; do
1601 -d) shift; fastread=yes;;
1602 -e) shift; alldone=cont;;
1606 if test -r "$1"; then
1609 echo "$me: cannot read config file $1." >&2
1615 -h) shift; error=true;;
1616 -r) shift; reuseval=true;;
1617 -s) shift; silent=true; realsilent=true;;
1618 -E) shift; alldone=exit;;
1619 -K) shift; knowitall=true;;
1620 -O) shift; override=true;;
1621 -S) shift; silent=true; extractsh=true;;
1626 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1627 echo "$me: ignoring -D $1" >&2
1630 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1631 *) echo "$1='define'" >> optdef.sh;;
1638 *=) echo "$1" >> optdef.sh;;
1640 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1641 echo "$me: ignoring -U $1" >&2
1643 *) echo "$1='undef'" >> optdef.sh;;
1654 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1658 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1659 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1665 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1666 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1667 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1668 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1669 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1670 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1676 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1678 echo "$yyy=''" >> posthint.sh ;;
1683 echo "$yyy='$zzz'" >> posthint.sh ;;
1685 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1687 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1692 echo "$yyy=$zzz" >> posthint.sh ;;
1693 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1697 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1700 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1708 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1709 [-U symbol] [-U symbol=] [-A command:symbol...]
1710 -d : use defaults for all answers.
1711 -e : go on without questioning past the production of config.sh.
1712 -f : specify an alternate default configuration file.
1713 -h : print this help message and exit (with an error status).
1714 -r : reuse C symbols value if possible (skips costly nm extraction).
1715 -s : silent mode, only echoes questions and essential information.
1716 -D : define symbol to have some value:
1717 -D symbol symbol gets the value 'define'
1718 -D symbol=value symbol gets the value 'value'
1719 common used examples (see INSTALL for more info):
1720 -Duse64bitint use 64bit integers
1721 -Duse64bitall use 64bit integers and pointers
1722 -Dusethreads use thread support
1723 -Dinc_version_list=none do not include older perl trees in @INC
1724 -DEBUGGING=none DEBUGGING options
1725 -Dcc=gcc choose your compiler
1726 -Dprefix=/opt/perl5 choose your destination
1727 -E : stop at the end of questions, after having produced config.sh.
1728 -K : do not use unless you know what you are doing.
1729 -O : let -D and -U override definitions from loaded configuration file.
1730 -S : perform variable substitutions on all .SH files (can mix with -f)
1731 -U : undefine symbol:
1732 -U symbol symbol gets the value 'undef'
1733 -U symbol= symbol gets completely empty
1735 -A : manipulate symbol after the platform specific hints have been applied:
1736 -A append:symbol=value append value to symbol
1737 -A symbol=value like append:, but with a separating space
1738 -A define:symbol=value define symbol to have value
1739 -A clear:symbol define symbol to be ''
1740 -A define:symbol define symbol to be 'define'
1741 -A eval:symbol=value define symbol to be eval of value
1742 -A prepend:symbol=value prepend value to symbol
1743 -A undef:symbol define symbol to be 'undef'
1744 -A undef:symbol= define symbol to be ''
1745 e.g.: -A prepend:libswanted='cl pthread '
1746 -A ccflags=-DSOME_MACRO
1747 -V : print version number and exit (with a zero status).
1754 case "$fastread$alldone" in
1757 case "$extractsh" in
1760 if test ! -t 0; then
1761 echo "Say 'sh Configure', not 'sh <Configure'"
1771 true) exec 1>/dev/null;;
1774 : run the defines and the undefines, if any, but leave the file out there...
1777 : create the posthint manipulation script and leave the file out there...
1782 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1783 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1784 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1785 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1786 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1789 : Some greps do not return status, grrr.
1790 echo "grimblepritz" >grimble
1791 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1793 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1799 : the following should work in any shell
1803 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1804 cat >contains <<'EOSS'
1805 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1810 : Find the path to the source tree
1813 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1817 *) src=`cd ../$src && pwd` ;;
1830 if test -f $rsrc/Configure && \
1831 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1833 : found it, so we are ok.
1836 for src in . .. ../.. ../../.. ../../../..; do
1837 if test -f ../$src/Configure && \
1838 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1849 Sorry, I can't seem to locate the source dir for $package. Please start
1850 Configure with an explicit path -- i.e. /some/path/Configure.
1858 echo "Sources for $package found in \"$src\"." >&4
1862 : script used to extract .SH files with variable substitutions
1863 cat >extract <<'EOS'
1865 echo "Doing variable substitutions on .SH files..."
1866 if test -f MANIFEST; then
1867 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1869 echo "(Looking for .SH files under the source directory.)"
1870 set x `(cd "$src"; find . -name "*.SH" -print)`
1874 0) set x `(cd "$src"; echo *.SH)`; shift;;
1876 if test ! -f "$src/$1"; then
1882 while test $name; do
1883 if test ! -d "$name"; then
1884 create="$name $create";
1885 name=`echo $name | sed -e "s|^[^/]*$||"`;
1886 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1891 for file in $create; do
1900 dir=`expr X$file : 'X\(.*\)/'`
1901 file=`expr X$file : 'X.*/\(.*\)'`
1902 (cd "$dir" && . ./$file)
1912 dir=`expr X$file : 'X\(.*\)/'`
1913 file=`expr X$file : 'X.*/\(.*\)'`
1914 (set x $dir; shift; eval $mkdir_p)
1915 sh <"$src/$dir/$file"
1924 if test -f "$src/config_h.SH"; then
1925 if test ! -f config.h; then
1926 : oops, they left it out of MANIFEST, probably, so do it anyway.
1927 . "$src/config_h.SH"
1932 : extract files and exit if asked to do so
1933 case "$extractsh" in
1935 case "$realsilent" in
1939 case "$config_sh" in
1940 '') config_sh='config.sh';;
1943 echo "Fetching answers from $config_sh..."
1946 test "$override" && . ./optdef.sh
1950 echo "Extraction done."
1955 : Eunice requires " " instead of "", can you believe it
1958 echo "Beginning of configuration questions for $package."
1960 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1962 : first determine how to suppress newline on echo command
1964 echo "Checking echo to see how to suppress newlines..."
1965 (echo "hi there\c" ; echo " ") >.echotmp
1966 if $contains c .echotmp >/dev/null 2>&1 ; then
1977 echo $n "The star should be here-->$c"
1981 : Now test for existence of everything in MANIFEST
1983 if test -f "$rsrc/MANIFEST"; then
1984 echo "First let's make sure your kit is complete. Checking..." >&4
1985 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1986 (split -l 50 2>/dev/null || split -50)
1989 for filelist in x??; do
1990 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1991 >/dev/null 2>>"$tmppwd/missing")
1993 if test -s missing; then
1997 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1999 You have the option of continuing the configuration process, despite the
2000 distinct possibility that your kit is damaged, by typing 'y'es. If you
2001 do, don't blame me if something goes wrong. I advise you to type 'n'o
2002 and contact the author (perlbug@perl.org).
2005 echo $n "Continue? [n] $c" >&4
2009 echo "Continuing..." >&4
2013 echo "ABORTING..." >&4
2018 echo "Looks good..."
2021 echo "There is no MANIFEST file. I hope your kit is complete !"
2025 : Find the appropriate value for a newline for tr
2027 if test -n "$DJGPP"; then
2030 if test X"$trnl" = X; then
2031 case "`echo foo|tr '\n' x 2>/dev/null`" in
2035 if test X"$trnl" = X; then
2036 case "`echo foo|tr '\012' x 2>/dev/null`" in
2037 foox) trnl='\012' ;;
2040 if test X"$trnl" = X; then
2041 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2042 fooxy) trnl='\n\r' ;;
2045 if test X"$trnl" = X; then
2048 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2054 : compute the number of columns on the terminal for proper question formatting
2059 : set up the echo used in my read
2060 myecho="case \"\$xxxm\" in
2061 '') echo $n \"\$rp $c\" >&4;;
2063 '') echo $n \"[\$xxxm] $c\";;
2065 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2067 echo $n \"[\$xxxm] $c\" >&4
2069 echo $n \"\$rp [\$xxxm] $c\" >&4
2075 : now set up to do reads with possible shell escape and default assignment
2081 case "\$fastread" in
2082 yes) case "\$dflt" in
2085 case "\$silent-\$rp" in
2090 *) case "\$silent" in
2091 true) case "\$rp" in
2096 while expr "X\$ans" : "X!" >/dev/null; do
2100 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2108 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2117 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2122 echo "(OK, I'll run with -d after this question.)" >&4
2125 echo "*** Sorry, \$1 not supported yet." >&4
2135 echo "*** Substitution done -- please confirm."
2137 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2142 echo "*** Error -- try again."
2149 case "\$ans\$xxxm\$nostick" in
2161 : create .config dir to save info across Configure sessions
2162 test -d ../.config || mkdir ../.config
2163 cat >../.config/README <<EOF
2164 This directory created by Configure to save information that should
2165 persist across sessions for $package.
2167 You may safely delete it if you wish.
2170 : See if we are using a devel version and want that
2171 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2174 usedevel="$define" ;;
2175 *) case "$xversion" in
2178 *** WHOA THERE!!! ***
2180 This is an UNSTABLE DEVELOPMENT release.
2181 The version of this $package distribution is $xversion, that is, odd,
2182 (as opposed to even) and that signifies a development release.
2183 If you want a maintenance release, you want an even-numbered version.
2185 Do ***NOT*** install this into production use.
2186 Data corruption and crashes are possible.
2188 It is most seriously suggested that you do not continue any further
2189 unless you want to help in developing and debugging Perl.
2191 If you *still* want to build perl, you can answer 'y' now,
2192 or pass -Dusedevel to Configure.
2195 rp='Do you really want to continue?'
2199 [yY]) echo >&4 "Okay, continuing."
2200 usedevel="$define" ;;
2201 *) echo >&4 "Okay, bye."
2212 case "$versiononly" in
2213 '') versiononly="$define" ;;
2215 case "$installusrbinperl" in
2216 '') installusrbinperl="$undef" ;;
2221 : general instructions
2224 user=`(logname) 2>/dev/null`
2226 '') user=`whoami 2>&1`;;
2228 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2231 rp='Would you like to see the instructions?'
2242 This installation shell script will examine your system and ask you questions
2243 to determine how the perl5 package should be installed. If you get
2244 stuck on a question, you may use a ! shell escape to start a subshell or
2245 execute a command. Many of the questions will have default answers in square
2246 brackets; typing carriage return will give you the default.
2248 On some of the questions which ask for file or directory names you are allowed
2249 to use the ~name construct to specify the login directory belonging to "name",
2250 even if you don't have a shell which knows about that. Questions where this is
2251 allowed will be marked "(~name ok)".
2255 dflt='Type carriage return to continue'
2259 The prompter used in this script allows you to use shell variables and
2260 backticks in your answers. You may use $1, $2, etc... to refer to the words
2261 in the default answer, as if the default line was a set of arguments given to a
2262 script shell. This means you may also use $* to repeat the whole default line,
2263 so you do not have to re-type everything to add something to the default.
2265 Every time there is a substitution, you will have to confirm. If there is an
2266 error (e.g. an unmatched backtick), the default answer will remain unchanged
2267 and you will be prompted again.
2269 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2270 the questions and use the computed defaults (or the previous answers if there
2271 was already a config.sh file). Type 'Configure -h' for a list of options.
2272 You may also start interactively and then answer '& -d' at any prompt to turn
2273 on the non-interactive behaviour for the remainder of the execution.
2279 Much effort has been expended to ensure that this shell script will run on any
2280 Unix system. If despite that it blows up on yours, your best bet is to edit
2281 Configure and run it again. If you can't run Configure for some reason,
2282 you'll have to generate a config.sh file by hand. Whatever problems you
2283 have, let me (perlbug@perl.org) know how I blew it.
2285 This installation script affects things in two ways:
2287 1) it may do direct variable substitutions on some of the files included
2289 2) it builds a config.h file for inclusion in C programs. You may edit
2290 any of these files as the need arises after running this script.
2292 If you make a mistake on a question, there is no easy way to back up to it
2293 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2294 files. Configure will offer to let you do this before it runs the SH files.
2297 dflt='Type carriage return to continue'
2299 case "$firsttime" in
2300 true) echo $user >>../.config/instruct;;
2304 : find out where common programs are
2306 echo "Locating common programs..." >&4
2319 if test -d \$dir/\$thing; then
2325 for thisthing in \$dir/\$thing; do
2326 : just loop through to pick last item
2328 if test -f \$thisthing; then
2331 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2334 elif test -f \$dir/\$thing.exe; then
2335 if test -n "$DJGPP"; then
2336 echo \$dir/\$thing.exe
2337 elif test "$eunicefix" != ":"; then
2338 : on Eunice apparently
2391 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2392 pth="$pth /lib /usr/lib"
2393 for file in $loclist; do
2397 if test -f "$xxx"; then
2400 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2401 xxx=`./loc $file $file $pth`
2404 '') xxx=`./loc $file $file $pth`;;
2405 *) xxx=`./loc $xxx $xxx $pth`;;
2407 eval $file=$xxx$_exe
2411 echo $file is in $xxx.
2414 echo $file is in $xxx.
2417 echo "I don't know where '$file' is, and my life depends on it." >&4
2418 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2424 echo "Don't worry if any of the following aren't found..."
2426 for file in $trylist; do
2430 if test -f "$xxx"; then
2433 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2434 xxx=`./loc $file $file $pth`
2437 '') xxx=`./loc $file $file $pth`;;
2438 *) xxx=`./loc $xxx $xxx $pth`;;
2440 eval $file=$xxx$_exe
2444 echo $file is in $xxx.
2447 echo $file is in $xxx.
2450 echo "I don't see $file out there, $say."
2457 echo "Substituting grep for egrep."
2464 *) if $less -R </dev/null >/dev/null; then
2465 echo "Substituting less -R for less."
2473 echo "Substituting cp for ln."
2482 echo "I can't find make or gmake, and my life depends on it." >&4
2483 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2491 *) # We can't have osname yet.
2492 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2493 # Assume that gmake, if found, is definitely GNU make
2494 # and prefer it over the system make.
2495 echo "Substituting gmake for make."
2503 echo "Hopefully test is built into your sh."
2506 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2507 echo "Using the test built into your sh."
2515 echo "Hopefully echo is built into your sh."
2520 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2521 $echo $n "hi there$c" >foo1
2522 echo $n "hi there$c" >foo2
2523 if cmp foo1 foo2 >/dev/null 2>&1; then
2524 echo "They are compatible. In fact, they may be identical."
2531 They are not compatible! You are probably running ksh on a non-USG system.
2532 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2533 have echo built in and we may have to run some Bourne shell scripts. That
2534 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2537 $echo $n "The star should be here-->$c"
2544 # This question was auctioned at YAPC::Europe-2007 in Vienna
2545 # I never promised you could answer it. I only auctioned the question.
2547 The following message is sponsored by
2549 Dresden.pm<--The stars should be here.
2551 Dear Perl user, system administrator or package
2552 maintainer, the Perl community sends greetings to
2553 you. Do you (emblematical) greet back [Y/n]? n
2557 : Check what type of C compiler we use
2561 cat <<'EOSC' >>trygcc
2566 int main(int argc, char *argv[]) {
2570 if $cc -o try $ccflags $ldflags try.c; then
2573 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2579 # Skip this test because it gives a false match on output like:
2580 # ./trygcc: line 23: cc: command not found
2581 # case "`$cc -v -c try.c 2>&1`" in
2582 # *gcc*) trygcc=no ;;
2584 if $test X"$trygcc" = Xyes; then
2585 if gcc -o try -c try.c; then
2587 echo "You seem to have a working gcc, though." >&4
2588 # Switching compilers may undo the work of hints files.
2589 # The most common problem is -D_REENTRANT for threads.
2590 # This heuristic catches that case, but gets false positives
2591 # if -Dusethreads was not actually specified. Better to
2592 # bail out here with a useful message than fail
2593 # mysteriously later. Should we perhaps just try to
2594 # re-invoke Configure -Dcc=gcc config_args ?
2595 if $test -f usethreads.cbu; then
2598 *** However, any setting of the C compiler flags (e.g. for thread support)
2599 *** will be lost. It may be necessary for you to restart Configure and
2600 *** add -Dcc=gcc to your Configure command line.
2603 rp="Would you like to go ahead and try gcc anyway?"
2606 rp="Would you like to use it?"
2609 if $test -f myread; then
2612 if $test -f UU/myread; then
2615 echo "Cannot find myread, sorry. Aborting." >&2
2620 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2633 cat <<'EOSC' >>checkcc
2638 int main(int argc, char *argv[]) {
2642 if $cc -o try $ccflags $ldflags try.c; then
2645 if $test X"$despair" = Xyes; then
2646 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2649 You need to find a working C compiler.
2650 Either (purchase and) install the C compiler supplied by your OS vendor,
2651 or for a free C compiler try http://gcc.gnu.org/
2652 I cannot continue any further, aborting.
2661 : determine whether symbolic links are supported
2664 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2665 echo "Symbolic links are supported." >&4
2668 echo "Symbolic links are NOT supported." >&4
2673 : determine whether symbolic links are supported
2677 echo "Checking how to test for symbolic links..." >&4
2679 if $test "X$issymlink" = X; then
2681 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2682 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2684 if test $? = 0; then
2687 echo "Your builtin 'test -h' may be broken." >&4
2690 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2693 if test -f "$p/$test"; then
2702 echo "Trying external '$test -h'." >&4
2703 issymlink="$test -h"
2704 if $test ! -h sym >/dev/null 2>&1; then
2705 echo "External '$test -h' is broken, too." >&4
2713 if $test "X$issymlink" = X; then
2714 if $test -L sym 2>/dev/null; then
2715 issymlink="$test -L"
2716 echo "The builtin '$test -L' worked." >&4
2719 if $test "X$issymlink" != X; then
2720 echo "You can test for symbolic links with '$issymlink'." >&4
2722 echo "I do not know how you can test for symbolic links." >&4
2726 *) echo "No symbolic links, so not testing for their testing..." >&4
2731 : Make symlinks util
2732 case "$mksymlinks" in
2735 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2738 *) case "$lns:$issymlink" in
2739 *"ln"*" -s:"*"test -"?)
2740 echo "Creating the symbolic links..." >&4
2741 echo "(First creating the subdirectories...)" >&4
2743 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2745 test -z "$directory" && break
2749 if test ! -d t/base; then
2750 echo "Failed to create the subdirectories. Aborting." >&4
2753 echo "(Then creating the symlinks...)" >&4
2754 awk '{print $1}' $src/MANIFEST | while true; do
2756 test -z "$filename" && break
2757 if test -f $filename; then
2758 if $issymlink $filename; then
2762 if test -f $filename; then
2763 echo "$filename already exists, not symlinking."
2765 ln -s $src/$filename $filename
2769 if test ! -f t/base/lex.t; then
2770 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2775 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2783 : Check for Cross-Compilation
2784 case "$usecrosscompile" in
2786 $echo "Cross-compiling..."
2789 *-*-gcc) # A cross-compiling gcc, probably.
2790 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2792 # leave out ld, choosing it is more complex
2794 ranlib=$targetarch-ranlib
2795 $echo 'extern int foo;' > try.c
2796 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2798 if $test $# -gt 0; then
2800 incpth="`$echo $incpth|$sed 's/^ //'`"
2801 echo "Guessing incpth '$incpth'." >&4
2803 j="`$echo $i|$sed 's,/include$,/lib,'`"
2804 if $test -d $j; then
2808 libpth="`$echo $libpth|$sed 's/^ //'`"
2809 echo "Guessing libpth '$libpth'." >&4
2814 case "$targetarch" in
2815 '') echo "Targetarch not defined." >&4; croak=y ;;
2816 *) echo "Using targetarch $targetarch." >&4 ;;
2819 '') echo "Incpth not defined." >&4; croak=y ;;
2820 *) echo "Using incpth '$incpth'." >&4 ;;
2823 '') echo "Libpth not defined." >&4; croak=y ;;
2824 *) echo "Using libpth '$libpth'." >&4 ;;
2827 '') for i in $incpth; do
2828 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2830 echo "Guessing usrinc $usrinc." >&4
2835 '') echo "Usrinc not defined." >&4; croak=y ;;
2838 *) echo "Using usrinc $usrinc." >&4 ;;
2840 case "$targethost" in
2841 '') echo "Targethost not defined." >&4; croak=y ;;
2842 *) echo "Using targethost $targethost." >&4
2847 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2850 /*) run=$src/Cross/run
2851 targetmkdir=$src/Cross/mkdir
2853 from=$src/Cross/from
2855 *) pwd=`$test -f ../Configure & cd ..; pwd`
2857 targetmkdir=$pwd/Cross/mkdir
2859 from=$pwd/Cross/from
2862 case "$targetrun" in
2863 '') targetrun=ssh ;;
2868 case "$targetfrom" in
2869 '') targetfrom=scp ;;
2873 from=$from-$targetfrom
2874 case "$targetdir" in
2876 echo "Guessing targetdir $targetdir." >&4
2879 case "$targetuser" in
2881 echo "Guessing targetuser $targetuser." >&4
2884 case "$targetfrom" in
2888 case "$targetrun" in
2900 '') cwd=$targetdir ;;
2904 if $test ! -f \$exe.xok; then
2908 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2911 *) echo "Unknown targetrun '$targetrun'" >&4
2915 case "$targetmkdir" in
2917 cat >$targetmkdir <<EOF
2919 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2921 $chmod a+rx $targetmkdir
2923 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2935 $targetmkdir \`dirname \$f\`
2936 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2939 $targetmkdir $targetdir/\`dirname \$f\`
2940 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2953 $mkdir -p $targetdir/\`dirname \$f\`
2954 $cp \$f $targetdir/\$f || exit 1
2957 $targetmkdir $targetdir/\`dirname \$f\`
2958 $cp \$f $targetdir/\$f || exit 1
2965 *) echo "Unknown targetto '$targetto'" >&4
2969 case "$targetfrom" in
2976 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2981 cp) cat >$from <<EOF
2986 cp $targetdir/\$f . || exit 1
2991 *) echo "Unknown targetfrom '$targetfrom'" >&4
2995 if $test ! -f $run; then
2996 echo "Target 'run' script '$run' not found." >&4
3000 if $test ! -f $to; then
3001 echo "Target 'to' script '$to' not found." >&4
3005 if $test ! -f $from; then
3006 echo "Target 'from' script '$from' not found." >&4
3010 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3014 Using '$run' for remote execution,
3015 and '$from' and '$to'
3016 for remote file transfer.
3022 usecrosscompile='undef'
3027 : see whether [:lower:] and [:upper:] are supported character classes
3029 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3031 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3035 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3036 # (0xd9 and 0xe2), therefore that is a nice testing point.
3037 if test "X$up" = X -o "X$low" = X; then
3038 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3044 if test "X$up" = X -o "X$low" = X; then
3045 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3051 if test "X$up" = X -o "X$low" = X; then
3052 case "`echo RS | od -x 2>/dev/null`" in
3054 echo "Hey, this might be EBCDIC." >&4
3055 if test "X$up" = X -o "X$low" = X; then
3056 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3057 rs) up='[A-IJ-RS-Z]'
3062 if test "X$up" = X -o "X$low" = X; then
3063 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3073 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3075 echo "Using $up and $low to convert case." >&4
3078 echo "I don't know how to translate letters from upper to lower case." >&4
3079 echo "Your tr is not acting any way I know of." >&4
3083 : set up the translation script tr, must be called with ./tr of course
3087 '[A-Z][a-z]') exec $tr '$up' '$low';;
3088 '[a-z][A-Z]') exec $tr '$low' '$up';;
3095 : Try to determine whether config.sh was made on this system
3096 case "$config_sh" in
3098 myuname=`$uname -a 2>/dev/null`
3099 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3100 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3101 # because the A-Z/a-z are not consecutive.
3102 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3103 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3104 newmyuname="$myuname"
3106 case "$knowitall" in
3108 if test -f ../config.sh; then
3109 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3110 eval "`grep myuname= ../config.sh`"
3112 if test "X$myuname" = "X$newmyuname"; then
3120 : Get old answers from old config file if Configure was run on the
3121 : same system, otherwise use the hints.
3124 if test -f config.sh; then
3126 rp="I see a config.sh file. Shall I use it to set the defaults?"
3129 n*|N*) echo "OK, I'll ignore it."
3130 mv config.sh config.sh.old
3131 myuname="$newmyuname"
3133 *) echo "Fetching default answers from your old config.sh file..." >&4
3141 : Older versions did not always set $sh. Catch re-use of such
3151 if test ! -f config.sh; then
3154 First time through, eh? I have some defaults handy for some systems
3155 that need some extra help getting the Configure answers right:
3158 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3160 : Half the following guesses are probably wrong... If you have better
3161 : tests or hints, please send them to perlbug@perl.org
3162 : The metaconfig authors would also appreciate a copy...
3163 $test -f /irix && osname=irix
3164 $test -f /xenix && osname=sco_xenix
3165 $test -f /dynix && osname=dynix
3166 $test -f /dnix && osname=dnix
3167 $test -f /lynx.os && osname=lynxos
3168 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3169 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3170 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3171 $test -f /bin/mips && /bin/mips && osname=mips
3172 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3173 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3174 $test -d /usr/apollo/bin && osname=apollo
3175 $test -f /etc/saf/_sactab && osname=svr4
3176 $test -d /usr/include/minix && osname=minix
3177 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3178 if $test -d /MachTen -o -d /MachTen_Folder; then
3180 if $test -x /sbin/version; then
3181 osvers=`/sbin/version | $awk '{print $2}' |
3182 $sed -e 's/[A-Za-z]$//'`
3183 elif $test -x /usr/etc/version; then
3184 osvers=`/usr/etc/version | $awk '{print $2}' |
3185 $sed -e 's/[A-Za-z]$//'`
3191 $test -f /sys/posix.dll &&
3192 $test -f /usr/bin/what &&
3193 set X `/usr/bin/what /sys/posix.dll` &&
3194 $test "$3" = UWIN &&
3198 if $test -f $uname; then
3206 umips) osname=umips ;;
3209 [23]100) osname=mips ;;
3210 next*) osname=next ;;
3212 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3213 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3216 elif $test -f /etc/kconfig; then
3218 if test "$lns" = "$ln -s"; then
3220 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3222 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3229 if test -n "$DJGPP"; then
3238 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3240 # oslevel can fail with:
3241 # oslevel: Unable to acquire lock.
3242 *not\ found) osvers="$4"."$3" ;;
3243 '<3240'|'<>3240') osvers=3.2.0 ;;
3244 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3245 '=3250'|'>3250') osvers=3.2.5 ;;
3249 bsd386) osname=bsd386
3252 cygwin*) osname=cygwin
3255 *dc.osx) osname=dcosx
3261 domainos) osname=apollo
3267 dragonfly) osname=dragonfly
3270 dynixptx*) osname=dynixptx
3271 osvers=`echo "$4"|sed 's/^v//'`
3273 freebsd) osname=freebsd
3275 genix) osname=genix ;;
3279 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3295 netbsd*) osname=netbsd
3298 news-os) osvers="$3"
3300 4*) osname=newsos4 ;;
3304 next*) osname=next ;;
3305 nonstop-ux) osname=nonstopux ;;
3306 openbsd) osname=openbsd
3312 POSIX-BC | posix-bc ) osname=posix-bc
3315 powerux | power_ux | powermax_os | powermaxos | \
3316 powerunix | power_unix) osname=powerux
3322 solaris) osname=solaris
3324 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3331 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3335 titanos) osname=titanos
3344 ultrix) osname=ultrix
3347 osf1|mls+) case "$5" in
3350 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3353 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3356 hp*) osname=hp_osf1 ;;
3357 mips) osname=mips_osf1 ;;
3360 # UnixWare 7.1.2 is known as Open UNIX 8
3361 openunix|unixware) osname=svr5
3369 $2) case "$osname" in
3373 : svr4.x or possibly later
3383 if test -f /stand/boot ; then
3384 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3385 if test -n "$INITPROG" -a -f "$INITPROG"; then
3386 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3387 if test -n "$isesix"; then
3395 *) if test -f /etc/systemid; then
3397 set `echo $3 | $sed 's/\./ /g'` $4
3398 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3400 elif $test -f $src/hints/sco_$1_$2.sh; then
3402 elif $test -f $src/hints/sco_$1.sh; then
3407 '') : Still unknown. Probably a generic Sys V.
3416 *) case "$osname" in
3417 '') : Still unknown. Probably a generic BSD.
3425 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3426 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3427 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3430 $rm -f UU/kernel.what
3431 elif test -d c:/. -o -n "$is_os2" ; then
3438 case "$targetarch" in
3441 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3446 : Now look for a hint file osname_osvers, unless one has been
3447 : specified already.
3450 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3451 : Also try without trailing minor version numbers.
3452 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3453 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3454 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3455 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3458 *) case "$osvers" in
3461 *) if $test -f $src/hints/$file.sh ; then
3463 elif $test -f $src/hints/$xfile.sh ; then
3465 elif $test -f $src/hints/$xxfile.sh ; then
3467 elif $test -f $src/hints/$xxxfile.sh ; then
3469 elif $test -f $src/hints/$xxxxfile.sh ; then
3471 elif $test -f "$src/hints/${osname}.sh" ; then
3480 if $test -f Policy.sh ; then
3483 none) dflt="Policy" ;;
3484 *) dflt="Policy $dflt" ;;
3489 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3493 if $test -f Policy.sh ; then
3496 There's also a Policy hint file available, which should make the
3497 site-specific (policy) questions easier to answer.
3504 You may give one or more space-separated answers, or "none" if appropriate.
3505 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3506 previous run of Configure, you may specify it as well as or instead of
3507 OS-specific hints. If hints are provided for your OS, you should use them:
3508 although Perl can probably be built without hints on many platforms, using
3509 hints often improve performance and may enable features that Configure can't
3510 set up on its own. If there are no hints that match your OS, specify "none";
3511 DO NOT give a wrong version or a wrong OS.
3515 rp="Which of these apply, if any?"
3518 for file in $tans; do
3519 if $test X$file = XPolicy -a -f Policy.sh; then
3521 $cat Policy.sh >> UU/config.sh
3522 elif $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"$tans" = X -o X"$tans" = Xnone ; then
3528 : Give one chance to correct a possible typo.
3529 echo "$file.sh does not exist"
3531 rp="hint to use instead?"
3533 for file in $ans; do
3534 if $test -f "$src/hints/$file.sh"; then
3535 . $src/hints/$file.sh
3536 $cat $src/hints/$file.sh >> UU/config.sh
3537 elif $test X$ans = X -o X$ans = Xnone ; then
3540 echo "$file.sh does not exist -- ignored."
3547 : Remember our hint file for later.
3548 if $test -f "$src/hints/$file.sh" ; then
3558 echo "Fetching default answers from $config_sh..." >&4
3562 cp $config_sh config.sh 2>/dev/null
3572 test "$override" && . ./optdef.sh
3574 : Restore computed paths
3575 for file in $loclist $trylist; do
3576 eval $file="\$_$file"
3581 Configure uses the operating system name and version to set some defaults.
3582 The default value is probably right if the name rings a bell. Otherwise,
3583 since spelling matters for me, either accept the default or answer "none"
3590 ''|' '|none) dflt=none ;;
3591 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3594 *) dflt="$osname" ;;
3596 rp="Operating system name?"
3600 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3606 ''|' '|none) dflt=none ;;
3607 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3608 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3610 ''|' ') dflt=none ;;
3615 *) dflt="$osvers" ;;
3617 rp="Operating system version?"
3627 : who configured the system
3628 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3631 cf_by=`(logname) 2>/dev/null`
3634 cf_by=`(whoami) 2>/dev/null`
3636 "") cf_by=unknown ;;
3641 : decide how portable to be. Allow command line overrides.
3642 case "$d_portable" in
3644 *) d_portable="$define" ;;
3647 : set up shell script to do ~ expansion
3653 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3656 if $test -f /bin/csh; then
3657 /bin/csh -f -c "glob \$1"
3662 name=\`$expr x\$1 : '..\([^/]*\)'\`
3663 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3664 if $test ! -d "\$dir"; then
3666 echo "\$me: can't locate home directory for: \$name" >&2
3671 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3687 : now set up to get a file name
3691 cat <<'EOSC' >>getfile
3707 : getfile will accept an answer from the comma-separated list
3708 : enclosed in parentheses even if it does not meet other criteria.
3709 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3710 fn=`echo $fn | sed 's/(.*)//'`
3716 loc_file=`expr $fn : '.*:\(.*\)'`
3717 fn=`expr $fn : '\(.*\):.*'`
3725 */*) fullpath=true;;
3734 *e*) exp_file=true;;
3737 *p*) nopath_ok=true;;
3742 *d*) type='Directory';;
3743 *l*) type='Locate';;
3748 Locate) what='File';;
3753 case "$d_portable" in
3761 while test "$type"; do
3766 true) rp="$rp (~name ok)";;
3769 if test -f UU/getfile.ok && \
3770 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3789 value=`UU/filexp $ans`
3792 if test "$ans" != "$value"; then
3793 echo "(That expands to $value on this system.)"
3807 /*) value="$ansexp" ;;
3808 [a-zA-Z]:/*) value="$ansexp" ;;
3813 echo "I shall only accept a full path name, as in /bin/ls." >&4
3814 echo "Use a ! shell escape if you wish to check pathnames." >&4
3817 echo "Please give a full path name, starting with slash." >&4
3820 echo "Note that using ~name is ok provided it expands well." >&4
3833 for fp in $gfpth; do
3834 if test "X$fp" = X.; then
3839 if test -f "$pf"; then
3841 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3843 echo "($value is not a plain file, but that's ok.)"
3846 if test X"$type" = X; then
3853 for fp in $gfpth; do
3854 if test "X$fp" = X.; then
3859 direxp="$fp/$ansexp"
3861 if test -d "$direxp"; then
3869 if test -d "$ansexp"; then
3870 echo "(Looking for $loc_file in directory $value.)"
3871 value="$value/$loc_file"
3872 ansexp="$ansexp/$loc_file"
3874 if test -f "$ansexp"; then
3877 case "$nopath_ok" in
3878 true) case "$value" in
3880 *) echo "Assuming $value will be in people's path."
3896 if test "$fastread" = yes; then
3901 rp="$what $value doesn't exist. Use that name anyway?"
3920 test "X$gfpthkeep" != Xy && gfpth=""
3923 : determine root of directory hierarchy where package will be installed.
3926 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3929 dflt=`echo "$prefix" | sed 's/.$//'`
3937 By default, $package will be installed in $dflt/bin, manual pages
3938 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3939 installation directories. Typically this is something like /usr/local.
3940 If you wish to have binaries under /usr/bin but other parts of the
3941 installation under /usr/local, that's ok: you will be prompted
3942 separately for each of the installation directories, the prefix being
3943 only used to set the defaults.
3947 rp='Installation prefix to use?'
3955 *) oldprefix="$prefix";;
3962 : allow them to override the AFS root
3965 *) afsroot=$afsroot ;;
3971 $define|true) afs=true ;;
3972 $undef|false) afs=false ;;
3973 *) if $test -d $afsroot; then
3981 echo "AFS may be running... I'll be extra cautious then..." >&4
3983 echo "AFS does not seem to be running..." >&4
3986 : determine installation prefix for where package is to be installed.
3990 Since you are running AFS, I need to distinguish the directory in which
3991 files will reside from the directory in which they are installed (and from
3992 which they are presumably copied to the former directory by occult means).
3995 case "$installprefix" in
3996 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3997 *) dflt="$installprefix";;
4002 In some special cases, particularly when building $package for distribution,
4003 it is convenient to distinguish the directory in which files should be
4004 installed from the directory ($prefix) in which they will
4005 eventually reside. For most users, these two directories are the same.
4008 case "$installprefix" in
4010 *) dflt=$installprefix;;
4014 rp='What installation prefix should I use for installing files?'
4016 installprefix="$ans"
4017 installprefixexp="$ansexp"
4019 : Perform the prefixexp/installprefixexp correction if necessary
4020 cat <<EOS >installprefix
4023 cat <<'EOSC' >>installprefix
4024 : Change installation prefix, if necessary.
4025 if $test X"$prefix" != X"$installprefix"; then
4026 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4028 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4031 chmod +x installprefix
4032 $eunicefix installprefix
4034 : Set variables such as privlib and privlibexp from the output of ./getfile
4035 : performing the prefixexp/installprefixexp correction if necessary.
4036 cat <<EOS >setprefixvar
4039 cat <<'EOSC' >>setprefixvar
4040 eval "${prefixvar}=\"\$ans\""
4041 eval "${prefixvar}exp=\"\$ansexp\""
4044 chmod +x setprefixvar
4045 $eunicefix setprefixvar
4047 : set up the script used to warn in case of inconsistency
4056 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4058 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4059 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4064 echo "*** WHOA THERE!!! ***" >&4
4065 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4068 rp=" Keep the $hint value?"
4071 y) td=$was; tu=$was;;
4075 : function used to set '$1' to '$val'
4076 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4078 $define$undef) . ./whoa; eval "$var=\$td";;
4079 $undef$define) . ./whoa; eval "$var=\$tu";;
4080 *) eval "$var=$val";;
4083 : get the patchlevel
4085 echo "Getting the current patchlevel..." >&4
4086 if $test -r $rsrc/patchlevel.h;then
4087 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4088 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4089 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4090 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4091 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4092 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4093 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4102 $echo "(You do not have patchlevel.h. Eek.)"
4104 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4105 version_patchlevel_string="version $patchlevel subversion $subversion"
4106 case "$perl_patchlevel" in
4108 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4109 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4113 $echo "(You have $package $version_patchlevel_string.)"
4117 : XXX Should be a Configure test for double-dots in filenames.
4118 version=`echo $revision $patchlevel $subversion | \
4119 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4120 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4121 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4124 version=`echo $revision $patchlevel $subversion | \
4125 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4126 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4127 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4130 : Special case the 5.005_xx maintenance series, which used 5.005
4131 : without any subversion label as a subdirectory in $sitelib
4132 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4133 api_versionstring='5.005'
4136 : Do we want threads support and if so, what type
4137 case "$usethreads" in
4138 $define|true|[yY]*) dflt='y';;
4139 *) # Catch case where user specified ithreads or 5005threads but
4140 # forgot -Dusethreads (A.D. 4/2002)
4141 case "$useithreads$use5005threads" in
4142 *$define*) dflt='y';;
4149 Perl can be built to take advantage of threads on some systems.
4150 To do so, Configure can be run with -Dusethreads.
4152 Note that Perl built with threading support runs slightly slower
4153 and uses more memory than plain Perl. The current implementation
4154 is believed to be stable, but it is fairly new, and so should be
4155 treated with caution.
4157 If this doesn't make any sense to you, just accept the default '$dflt'.
4159 rp='Build a threading Perl?'
4162 y|Y) val="$define" ;;
4168 if $test $patchlevel -lt 9; then
4169 case "$usethreads" in
4173 Since release 5.6, Perl has had two different threading implementations,
4174 the newer interpreter-based version (ithreads) with one interpreter per
4175 thread, and the older 5.005 version (5005threads).
4176 The 5005threads version is effectively unmaintained and will probably be
4177 removed in Perl 5.10, so there should be no need to build a Perl using it
4178 unless needed for backwards compatibility with some existing 5.005threads
4182 : Default to ithreads unless overridden on command line or with
4185 case "$use5005threads" in
4186 $define|true|[yY]*) dflt='n';;
4188 case "$useithreads" in
4189 $undef|false|[nN]*) dflt='n';;
4191 rp='Use the newer interpreter-based ithreads?'
4194 y|Y) val="$define" ;;
4199 : Now set use5005threads to the opposite value.
4200 case "$useithreads" in
4201 $define) val="$undef" ;;
4208 useithreads="$undef"
4209 use5005threads="$undef"
4213 case "$useithreads$use5005threads" in
4217 You cannot have both the ithreads and the 5.005 threads enabled
4218 at the same time. Disabling the 5.005 threads since they are
4219 much less stable than the ithreads.
4222 use5005threads="$undef"
4227 : perl-5.9.x and later
4229 if test X"$usethreads" = "X$define"; then
4230 case "$use5005threads" in
4234 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4241 use5005threads="$undef"
4242 useithreads="$usethreads"
4245 case "$d_oldpthreads" in
4246 '') : Configure tests would be welcome here. For now, assume undef.
4248 *) val="$d_oldpthreads" ;;
4254 : Look for a hint-file generated 'call-back-unit'. If the
4255 : user has specified that a threading perl is to be built,
4256 : we may need to set or change some other defaults.
4257 if $test -f usethreads.cbu; then
4258 echo "Your platform has some specific hints regarding threaded builds, using them..."
4261 case "$usethreads" in
4262 "$define"|true|[yY]*)
4264 (Your platform does not have any specific hints for threaded builds.
4265 Assuming POSIX threads, then.)
4271 : Check if multiplicity is required
4274 Perl can be built so that multiple Perl interpreters can coexist
4275 within the same Perl executable.
4278 case "$useithreads" in
4281 This multiple interpreter support is required for interpreter-based threads.
4285 *) case "$usemultiplicity" in
4286 $define|true|[yY]*) dflt='y';;
4290 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4291 rp='Build Perl for multiplicity?'
4294 y|Y) val="$define" ;;
4302 : Check if morebits is requested
4303 case "$usemorebits" in
4304 "$define"|true|[yY]*)
4305 use64bitint="$define"
4306 uselongdouble="$define"
4307 usemorebits="$define"
4309 *) usemorebits="$undef"
4313 : Determine the C compiler to be used
4319 rp="Use which C compiler?"
4323 : See whether they have no cc but they do have gcc
4325 if $test -f cc.cbu; then
4330 : make some quick guesses about what we are up against
4332 $echo $n "Hmm... $c"
4342 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4343 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4345 echo "Looks kind of like an OSF/1 system, but we'll see..."
4347 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4348 xxx=`./loc addbib blurfl $pth`
4349 if $test -f $xxx; then
4350 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4354 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4355 echo "Looks kind of like an extended USG system, but we'll see..."
4357 echo "Looks kind of like a USG system, but we'll see..."
4361 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4362 echo "Looks kind of like a BSD system, but we'll see..."
4366 echo "Looks kind of like a Version 7 system, but we'll see..."
4369 case "$eunicefix" in
4372 There is, however, a strange, musty smell in the air that reminds me of
4373 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4377 : it so happens the Eunice I know will not run shell scripts in Unix format
4381 echo "Congratulations. You aren't running Eunice."
4385 : Detect OS2. The p_ variable is set above in the Head.U unit.
4386 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4387 : semicolon as a patch separator
4392 I have the feeling something is not exactly right, however...don't tell me...
4393 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4394 (Or you may be running DOS with DJGPP.)
4399 if test -f /xenix; then
4400 echo "Actually, this looks more like a XENIX system..."
4405 echo "It's not Xenix..."
4410 if test -f /venix; then
4411 echo "Actually, this looks more like a VENIX system..."
4418 echo "Nor is it Venix..."
4421 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4422 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4425 : Check if we are using GNU gcc and what its version is
4427 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4431 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4433 printf("%s\n", __VERSION__);
4435 printf("%s\n", "1");
4441 if $cc -o try $ccflags $ldflags try.c; then
4442 gccversion=`$run ./try`
4443 case "$gccversion" in
4444 '') echo "You are not using GNU cc." ;;
4445 *) echo "You are using GNU cc $gccversion."
4451 echo "*** WHOA THERE!!! ***" >&4
4452 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4453 case "$knowitall" in
4455 echo " You'd better start hunting for one and let me know about it." >&4
4461 case "$gccversion" in
4462 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4464 case "$gccversion" in
4465 '') gccosandvers='' ;;
4466 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4467 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4469 case "$gccosandvers" in
4470 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4471 $osname$osvers) ;; # looking good
4472 $osname*) cat <<EOM >&4
4474 *** WHOA THERE!!! ***
4476 Your gcc has not been compiled for the exact release of
4477 your operating system ($gccosandvers versus $osname$osvers).
4479 In general it is a good idea to keep gcc synchronized with
4480 the operating system because otherwise serious problems
4481 may ensue when trying to compile software, like Perl.
4483 I'm trying to be optimistic here, though, and will continue.
4484 If later during the configuration and build icky compilation
4485 problems appear (headerfile conflicts being the most common
4486 manifestation), I suggest reinstalling the gcc to match
4487 your operating system release.
4491 *) gccosandvers='' ;; # failed to parse, better be silent
4499 # gcc 3.* complain about adding -Idirectories that they already know about,
4500 # so we will take those off from locincpth.
4501 case "$gccversion" in
4503 echo "main(){}">try.c
4504 for incdir in $locincpth; do
4505 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4506 grep '^c[cp]p*[01]: warning: changing search order '`
4507 if test "X$warn" != X; then
4508 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4514 : What should the include directory be ?
4516 $echo $n "Hmm... $c"
4520 if $test -f /bin/mips && /bin/mips; then
4521 echo "Looks like a MIPS system..."
4522 $cat >usr.c <<'EOCP'
4523 #ifdef SYSTYPE_BSD43
4527 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4528 dflt='/bsd43/usr/include'
4532 mips_type='System V'
4534 $rm -f usr.c usr.out
4535 echo "and you're compiling with the $mips_type compiler and libraries."
4539 echo "Doesn't look like a MIPS system."
4549 case "$xxx_prompt" in
4552 rp='Where are the include files you want to use?'
4560 : see how we invoke the C preprocessor
4562 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4563 cat <<'EOT' >testcpp.c
4569 if test ! -f cppstdin; then
4570 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4571 # AIX cc -E doesn't show the absolute headerfile
4572 # locations but we'll cheat by using the -M flag.
4573 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
4575 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4578 echo "Keeping your $hint cppstdin wrapper."
4581 wrapper=`pwd`/cppstdin
4585 if $test "X$cppstdin" != "X" && \
4586 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4587 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4589 echo "You used to use $cppstdin $cppminus so we'll use that again."
4591 '') echo "But let's see if we can live without a wrapper..." ;;
4593 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4594 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4596 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4599 echo "(However, $cpprun $cpplast does not work, let's see...)"
4607 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4614 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4615 $cc -E <testcpp.c >testcpp.out 2>&1; \
4616 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4617 echo "Yup, it does."
4620 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4621 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4622 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4623 echo "Yup, it does."
4626 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4627 $cc -P <testcpp.c >testcpp.out 2>&1; \
4628 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4629 echo "Yipee, that works!"
4632 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4633 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4634 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4635 echo "At long last!"
4638 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4639 $cpp <testcpp.c >testcpp.out 2>&1; \
4640 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4645 $cpp - <testcpp.c >testcpp.out 2>&1; \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4647 echo "Hooray, it works! I was beginning to wonder."
4650 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4651 $wrapper <testcpp.c >testcpp.out 2>&1; \
4652 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 rp="No dice. I can't find a C preprocessor. Name one:"
4662 $x_cpp <testcpp.c >testcpp.out 2>&1
4663 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4664 echo "OK, that will do." >&4
4666 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4681 echo "Perhaps can we force $cc -E using a wrapper..."
4682 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4689 echo "Nope, we'll have to live without it..."
4703 "$wrapper"|'cppstdin') ;;
4704 *) $rm -f $wrapper;;
4706 $rm -f testcpp.c testcpp.out
4708 : Set private lib path
4711 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4716 '') dlist="$loclibpth $plibpth $glibpth";;
4717 *) dlist="$libpth";;
4720 : Now check and see which directories actually exist, avoiding duplicates
4724 if $test -d $xxx; then
4727 *) libpth="$libpth $xxx";;
4733 Some systems have incompatible or broken versions of libraries. Among
4734 the directories listed in the question below, please remove any you
4735 know not to be holding relevant libraries, and add any that are needed.
4736 Say "none" for none.
4747 rp="Directories to use for library searches?"
4754 : compute shared library extension
4757 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4767 On some systems, shared libraries may be available. Answer 'none' if
4768 you want to suppress searching of shared libraries for the remainder
4769 of this configuration.
4772 rp='What is the file extension used for shared libraries?'
4776 : Define several unixisms.
4777 : Hints files or command line option can be used to override them.
4778 : The convoluted testing is in case hints files set either the old
4781 '') case "$exe_ext" in
4783 *) _exe="$exe_ext" ;;
4788 '') case "$lib_ext" in
4795 '') case "$obj_ext" in
4802 '') case "$path_sep" in
4813 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4815 : Which makefile gets called first. This is used by make depend.
4816 case "$firstmakefile" in
4817 '') firstmakefile='makefile';;
4820 : Check is we will use socks
4822 $define|true|[yY]*) dflt='y';;
4827 Perl can be built to use the SOCKS proxy protocol library. To do so,
4828 Configure must be run with -Dusesocks. If you use SOCKS you also need
4829 to use the PerlIO abstraction layer, this will be implicitly selected.
4831 If this doesn't make any sense to you, just accept the default '$dflt'.
4833 rp='Build Perl for SOCKS?'
4836 y|Y) val="$define" ;;
4842 : Check for uselongdouble support
4844 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4847 case "$uselongdouble" in
4848 $define|true|[yY]*) dflt='y';;
4853 Perl can be built to take advantage of long doubles which
4854 (if available) may give more accuracy and range for floating point numbers.
4856 If this doesn't make any sense to you, just accept the default '$dflt'.
4858 rp='Try to use long doubles if available?'
4861 y|Y) val="$define" ;;
4867 case "$uselongdouble" in
4868 true|[yY]*) uselongdouble="$define" ;;
4871 : Look for a hint-file generated 'call-back-unit'. If the
4872 : user has specified that long doubles should be used,
4873 : we may need to set or change some other defaults.
4874 if $test -f uselongdouble.cbu; then
4875 echo "Your platform has some specific hints regarding long doubles, using them..."
4876 . ./uselongdouble.cbu
4878 case "$uselongdouble" in
4881 (Your platform does not have any specific hints for long doubles.)
4887 : Looking for optional libraries
4889 echo "Checking for optional libraries..." >&4
4894 case "$libswanted" in
4895 '') libswanted='c_s';;
4898 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4904 for thisdir in $libpth $xlibpth; do
4905 test -d $thisdir && libspath="$libspath $thisdir"
4907 for thislib in $libswanted; do
4908 for thisdir in $libspath; do
4910 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4911 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4912 $test -f "$xxx" && eval $libscheck
4913 $test -f "$xxx" && libstyle=shared
4915 if test ! -f "$xxx"; then
4916 xxx=$thisdir/lib$thislib.$so
4917 $test -f "$xxx" && eval $libscheck
4918 $test -f "$xxx" && libstyle=shared
4920 if test ! -f "$xxx"; then
4921 xxx=$thisdir/lib$thislib$_a
4922 $test -f "$xxx" && eval $libscheck
4923 $test -f "$xxx" && libstyle=static
4925 if test ! -f "$xxx"; then
4926 xxx=$thisdir/$thislib$_a
4927 $test -f "$xxx" && eval $libscheck
4928 $test -f "$xxx" && libstyle=static
4930 if test ! -f "$xxx"; then
4931 xxx=$thisdir/lib${thislib}_s$_a
4932 $test -f "$xxx" && eval $libscheck
4933 $test -f "$xxx" && libstyle=static
4934 $test -f "$xxx" && thislib=${thislib}_s
4936 if test ! -f "$xxx"; then
4937 xxx=$thisdir/Slib$thislib$_a
4938 $test -f "$xxx" && eval $libscheck
4939 $test -f "$xxx" && libstyle=static
4941 if $test -f "$xxx"; then
4943 shared) echo "Found -l$thislib (shared)." ;;
4944 static) echo "Found -l$thislib." ;;
4945 *) echo "Found -l$thislib ($libstyle)." ;;
4949 *) dflt="$dflt -l$thislib"
4950 libsfound="$libsfound $xxx"
4952 libsfiles="$libsfiles $yyy"
4953 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4954 case " $libsdirs " in
4956 *) libsdirs="$libsdirs $yyy" ;;
4963 if $test ! -f "$xxx"; then
4964 echo "No -l$thislib."
4975 ' '|'') dflt='none';;
4980 In order to compile $package on your machine, a number of libraries
4981 are usually needed. Include any other special libraries here as well.
4982 Say "none" for none. The default list is almost always right.
4986 rp="What libraries to use?"
4993 : determine optimization, if desired, or use for debug flag also
4995 ' '|$undef) dflt='none';;
4997 *) dflt="$optimize";;
5001 By default, $package compiles with the -O flag to use the optimizer.
5002 Alternately, you might want to use the symbolic debugger, which uses
5003 the -g flag (on traditional Unix systems). Either flag can be
5004 specified here. To use neither flag, specify the word "none".
5007 rp="What optimizer/debugger flag should be used?"
5011 'none') optimize=" ";;
5014 : Check what DEBUGGING is required from the command line
5015 : -DEBUGGING or -DDEBUGGING or
5016 : -DEBUGGING=both = -g + -DDEBUGGING
5017 : -DEBUGGING=-g or -Doptimize=-g = -g
5018 : -DEBUGGING=none or -UDEBUGGING =
5019 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5022 *) DEBUGGING=$EBUGGING ;;
5025 case "$DEBUGGING" in
5029 *) optimize="$optimize -g" ;;
5033 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5041 case "$DEBUGGING" in
5042 both|$define) dflt='-DDEBUGGING'
5045 : argument order is deliberate, as the flag will start with - which set could
5046 : think is an option
5047 checkccflag='check=$1; flag=$2; callback=$3;
5049 echo "Checking if your compiler accepts $flag" 2>&1;
5050 echo "int main(void) { return 0; }" > gcctest.c;
5051 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5052 echo "Yes, it does." 2>&1;
5053 if $test -s gcctest.out ; then
5054 echo "But your platform does not like it:";
5059 echo "Leaving current flags $ccflags alone." 2>&1
5061 *) dflt="$dflt $flag";
5067 echo "Nope, it does not, but that is ok." 2>&1;
5071 : We will not override a previous value, but we might want to
5072 : augment a hint file
5074 default|recommended)
5075 case "$gccversion" in
5076 1*) dflt="$dflt -fpcc-struct-return" ;;
5078 case "$optimize:$DEBUGGING" in
5079 *-g*:old) dflt="$dflt -DDEBUGGING";;
5081 case "$gccversion" in
5082 2*) if $test -d /etc/conf/kconfig.d &&
5083 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5085 # Interactive Systems (ISC) POSIX mode.
5090 case "$gccversion" in
5093 ?*) set strict-aliasing -fno-strict-aliasing
5097 # For gcc, adding -pipe speeds up compilations for some, but apparently
5098 # some assemblers can't read from stdin. (It also slows down compilations
5099 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5100 case "$gccversion" in
5106 # on x86_64 (at least) we require an extra library (libssp) in the
5107 # link command line. This library is not named, so I infer that it is
5108 # an implementation detail that may change. Hence the safest approach
5109 # is to add the flag to the flags passed to the compiler at link time,
5110 # as that way the compiler can do the right implementation dependant
5112 case "$gccversion" in
5113 ?*) set stack-protector -fstack-protector
5120 case "$mips_type" in
5121 *BSD*|'') inclwanted="$locincpth $usrinc";;
5122 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5124 for thisincl in $inclwanted; do
5125 if $test -d $thisincl; then
5126 if $test x$thisincl != x$usrinc; then
5128 *" -I$thisincl "*);;
5129 *) dflt="$dflt -I$thisincl ";;
5135 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5137 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5145 *) dflt="$dflt -D$2";;
5149 set signal.h LANGUAGE_C; eval $inctest
5153 ccflags="$ccflags -DSOCKS"
5158 default|recommended) dflt="$ccflags $dflt" ;;
5159 *) dflt="$ccflags";;
5168 Your C compiler may want other flags. For this question you should include
5169 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5170 but you should NOT include libraries or ld flags like -lwhatever. If you
5171 want $package to honor its debug switch, you should include -DDEBUGGING here.
5172 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5174 To use no flags, specify the word "none".
5180 rp="Any additional cc flags?"
5187 : the following weeds options from ccflags that are of no interest to cpp
5189 '') cppflags="$ccflags" ;;
5190 *) cppflags="$cppflags $ccflags" ;;
5192 case "$gccversion" in
5193 1*) cppflags="$cppflags -D__GNUC__"
5195 case "$mips_type" in
5197 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5203 echo "Let me guess what the preprocessor flags are..." >&4
5217 *) ftry="$previous $flag";;
5219 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5220 >cpp1.out 2>/dev/null && \
5221 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5222 >cpp2.out 2>/dev/null && \
5223 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5224 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5226 cppflags="$cppflags $ftry"
5236 *-*) echo "They appear to be: $cppflags";;
5238 $rm -f cpp.c cpp?.out
5242 : flags used in final linking phase
5244 '') if ./venix; then
5250 *-posix*) dflt="$dflt -posix" ;;
5253 *) dflt="$ldflags";;
5255 # See note above about -fstack-protector
5257 *-fstack-protector*)
5259 *-fstack-protector*) ;; # Don't add it again
5260 *) dflt="$dflt -fstack-protector" ;;
5265 : Try to guess additional flags to pick up local libraries.
5266 for thislibdir in $libpth; do
5267 case " $loclibpth " in
5270 *"-L$thislibdir "*) ;;
5271 *) dflt="$dflt -L$thislibdir" ;;
5283 Your C linker may need flags. For this question you should
5284 include -L/whatever and any other flags used by the C linker, but you
5285 should NOT include libraries like -lwhatever.
5287 Make sure you include the appropriate -L/path flags if your C linker
5288 does not normally search all of the directories you specified above,
5291 To use no flags, specify the word "none".
5295 rp="Any additional ld flags (NOT including libraries)?"
5301 rmlist="$rmlist pdp11"
5305 echo "Checking your choice of C compiler and flags for coherency..." >&4
5306 $cat > try.c <<'EOF'
5308 int main() { printf("Ok\n"); return(0); }
5310 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5312 $cat >try.msg <<'EOM'
5313 I've tried to compile and run the following simple program:
5316 $cat try.c >> try.msg
5318 $cat >> try.msg <<EOM
5325 and I got the following output:
5329 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5330 if $sh -c "$run ./try " >>try.msg 2>&1; then
5334 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5337 cat >> try.msg <<'EOQS'
5338 If $libs contains -lsfio, and sfio is mis-configured, then it
5339 sometimes (apparently) runs and exits with a 0 status, but with no
5340 output! It may have to do with sfio's use of _exit vs. exit.
5343 rp="You have a big problem. Shall I abort Configure"
5350 echo "The program compiled OK, but exited with status $?." >>try.msg
5351 rp="You have a problem. Shall I abort Configure"
5355 echo "I can't compile the test program." >>try.msg
5356 rp="You have a BIG problem. Shall I abort Configure"
5362 case "$knowitall" in
5364 echo "(The supplied flags or libraries might be incorrect.)"
5372 *) echo "Ok. Stopping Configure." >&4
5377 n) echo "OK, that should do.";;
5379 $rm_try gcctest gcctest.out
5381 : define a shorthand compile call
5385 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5386 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5390 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5391 : define a shorthand compile call for compilations that should be ok.
5395 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5397 : determine filename position in cpp output
5399 echo "Computing filename position in cpp output for #include directives..." >&4
5401 vos) testaccess=-e ;;
5404 echo '#include <stdio.h>' > foo.c
5407 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5408 $grep '^[ ]*#.*stdio\.h' | \
5409 while read cline; do
5412 while $test \$# -gt 0; do
5413 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5418 pos=\`expr \$pos + 1\`
5430 *) pos="${fieldn}th";;
5432 echo "Your cpp writes the filename in the $pos field of the line."
5435 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5436 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5439 : locate header file
5444 for usrincdir in $usrinc
5446 if test -f \$usrincdir/\$wanted; then
5447 echo "\$usrincdir/\$wanted"
5451 awkprg='{ print \$$fieldn }'
5452 echo "#include <\$wanted>" > foo\$\$.c
5453 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5454 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5455 while read cline; do
5456 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5458 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5459 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5464 # status = 0: grep returned 0 lines, case statement not executed
5465 # status = 1: headerfile found
5466 # status = 2: while loop executed, no headerfile found
5470 if test \$status -eq 1; then
5477 : define an alternate in-header-list? function
5478 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5479 cont=true; xxf="echo \"<\$1> found.\" >&4";
5480 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5481 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5483 case $# in 4) instead=instead;; *) instead="at last";; esac;
5484 while $test "$cont"; do
5486 var=$2; eval "was=\$$2";
5487 if $test "$xxx" && $test -r "$xxx";
5489 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5492 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5493 set $yyy; shift; shift; yyy=$@;
5494 case $# in 0) cont="";;
5495 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5496 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5497 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5498 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5502 do set $yyy; var=$2; eval "was=\$$2";
5503 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5504 set $yyy; shift; shift; yyy=$@;
5507 : see if stdlib is available
5508 set stdlib.h i_stdlib
5511 : check for lengths of integral types
5515 echo "Checking to see how big your integers are..." >&4
5524 printf("intsize=%d;\n", (int)sizeof(int));
5525 printf("longsize=%d;\n", (int)sizeof(long));
5526 printf("shortsize=%d;\n", (int)sizeof(short));
5531 if eval $compile_ok && $run ./try > /dev/null; then
5533 echo "Your integers are $intsize bytes long."
5534 echo "Your long integers are $longsize bytes long."
5535 echo "Your short integers are $shortsize bytes long."
5539 Help! I can't compile and run the intsize test program: please enlighten me!
5540 (This is probably a misconfiguration in your system or libraries, and
5541 you really ought to fix it. Still, I'll try anyway.)
5545 rp="What is the size of an integer (in bytes)?"
5549 rp="What is the size of a long integer (in bytes)?"
5553 rp="What is the size of a short integer (in bytes)?"
5561 : check for long long
5563 echo "Checking to see if you have long long..." >&4
5564 echo 'int main() { long long x = 7; return 0; }' > try.c
5566 if eval $compile; then
5568 echo "You have long long."
5571 echo "You do not have long long."
5577 : check for length of long long
5578 case "${d_longlong}${longlongsize}" in
5581 echo "Checking to see how big your long longs are..." >&4
5582 $cat >try.c <<'EOCP'
5586 printf("%d\n", (int)sizeof(long long));
5591 if eval $compile_ok; then
5592 longlongsize=`$run ./try`
5593 echo "Your long longs are $longlongsize bytes long."
5597 echo "(I can't seem to compile the test program. Guessing...)"
5598 rp="What is the size of a long long (in bytes)?"
5602 if $test "X$longsize" = "X$longlongsize"; then
5603 echo "(That isn't any different from an ordinary long.)"
5609 : see if inttypes.h is available
5610 : we want a real compile instead of Inhdr because some systems
5611 : have an inttypes.h which includes non-existent headers
5614 #include <inttypes.h>
5616 static int32_t foo32 = 0x12345678;
5620 if eval $compile; then
5621 echo "<inttypes.h> found." >&4
5624 echo "<inttypes.h> NOT found." >&4
5633 echo "Checking to see if you have int64_t..." >&4
5635 #include <sys/types.h>
5636 #$i_inttypes I_INTTYPES
5638 #include <inttypes.h>
5640 int main() { int64_t x = 7; }
5643 if eval $compile; then
5645 echo "You have int64_t."
5648 echo "You do not have int64_t."
5654 : Check if 64bit ints have a quad type
5656 echo "Checking which 64-bit integer type we could use..." >&4
5662 val='"unsigned int"'
5667 *) case "$longsize" in
5671 val='"unsigned long"'
5676 *) case "$d_longlong:$longlongsize" in
5681 val='"unsigned long long"'
5686 *) case "$d_int64_t" in
5705 '') echo "Alas, no 64-bit integer types in sight." >&4
5708 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5713 : Do we want 64bit support
5714 case "$uselonglong" in
5715 "$define"|true|[yY]*)
5718 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5720 use64bitint="$define"
5723 case "$use64bits" in
5724 "$define"|true|[yY]*)
5727 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5729 use64bitint="$define"
5732 case "$use64bitints" in
5733 "$define"|true|[yY]*)
5736 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5738 use64bitint="$define"
5741 case "$use64bitsint" in
5742 "$define"|true|[yY]*)
5745 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5747 use64bitint="$define"
5750 case "$uselonglongs" in
5751 "$define"|true|[yY]*)
5754 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5756 use64bitint="$define"
5759 case "$use64bitsall" in
5760 "$define"|true|[yY]*)
5763 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5765 use64bitall="$define"
5770 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5772 case "$use64bitall" in
5773 "$define"|true|[yY]*) use64bitint="$define" ;;
5779 You have natively 64-bit long integers.
5783 *) case "$use64bitint" in
5784 "$define"|true|[yY]*) dflt='y';;
5793 Perl can be built to take advantage of 64-bit integer types
5794 on some systems. To do so, Configure can be run with -Duse64bitint.
5795 Choosing this option will most probably introduce binary incompatibilities.
5797 If this doesn't make any sense to you, just accept the default '$dflt'.
5798 (The default has been chosen based on your configuration.)
5800 rp='Try to use 64-bit integers, if available?'
5803 [yY]*) val="$define" ;;
5811 case "$use64bitall" in
5812 "$define"|true|[yY]*) dflt='y' ;;
5813 *) case "$longsize" in
5821 You may also choose to try maximal 64-bitness. It means using as much
5822 64-bitness as possible on the platform. This in turn means even more
5823 binary incompatibilities. On the other hand, your platform may not
5824 have any more 64-bitness available than what you already have chosen.
5826 If this doesn't make any sense to you, just accept the default '$dflt'.
5827 (The default has been chosen based on your configuration.)
5829 rp='Try to use maximal 64-bit support, if available?'
5832 [yY]*) val="$define" ;;
5837 case "$use64bitall" in
5839 case "$use64bitint" in
5843 Since you have chosen a maximally 64-bit build, I'm also turning on
5844 the use of 64-bit integers.
5846 use64bitint="$define" ;;
5851 : Look for a hint-file generated 'call-back-unit'. If the
5852 : user has specified that a 64-bit perl is to be built,
5853 : we may need to set or change some other defaults.
5854 if $test -f use64bitint.cbu; then
5855 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5858 case "$use64bitint" in
5859 "$define"|true|[yY]*)
5861 4) case "$archname64" in
5862 '') archname64=64int ;;
5869 : Look for a hint-file generated 'call-back-unit'. If the
5870 : user has specified that a maximally 64-bit perl is to be built,
5871 : we may need to set or change some other defaults.
5872 if $test -f use64bitall.cbu; then
5873 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5876 case "$use64bitall" in
5877 "$define"|true|[yY]*)
5879 4) case "$archname64" in
5880 ''|64int) archname64=64all ;;
5887 case "$d_quad:$use64bitint" in
5891 *** You have chosen to use 64-bit integers,
5892 *** but none can be found.
5893 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5894 *** Cannot continue, aborting.
5901 : check for length of double
5903 case "$doublesize" in
5905 echo "Checking to see how big your double precision numbers are..." >&4
5914 printf("%d\n", (int)sizeof(double));
5919 if eval $compile_ok; then
5920 doublesize=`$run ./try`
5921 echo "Your double is $doublesize bytes long."
5924 echo "(I can't seem to compile the test program. Guessing...)"
5925 rp="What is the size of a double precision number (in bytes)?"
5933 : check for long doubles
5935 echo "Checking to see if you have long double..." >&4
5936 echo 'int main() { long double x = 7.0; }' > try.c
5938 if eval $compile; then
5940 echo "You have long double."
5943 echo "You do not have long double."
5949 : check for length of long double
5950 case "${d_longdbl}${longdblsize}" in
5953 echo "Checking to see how big your long doubles are..." >&4
5954 $cat >try.c <<'EOCP'
5958 printf("%d\n", sizeof(long double));
5963 if eval $compile; then
5964 longdblsize=`$run ./try`
5965 echo "Your long doubles are $longdblsize bytes long."
5969 echo "(I can't seem to compile the test program. Guessing...)" >&4
5970 rp="What is the size of a long double (in bytes)?"
5974 if $test "X$doublesize" = "X$longdblsize"; then
5975 echo "That isn't any different from an ordinary double."
5976 echo "I'll keep your setting anyway, but you may see some"
5977 echo "harmless compilation warnings."
5983 : determine the architecture name
5985 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5986 tarch=`arch`"-$osname"
5987 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5988 if uname -m > tmparch 2>&1 ; then
5989 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5990 -e 's/$/'"-$osname/" tmparch`
5998 case "$myarchname" in
6001 echo "(Your architecture name used to be $myarchname.)"
6005 case "$targetarch" in
6007 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6012 *) dflt="$archname";;
6014 rp='What is your architecture name'
6017 case "$usethreads" in
6019 echo "Threads selected." >&4
6021 *-thread*) echo "...and architecture name already has -thread." >&4
6023 *) archname="$archname-thread"
6024 echo "...setting architecture name to $archname." >&4
6029 case "$usemultiplicity" in
6031 echo "Multiplicity selected." >&4
6033 *-multi*) echo "...and architecture name already has -multi." >&4
6035 *) archname="$archname-multi"
6036 echo "...setting architecture name to $archname." >&4
6041 case "$use64bitint$use64bitall" in
6043 case "$archname64" in
6045 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6048 case "$use64bitint" in
6049 "$define") echo "64 bit integers selected." >&4 ;;
6051 case "$use64bitall" in
6052 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6055 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6057 *) archname="$archname-$archname64"
6058 echo "...setting architecture name to $archname." >&4
6064 case "$uselongdouble" in
6066 echo "Long doubles selected." >&4
6067 case "$longdblsize" in
6069 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6073 *-ld*) echo "...and architecture name already has -ld." >&4
6075 *) archname="$archname-ld"
6076 echo "...setting architecture name to $archname." >&4
6083 if $test -f archname.cbu; then
6084 echo "Your platform has some specific hints for architecture name, using them..."
6088 : set the prefixit variable, to compute a suitable default value
6089 prefixit='case "$3" in
6091 case "$oldprefix" in
6092 "") eval "$1=\"\$$2\"";;
6099 ""|" ") eval "$1=\"\$$2\"";;
6105 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6107 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6108 /*-$oldprefix/*|\~*-$oldprefix/*)
6109 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6110 *) eval "$1=\"\$$2\"";;
6114 : determine installation style
6115 : For now, try to deduce it from prefix unless it is already set.
6116 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6117 case "$installstyle" in
6118 '') case "$prefix" in
6119 *perl*) dflt='lib';;
6120 *) dflt='lib/perl5' ;;
6123 *) dflt="$installstyle" ;;
6125 : Probably not worth prompting for this since we prompt for all
6126 : the directories individually, and the prompt would be too long and
6130 : determine where public executables go
6135 rp='Pathname where the public executables will reside?'
6137 if $test "X$ansexp" != "X$binexp"; then
6141 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6142 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6143 : this via initialinstalllocation
6146 case "$userelocatableinc" in
6147 $define|true|[yY]*) dflt='y' ;;
6152 Would you like to build Perl so that the installation is relocatable, so that
6153 library paths in @INC are determined relative to the path of the perl binary?
6154 This is not advised for system Perl installs, or if you need to run setid
6155 scripts or scripts under taint mode.
6157 If this doesn't make any sense to you, just accept the default '$dflt'.
6159 rp='Use relocatable @INC?'
6162 y|Y) val="$define" ;;
6165 set userelocatableinc
6168 initialinstalllocation="$binexp"
6169 : Default prefix is now "up one level from where the binaries are"
6170 case "$userelocatableinc" in
6176 installprefixexp=".../.."
6180 : determine where private library files go
6181 : Usual default is /usr/local/lib/perl5/$version.
6182 : Also allow things like /opt/perl/lib/$version, since
6183 : /opt/perl/lib/perl5... would be redundant.
6184 : The default "style" setting is made in installstyle.U
6185 case "$installstyle" in
6186 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6187 *) set dflt privlib lib/$version ;;
6192 There are some auxiliary files for $package that need to be put into a
6193 private library directory that is accessible by everyone.
6198 rp='Pathname where the private library files will reside?'
6203 : set the prefixup variable, to restore leading tilda escape
6204 prefixup='case "$prefixexp" in
6206 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6209 : determine where public architecture dependent libraries go
6212 : privlib default is /usr/local/lib/$package/$version
6213 : archlib default is /usr/local/lib/$package/$version/$archname
6214 : privlib may have an optional trailing /share.
6215 tdflt=`echo $privlib | $sed 's,/share$,,'`
6216 tdflt=$tdflt/$archname
6225 $spackage contains architecture-dependent library files. If you are
6226 sharing libraries in a heterogeneous environment, you might store
6227 these files in a separate location. Otherwise, you can just include
6228 them with the rest of the public library files.
6233 rp='Where do you want to put the public architecture-dependent libraries?'
6237 if $test X"$archlib" = X"$privlib"; then
6243 : see if setuid scripts can be secure
6246 Some kernels have a bug that prevents setuid #! scripts from being
6247 secure. Some sites have disabled setuid #! scripts because of this.
6249 First let's decide if your kernel supports secure setuid #! scripts.
6250 (If setuid #! scripts would be secure but have been disabled anyway,
6251 don't say that they are secure if asked.)
6256 if $test -d /dev/fd; then
6257 echo "#!$ls" >reflect
6258 chmod +x,u+s reflect
6259 ./reflect >flect 2>&1
6260 if $contains "/dev/fd" flect >/dev/null; then
6261 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6265 If you are not sure if they are secure, I can check but I'll need a
6266 username and password different from the one you are using right now.
6267 If you don't have such a username or don't want me to test, simply
6271 rp='Other username to test security of setuid scripts with?'
6276 case "$d_suidsafe" in
6277 '') echo "I'll assume setuid scripts are *not* secure." >&4
6280 echo "Well, the $hint value is *not* secure." >&4
6282 *) echo "Well, the $hint value *is* secure." >&4
6287 $rm -f reflect flect
6288 echo "#!$ls" >reflect
6289 chmod +x,u+s reflect
6292 echo '"su" will (probably) prompt you for '"$ans's password."
6293 su $ans -c './reflect >flect'
6294 if $contains "/dev/fd" flect >/dev/null; then
6295 echo "Okay, it looks like setuid scripts are secure." >&4
6298 echo "I don't think setuid scripts are secure." >&4
6303 rp='Does your kernel have *secure* setuid scripts?'
6306 [yY]*) val="$define";;
6311 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6312 echo "(That's for file descriptors, not floppy disks.)"
6318 $rm -f reflect flect
6320 : now see if they want to do setuid emulation
6321 if $test $patchlevel -lt 11; then
6324 case "$d_suidsafe" in
6327 echo "No need to emulate SUID scripts since they are secure here." >&4
6331 Some systems have disabled setuid scripts, especially systems where
6332 setuid scripts cannot be secure. On systems where setuid scripts have
6333 been disabled, the setuid/setgid bits on scripts are currently
6334 useless. It is possible for $package to detect those bits and emulate
6335 setuid/setgid in a secure fashion. This emulation will only work if
6336 setuid scripts have been disabled in your kernel.
6340 "$define") dflt=y ;;
6343 rp="Do you want to do setuid/setgid emulation?"
6346 [yY]*) val="$define";;
6358 SUID emulation has been removed for 5.12
6359 Please re-run Configure without -Dd_dosuid
6368 : Find perl5.005 or later.
6369 echo "Looking for a previously installed perl5.005 or later... "
6371 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6372 : Check if this perl is recent and can load a simple module
6373 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6376 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6386 '') echo "None found. That's ok.";;
6387 *) echo "Using $perl5." ;;
6390 : Set the siteprefix variables
6393 After $package is installed, you may wish to install various
6394 add-on modules and utilities. Typically, these add-ons will
6395 be installed under $prefix with the rest
6396 of this package. However, you may wish to install such add-ons
6397 elsewhere under a different prefix.
6399 If you do not wish to put everything under a single prefix, that's
6400 ok. You will be prompted for the individual locations; this siteprefix
6401 is only used to suggest the defaults.
6403 The default should be fine for most people.
6407 rp='Installation prefix to use for add-on modules and utilities?'
6408 : XXX Here might be another good place for an installstyle setting.
6409 case "$siteprefix" in
6411 *) dflt=$siteprefix ;;
6414 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6416 case "$siteprefix" in
6420 *) oldsiteprefix="$prefix";;
6425 siteprefixexp="$ansexp"
6427 : determine where site specific libraries go.
6428 : Usual default is /usr/local/lib/perl5/site_perl/$version
6429 : The default "style" setting is made in installstyle.U
6430 : XXX No longer works with Prefixit stuff.
6431 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6433 '') case "$installstyle" in
6434 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6435 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6443 The installation process will create a directory for
6444 site-specific extensions and modules. Most users find it convenient
6445 to place all site-specific files in this directory rather than in the
6446 main distribution directory.
6450 rp='Pathname for the site-specific library files?'
6454 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6456 : Determine list of previous versions to include in @INC
6457 $cat > getverlist <<EOPL
6460 \$api_versionstring = "$api_versionstring";
6461 \$version = "$version";
6462 \$stem = "$sitelib_stem";
6463 \$archname = "$archname";
6465 $cat >> getverlist <<'EOPL'
6466 # The list found is store twice for each entry: the original name, and
6467 # the binary broken down version as pack "sss", so sorting is easy and
6468 # unambiguous. This will work for all versions that have a maximum of
6469 # three digit groups, separate by '.'s or '_'s. Names are extended with
6470 # ".0.0" to ensure at least three elements for the pack.
6471 # -- H.Merijn Brand (m)'06 23-10-2006
6473 # Can't have leading @ because metaconfig interprets it as a command!
6474 ;@inc_version_list=();
6475 # XXX Redo to do opendir/readdir?
6478 ;@candidates = map {
6479 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6480 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6486 ($pversion, $aversion, $vsn5005) = map {
6487 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6488 foreach $d (@candidates) {
6489 if ($d->[1] lt $pversion) {
6490 if ($d->[1] ge $aversion) {
6491 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6493 elsif ($d->[1] ge $vsn5005) {
6494 unshift(@inc_version_list, grep { -d } $d->[0]);
6498 # Skip newer version. I.e. don't look in
6499 # 5.7.0 if we're installing 5.6.1.
6503 if (@inc_version_list) {
6504 print join(' ', @inc_version_list);
6507 # Blank space to preserve value for next Configure run.
6512 case "$inc_version_list" in
6513 '') if test -x "$perl5$exe_ext"; then
6514 dflt=`$perl5 getverlist`
6519 $undef) dflt='none' ;;
6520 *) eval dflt=\"$inc_version_list\" ;;
6523 ''|' ') dflt=none ;;
6530 In order to ease the process of upgrading, this version of perl
6531 can be configured to use modules built and installed with earlier
6532 versions of perl that were installed under $prefix. Specify here
6533 the list of earlier versions that this version of perl should check.
6534 If Configure detected no earlier versions of perl installed under
6535 $prefix, then the list will be empty. Answer 'none' to tell perl
6536 to not search earlier versions.
6538 The default should almost always be sensible, so if you're not sure,
6539 just accept the default.
6542 rp='List of earlier versions to include in @INC?'
6545 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6546 *) inc_version_list="$ans" ;;
6548 case "$inc_version_list" in
6550 inc_version_list_init='0'
6551 d_inc_version_list="$undef"
6553 *) inc_version_list_init=`echo $inc_version_list |
6554 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6555 d_inc_version_list="$define"
6560 : see if malloc/malloc.h has to be included
6561 set malloc/malloc.h i_mallocmalloc
6564 : see if this is a malloc.h system
6565 : we want a real compile instead of Inhdr because some systems have a
6566 : malloc.h that just gives a compile error saying to use stdlib.h instead
6571 #$i_mallocmalloc I_MALLOCMALLOC
6572 #ifdef I_MALLOCMALLOC
6573 # include <malloc/malloc.h>
6576 int main () { return 0; }
6579 if eval $compile; then
6580 echo "<malloc.h> found." >&4
6583 echo "<malloc.h> NOT found." >&4
6590 : check for void type
6592 echo "Checking to see how well your C compiler groks the void type..." >&4
6593 case "$voidflags" in
6605 extern void moo(); /* function returning void */
6606 void (*goo)(); /* ptr to func returning void */
6608 void *hue; /* generic ptr */
6621 int main() { sub(); }
6623 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6624 voidflags=$defvoidused
6625 echo "Good. It appears to support void to the level $package wants.">&4
6626 if $contains warning .out >/dev/null 2>&1; then
6627 echo "However, you might get some warnings that look like this:"
6631 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6632 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6633 echo "It supports 1..."
6634 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6635 echo "It also supports 2..."
6636 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6638 echo "And it supports 4 but not 8 definitely."
6640 echo "It doesn't support 4..."
6641 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6643 echo "But it supports 8."
6646 echo "Neither does it support 8."
6650 echo "It does not support 2..."
6651 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6653 echo "But it supports 4 and 8."
6655 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6657 echo "And it supports 4 but has not heard about 8."
6659 echo "However it supports 8 but not 4."
6664 echo "There is no support at all for void."
6669 case "$voidflags" in
6672 Support flag bits are:
6673 1: basic void declarations.
6674 2: arrays of pointers to functions returning void.
6675 4: operations between pointers to and addresses of void functions.
6676 8: generic void pointers.
6679 rp="Your void support flags add up to what?"
6686 : check for length of pointer
6690 echo "Checking to see how big your pointers are..." >&4
6691 if test "$voidflags" -gt 7; then
6692 echo '#define VOID_PTR char *' > try.c
6694 echo '#define VOID_PTR void *' > try.c
6704 printf("%d\n", (int)sizeof(VOID_PTR));
6709 if eval $compile_ok; then
6710 ptrsize=`$run ./try`
6711 echo "Your pointers are $ptrsize bytes long."
6714 echo "(I can't seem to compile the test program. Guessing...)" >&4
6715 rp="What is the size of a pointer (in bytes)?"
6722 case "$use64bitall" in
6723 "$define"|true|[yY]*)
6727 *** You have chosen a maximally 64-bit build,
6728 *** but your pointers are only 4 bytes wide.
6729 *** Please rerun Configure without -Duse64bitall.
6734 *** Since you have quads, you could possibly try with -Duse64bitint.
6739 *** Cannot continue, aborting.
6750 : determine whether to use malloc wrapping
6752 case "$usemallocwrap" in
6753 [yY]*|true|$define) dflt='y' ;;
6754 [nN]*|false|$undef) dflt='n' ;;
6755 *) case "$usedevel" in
6756 [yY]*|true|$define) dflt='y' ;;
6761 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6763 usemallocwrap="$ans"
6766 usemallocwrap="$define" ;;
6768 usemallocwrap="$undef" ;;
6771 : determine which malloc to compile in
6773 case "$usemymalloc" in
6774 [yY]*|true|$define) dflt='y' ;;
6775 [nN]*|false|$undef) dflt='n' ;;
6776 *) case "$ptrsize" in
6780 if test "$useithreads" = "$define"; then dflt='n'; fi
6783 rp="Do you wish to attempt to use the malloc that comes with $package?"
6789 mallocsrc='malloc.c'
6790 mallocobj="malloc$_o"
6791 d_mymalloc="$define"
6794 : Remove malloc from list of libraries to use
6795 echo "Removing unneeded -lmalloc from library list" >&4
6796 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6799 echo "libs = $libs" >&4
6811 : compute the return types of malloc and free
6813 $cat >malloc.c <<END
6817 #include <sys/types.h>
6831 case "$malloctype" in
6833 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6840 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6844 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6851 echo "Your system uses $freetype free(), it would seem." >&4
6853 : determine where site specific architecture-dependent libraries go.
6854 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6855 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6856 : sitelib may have an optional trailing /share.
6858 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6859 dflt="$dflt/$archname"
6864 set sitearch sitearch none
6868 The installation process will also create a directory for
6869 architecture-dependent site-specific extensions and modules.
6873 rp='Pathname for the site-specific architecture-dependent library files?'
6877 if $test X"$sitearch" = X"$sitelib"; then
6880 d_sitearch="$define"
6883 : Set the vendorprefix variables
6886 The installation process will also create a directory for
6887 vendor-supplied add-ons. Vendors who supply perl with their system
6888 may find it convenient to place all vendor-supplied files in this
6889 directory rather than in the main distribution directory. This will
6890 ease upgrades between binary-compatible maintenance versions of perl.
6892 Of course you may also use these directories in whatever way you see
6893 fit. For example, you might use them to access modules shared over a
6894 company-wide network.
6896 The default answer should be fine for most people.
6897 This causes further questions about vendor add-ons to be skipped
6898 and no vendor-specific directories will be configured for perl.
6901 rp='Do you want to configure vendor-specific add-on directories?'
6902 case "$usevendorprefix" in
6903 define|true|[yY]*) dflt=y ;;
6904 *) : User may have set vendorprefix directly on Configure command line.
6905 case "$vendorprefix" in
6914 rp='Installation prefix to use for vendor-supplied add-ons?'
6915 case "$vendorprefix" in
6917 *) dflt=$vendorprefix ;;
6920 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6922 case "$vendorprefix" in
6926 *) oldvendorprefix="$prefix";;
6930 usevendorprefix="$define"
6932 vendorprefixexp="$ansexp"
6934 *) usevendorprefix="$undef"
6940 : Set the vendorlib variables
6941 case "$vendorprefix" in
6942 '') d_vendorlib="$undef"
6946 *) d_vendorlib="$define"
6947 : determine where vendor-supplied modules go.
6948 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6949 case "$vendorlib" in
6951 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6952 case "$installstyle" in
6953 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6954 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6957 *) dflt="$vendorlib"
6961 rp='Pathname for the vendor-supplied library files?'
6964 vendorlibexp="$ansexp"
6967 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6971 : Set the vendorarch variables
6972 case "$vendorprefix" in
6973 '') d_vendorarch="$undef"
6977 *) d_vendorarch="$define"
6978 : determine where vendor-supplied architecture-dependent libraries go.
6979 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6980 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6981 : vendorlib may have an optional trailing /share.
6982 case "$vendorarch" in
6983 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6984 dflt="$dflt/$archname"
6986 *) dflt="$vendorarch" ;;
6989 rp='Pathname for vendor-supplied architecture-dependent files?'
6992 vendorarchexp="$ansexp"
6995 prefixvar=vendorarch
6997 if $test X"$vendorarch" = X"$vendorlib"; then
6998 d_vendorarch="$undef"
7000 d_vendorarch="$define"
7003 : Final catch-all directories to search
7006 Lastly, you can have perl look in other directories for extensions and
7007 modules in addition to those already specified.
7008 These directories will be searched after
7012 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7013 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7015 case "$otherlibdirs" in
7016 ''|' ') dflt='none' ;;
7017 *) dflt="$otherlibdirs" ;;
7020 Enter a colon-separated set of extra paths to include in perl's @INC
7021 search path, or enter 'none' for no extra paths.
7025 rp='Colon-separated list of additional directories for perl to search?'
7028 ' '|''|none) otherlibdirs=' ' ;;
7029 *) otherlibdirs="$ans" ;;
7031 case "$otherlibdirs" in
7035 set d_perl_otherlibdirs
7038 : Cruising for prototypes
7040 echo "Checking out function prototypes..." >&4
7041 $cat >prototype.c <<EOCP
7046 int main(int argc, char *argv[]) {
7049 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7050 echo "Your C compiler appears to support function prototypes."
7053 echo "Your C compiler doesn't seem to understand function prototypes."
7060 : Check if ansi2knr is required
7061 case "$prototype" in
7063 *) ansi2knr='ansi2knr'
7068 This version of $package can only be compiled by a compiler that
7069 understands function prototypes. Unfortunately, your C compiler
7071 doesn't seem to understand them. Sorry about that.
7073 If GNU cc is available for your system, perhaps you could try that instead.
7075 Eventually, we hope to support building Perl with pre-ANSI compilers.
7076 If you would like to help in that effort, please contact <perlbug@perl.org>.
7078 Aborting Configure now.
7085 dflt_dtrace='/usr/sbin/dtrace'
7086 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7090 Perl can be built to support DTrace on platforms that support it.
7091 DTrace is a diagnosis and performance analysis tool from Sun.
7093 If this doesn't make any sense to you, just accept the default '$dflt'.
7097 case "$usedtrace" in
7103 dflt_dtrace=$usedtrace
7110 rp='Support DTrace if available?'
7113 y|Y) val="$define" ;;
7119 test "X$usedtrace" != "X$define" && break
7122 rp='Where is the dtrace executable?'
7131 if $dtrace -h -s ../perldtrace.d \
7132 -o perldtrace.tmp >/dev/null 2>&1 \
7133 && rm -f perldtrace.tmp
7136 echo "Good: your $dtrace knows about the -h flag."
7140 *** $me: Fatal Error: $dtrace doesn't support -h flag
7142 *** Your installed dtrace doesn't support the -h switch to compile a D
7143 *** program into a C header. Can't continue.
7155 *** $me: Fatal Error: $dtrace not found.
7162 echo "*** $dtrace was not found."
7168 : See if we want extra modules installed
7175 Perl can be built with extra modules or bundles of modules which
7176 will be fetched from the CPAN and installed alongside Perl.
7178 Notice that you will need access to the CPAN; either via the Internet,
7179 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7180 be asked later to configure the CPAN.pm module which will in turn do
7181 the installation of the rest of the extra modules or bundles.)
7183 Notice also that if the modules require any external software such as
7184 libraries and headers (the libz library and the zlib.h header for the
7185 Compress::Zlib module, for example) you MUST have any such software
7186 already installed, this configuration process will NOT install such
7189 If this doesn't make any sense to you, just accept the default '$dflt'.
7191 rp='Install any extra modules (y or n)?'
7197 Please list any extra modules or bundles to be installed from CPAN,
7198 with spaces between the names. The names can be in any format the
7199 'install' command of CPAN.pm will understand. (Answer 'none',
7200 without the quotes, to install no extra modules or bundles.)
7210 $rm -f ../extras.lst
7212 *) echo "(Saving the list of extras for later...)"
7213 echo "$extras" > ../extras.lst
7221 : determine where html pages for programs go
7222 set html1dir html1dir none
7226 If you wish to install html files for programs in $spackage, indicate
7227 the appropriate directory here. To skip installing html files,
7231 ''|none|$undef|' ') dflt=none ;;
7232 *) dflt=$html1dir ;;
7235 rp="Directory for the main $spackage html pages?"
7239 : Use ' ' for none so value is preserved next time through Configure
7240 $test X"$html1dir" = "X" && html1dir=' '
7242 : determine where html pages for libraries and modules go
7243 set html3dir html3dir none
7247 If you wish to install html files for modules associated with $spackage,
7248 indicate the appropriate directory here. To skip installing html files,
7251 : There is no obvious default. If they have specified html1dir, then
7252 : try to key off that, possibly changing .../html1 into .../html3.
7254 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7255 *) dflt=$html3dir ;;
7258 rp="Directory for the $spackage module html pages?"
7262 : Use ' ' for none so value is preserved next time through Configure
7263 $test X"$html3dir" = "X" && html3dir=' '
7265 : determine whether to install perl also as /usr/bin/perl
7268 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7270 Many scripts expect perl to be installed as /usr/bin/perl.
7272 If you want to, I can install the perl you are about to compile
7273 as /usr/bin/perl (in addition to $bin/perl).
7275 if test -f /usr/bin/perl; then
7278 However, please note that because you already have a /usr/bin/perl,
7279 overwriting that with a new Perl would very probably cause problems.
7280 Therefore I'm assuming you don't want to do that (unless you insist).
7283 case "$installusrbinperl" in
7284 "$define"|[yY]*) dflt='y';;
7290 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7293 case "$installusrbinperl" in
7294 "$undef"|[nN]*) dflt='n';;
7298 rp="Do you want to install perl as /usr/bin/perl?"
7301 [yY]*) val="$define";;
7307 set installusrbinperl
7310 : Check if we are using the GNU C library
7312 echo "Checking for GNU C Library..." >&4
7314 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7315 alone are insufficient to distinguish different versions, such as
7316 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7317 libc version 2.1.0. A. Dougherty, June 3, 2002.
7323 # ifdef __GLIBC_MINOR__
7324 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7325 # include <gnu/libc-version.h>
7326 printf("%s\n", gnu_get_libc_version());
7328 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7331 printf("%d\n", __GLIBC__);
7340 if eval $compile_ok && $run ./try > glibc.ver; then
7342 gnulibc_version=`$cat glibc.ver`
7343 echo "You are using the GNU C Library version $gnulibc_version"
7347 echo "You are not using the GNU C Library"
7353 : see if nm is to be used to determine whether a symbol is defined or not
7357 case "$d_gnulibc" in
7360 echo "nm probably won't work on the GNU C Library." >&4
7366 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7368 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7369 echo "'nm' won't be sufficient on this sytem." >&4
7375 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7376 if $test $dflt -gt 20; then
7386 true|$define) dflt=y;;
7393 I can use $nm to extract the symbols from your C libraries. This
7394 is a time consuming task which may generate huge output on the disk (up
7395 to 3 megabytes) but that should make the symbols extraction faster. The
7396 alternative is to skip the 'nm' extraction part and to compile a small
7397 test program instead to determine whether each symbol is present. If
7398 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7399 this may be the best solution.
7401 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7404 rp="Shall I use $nm to extract C symbols from the libraries?"
7407 [Nn]*) usenm=false;;
7416 : nm options which may be necessary
7418 '') if $test -f /mach_boot; then
7420 elif $test -d /usr/ccs/lib; then
7421 nm_opt='-p' # Solaris (and SunOS?)
7422 elif $test -f /dgux; then
7424 elif $test -f /lib64/rld; then
7425 nm_opt='-p' # 64-bit Irix
7431 : nm options which may be necessary for shared libraries but illegal
7432 : for archive libraries. Thank you, Linux.
7433 case "$nm_so_opt" in
7434 '') case "$myuname" in
7436 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7437 nm_so_opt='--dynamic'
7444 : Figure out where the libc is located
7447 : get list of predefined functions in a handy place
7452 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7458 *) for thislib in $libs; do
7461 : Handle C library specially below.
7464 thislib=`echo $thislib | $sed -e 's/^-l//'`
7465 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7467 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7469 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7471 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7473 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7475 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7477 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7482 libnames="$libnames $try"
7484 *) libnames="$libnames $thislib" ;;
7493 for xxx in $libpth; do
7494 $test -r $1 || set $xxx/libc.$so
7495 : The messy sed command sorts on library version numbers.
7497 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7498 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7500 s/[0-9][0-9]*/0000&/g
7501 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7504 $sort | $sed -e 's/^.* //'`
7507 $test -r $1 || set /usr/ccs/lib/libc.$so
7508 $test -r $1 || set /lib/libsys_s$_a
7514 if $test -r "$1"; then
7515 echo "Your (shared) C library seems to be in $1."
7517 elif $test -r /lib/libc && $test -r /lib/clib; then
7518 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7520 libc='/lib/clib /lib/libc'
7521 if $test -r /lib/syslib; then
7522 echo "(Your math library is in /lib/syslib.)"
7523 libc="$libc /lib/syslib"
7525 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7526 echo "Your C library seems to be in $libc, as you said before."
7527 elif $test -r $incpath/usr/lib/libc$_a; then
7528 libc=$incpath/usr/lib/libc$_a;
7529 echo "Your C library seems to be in $libc. That's fine."
7530 elif $test -r /lib/libc$_a; then
7532 echo "Your C library seems to be in $libc. You're normal."
7534 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7536 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7537 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7538 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7540 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7542 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7545 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7547 if $test -r "$tans"; then
7548 echo "Your C library seems to be in $tans, of all places."
7554 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7558 If the guess above is wrong (which it might be if you're using a strange
7559 compiler, or your machine supports multiple models), you can override it here.
7564 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7566 I can't seem to find your C library. I've looked in the following places:
7569 $sed 's/^/ /' libpath
7572 None of these seems to contain your C library. I need to get its name...
7577 rp='Where is your C library?'
7582 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7583 set X `cat libnames`
7586 case $# in 1) xxx=file; esac
7587 echo "Extracting names from the following $xxx for later perusal:" >&4
7589 $sed 's/^/ /' libnames >&4
7591 $echo $n "This may take a while...$c" >&4
7595 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7596 *) $nm $nm_opt $file 2>/dev/null;;
7601 $grep fprintf libc.tmp > libc.ptf
7602 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7603 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7605 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7609 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7613 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7617 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7621 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7625 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7629 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7630 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7632 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7634 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7636 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7638 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7640 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7642 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7646 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7650 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7654 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7658 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7663 $nm -p $* 2>/dev/null >libc.tmp
7664 $grep fprintf libc.tmp > libc.ptf
7665 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7666 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7672 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7674 if $ar t $libc > libc.tmp && \
7675 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7677 for thisname in $libnames $libc; do
7678 $ar t $thisname >>libc.tmp
7680 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7682 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7683 for thisname in $libnames $libc; do
7684 $ar tv $thisname >>libc.tmp
7685 emximp -o tmp.imp $thisname \
7687 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7688 < tmp.imp >>libc.tmp
7691 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7694 echo "$ar didn't seem to work right." >&4
7695 echo "Maybe this is a Cray...trying bld instead..." >&4
7697 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7700 for thisname in $libnames; do
7702 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7703 $ar t $thisname >>libc.tmp
7707 echo "That didn't work either. Giving up." >&4
7717 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7718 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7720 *) if $test -f /lib/syscalls.exp; then
7722 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7723 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7724 /lib/syscalls.exp >>libc.list
7730 $rm -f libnames libpath
7732 : see if dld is available
7736 : Check if we are using C++
7738 echo "Checking for C++..." >&4
7739 $cat >try.c <<'EOCP'
7751 if eval $compile_ok && $run ./try; then
7753 echo "You are using a C++ compiler."
7756 echo "You are not using a C++ compiler."
7762 : is a C symbol defined?
7765 -v) tf=libc.tmp; tdc="";;
7766 -a) tf=libc.tmp; tdc="[]";;
7767 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7769 case "$d_cplusplus" in
7770 $define) extern_C="extern \"C\"" ;;
7771 *) extern_C="extern" ;;
7774 case "$reuseval-$4" in
7776 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7781 if $test "$runnm" = true; then
7782 if $contains $tlook $tf >/dev/null 2>&1; then
7784 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7785 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7786 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7787 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7791 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7792 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7798 $define) tval=true;;
7805 : define an is-in-libc? function
7806 inlibc='echo " "; td=$define; tu=$undef;
7807 sym=$1; var=$2; eval "was=\$$2";
7809 case "$reuseval$was" in
7819 echo "$sym() found." >&4;
7820 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7822 echo "$sym() NOT found." >&4;
7823 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7827 $define) echo "$sym() found." >&4;;
7828 *) echo "$sym() NOT found." >&4;;
7832 : see if dlopen exists
7834 xxx_ccflags="$ccflags"
7836 : with g++ one needs -shared to get is-in-libc to work for dlopen
7837 case "$gccversion" in
7839 *) case "$d_cplusplus" in
7840 "$define") ccflags="$ccflags -shared" ;;
7847 ccflags="$xxx_ccflags"
7849 : see if this is a unistd.h system
7850 set unistd.h i_unistd
7853 : determine which dynamic loading, if any, to compile in
7855 dldir="ext/DynaLoader"
7868 $define) dflt='y' ;;
7871 $define) dflt='y' ;;
7873 : Does a dl_xxx.xs file exist for this operating system
7874 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7877 rp="Do you wish to use dynamic loading?"
7885 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7886 dflt="$dldir/dl_${osname}.xs"
7887 elif $test "$d_dlopen" = "$define" ; then
7888 dflt="$dldir/dl_dlopen.xs"
7889 elif $test "$i_dld" = "$define" ; then
7890 dflt="$dldir/dl_dld.xs"
7895 *) dflt="$dldir/$dlsrc"
7898 echo "The following dynamic loading files are available:"
7899 : Can not go over to $dldir because getfile has path hard-coded in.
7900 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7901 rp="Source file to use for dynamic loading"
7907 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7911 Some systems may require passing special flags to $cc -c to
7912 compile modules that will be used to create a shared library.
7913 To use no flags, say "none".
7916 case "$cccdlflags" in
7917 '') case "$gccversion" in
7918 '') case "$osname" in
7920 next) dflt='none' ;;
7921 irix*) dflt='-KPIC' ;;
7922 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7923 sunos) dflt='-pic' ;;
7927 *) case "$osname" in
7928 darwin) dflt='none' ;;
7929 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7934 *) dflt="$cccdlflags" ;;
7936 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7939 none) cccdlflags=' ' ;;
7940 *) cccdlflags="$ans" ;;
7945 Some systems use ld to create libraries that can be dynamically loaded,
7946 while other systems (such as those using ELF) use $cc.
7950 : Determine if this is ELF
7952 /* Test for whether ELF binaries are produced */
7964 int i = open("a.out",O_RDONLY);
7967 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7968 exit(0); /* succeed (yes, it is ELF) */
7973 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7979 '') if $test $bin_ELF = "$define"; then
7981 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7985 echo "I'll use ld to build dynamic libraries."
7993 rp="What command should be used to create dynamic libraries?"
7999 Some systems may require passing special flags to $ld to create a
8000 library that can be dynamically loaded. If your ld flags include
8001 -L/other/path options to locate libraries outside your loader's normal
8002 search path, you may need to specify those -L options here as well. To
8003 use no flags, say "none".
8006 case "$lddlflags" in
8007 '') case "$osname" in
8008 beos) dflt='-nostart' ;;
8009 haiku) dflt='-shared' ;;
8011 case "$gccversion" in
8012 '') dflt="$dflt +vnocompatwarnings" ;;
8015 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8016 next) dflt='none' ;;
8017 solaris) dflt='-G' ;;
8018 sunos) dflt='-assert nodefinitions' ;;
8019 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8023 *) dflt="$lddlflags" ;;
8026 : Try to guess additional flags to pick up local libraries.
8027 : Be careful not to append to a plain 'none'
8031 for thisflag in $ldflags; do
8036 *) dflt="$dflt $thisflag" ;;
8043 ''|' ') dflt='none' ;;
8047 *-fstack-protector*)
8049 *-fstack-protector*) ;; # Don't add it again
8050 *) dflt="$dflt -fstack-protector" ;;
8056 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8059 none) lddlflags=' ' ;;
8060 *) lddlflags="$ans" ;;
8065 Some systems may require passing special flags to $cc to indicate that
8066 the resulting executable will use dynamic linking. To use no flags,
8070 case "$ccdlflags" in
8071 '') case "$osname" in
8072 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8073 next|sunos) dflt='none' ;;
8077 *) dflt="$ccdlflags" ;;
8079 rp="Any special flags to pass to $cc to use dynamic linking?"
8082 none) ccdlflags=' ' ;;
8083 *) ccdlflags="$ans" ;;
8094 ld_can_script="$undef"
8095 case "$bin_ELF$usedl" in
8097 # Abuse try.h and a.out names for neat cleanup
8109 if $cc $cccdlflags $ccdlflags $ccflags \
8110 $ldflags $lddlflags -o a.out try.c \
8111 -Wl,--version-script=try.h >/dev/null 2>&1 \
8112 && $test -s a.out ; then
8113 echo "ld supports scripting" >&4
8114 ld_can_script="$define"
8116 echo "ld does not support scripting" >&4
8122 : Do we want a shared libperl?
8126 # No dynamic loading being used, so don't bother even to prompt.
8129 *) case "$useshrplib" in
8130 '') case "$osname" in
8131 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8133 also='Building a shared libperl is required for dynamic loading to work on your system.'
8138 also='Building a shared libperl is needed for MAB support.'
8156 The perl executable is normally obtained by linking perlmain.c with
8157 libperl${_a}, any static extensions (usually just DynaLoader), and
8158 any other libraries needed on this system (such as -lm, etc.). Since
8159 your system supports dynamic loading, it is probably possible to build
8160 a shared libperl.$so. If you will have more than one executable linked
8161 to libperl.$so, this will significantly reduce the size of each
8162 executable, but it may have a noticeable effect on performance. The
8163 default is probably sensible for your system.
8167 rp="Build a shared libperl.$so (y/n)"
8171 useshrplib='true' ;;
8172 *) useshrplib='false' ;;
8177 case "$useshrplib" in
8179 case "$userelocatableinc" in
8181 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8182 echo "See INSTALL for an explanation why that won't work." >&4
8188 # Figure out a good name for libperl.so. Since it gets stored in
8189 # a version-specific architecture-dependent library, the version
8190 # number isn't really that important, except for making cc/ld happy.
8192 # A name such as libperl.so.10.1
8193 majmin="libperl.$so.$patchlevel.$subversion"
8194 # A name such as libperl.so.100
8195 majonly=`echo $patchlevel $subversion |
8196 $awk '{printf "%d%02d", $1, $2}'`
8197 majonly=libperl.$so.$majonly
8198 # I'd prefer to keep the os-specific stuff here to a minimum, and
8199 # rely on figuring it out from the naming of libc.
8200 case "${osname}${osvers}" in
8203 # XXX How handle the --version stuff for MAB?
8205 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8208 cygwin*) # ld links now against the dll directly
8209 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8210 majonly=`echo $patchlevel $subversion |
8211 $awk '{printf "%03d%03d", $1, $2}'`
8212 majonly=cygperl5.$majonly.$so
8215 *) # Try to guess based on whether libc has major.minor.
8217 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8218 *libc.$so.[0-9]*) dflt=$majonly ;;
8219 *) dflt=libperl.$so ;;
8229 I need to select a good name for the shared libperl. If your system uses
8230 library names with major and minor numbers, then you might want something
8231 like $majmin. Alternatively, if your system uses a single version
8232 number for shared libraries, then you might want to use $majonly.
8233 Or, your system might be quite happy with a simple libperl.$so.
8235 Since the shared libperl will get installed into a version-specific
8236 architecture-dependent directory, the version number of the shared perl
8237 library probably isn't important, so the default should be o.k.
8240 rp='What name do you want to give to the shared libperl?'
8243 echo "Ok, I'll use $libperl"
8246 libperl="libperl${_a}"
8250 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8254 WARNING: Use of the shrpdir variable for the installation location of
8255 the shared $libperl is not supported. It was never documented and
8256 will not work in this version. Let me (perlbug@perl.org)
8257 know of any problems this may cause.
8263 But your current setting of $shrpdir is
8264 the default anyway, so it's harmless.
8269 Further, your current attempted setting of $shrpdir
8270 conflicts with the value of $archlibexp/CORE
8271 that installperl will use.
8278 # How will the perl executable find the installed shared $libperl?
8279 # Add $xxx to ccdlflags.
8280 # If we can't figure out a command-line option, use $shrpenv to
8281 # set env LD_RUN_PATH. The main perl makefile uses this.
8282 shrpdir=$archlibexp/CORE
8285 if "$useshrplib"; then
8288 # We'll set it in Makefile.SH...
8293 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8294 xxx="-Wl,-R$shrpdir"
8296 bsdos|linux|irix*|dec_osf|gnu*)
8297 xxx="-Wl,-rpath,$shrpdir"
8300 # next doesn't like the default...
8303 # beos doesn't like the default, either.
8306 # Haiku doesn't like the default, either.
8309 # hpux doesn't like the default, either.
8310 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8313 # cygwin needs only ldlibpth
8316 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8322 # Only add $xxx if it isn't already in ccdlflags.
8323 case " $ccdlflags " in
8325 *) ccdlflags="$ccdlflags $xxx"
8328 Adding $xxx to the flags
8329 passed to $ld so that the perl executable will find the
8330 installed shared $libperl.
8338 # Fix ccdlflags in AIX for building external extensions.
8339 # (For building Perl itself bare -bE:perl.exp is needed,
8340 # Makefile.SH takes care of this.)
8342 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8344 # Respect a hint or command-line value.
8346 '') shrpenv="$tmp_shrpenv" ;;
8348 case "$ldlibpthname" in
8349 '') ldlibpthname=LD_LIBRARY_PATH ;;
8350 none) ldlibpthname='' ;;
8353 : determine where manual pages are on this system
8357 syspath='/usr/share/man/man1 /usr/man/man1'
8358 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8359 syspath="$syspath /usr/man/u_man/man1"
8360 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8361 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8362 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8363 sysman=`./loc . /usr/man/man1 $syspath`
8366 if $test -d "$sysman"; then
8367 echo "System manual is in $sysman." >&4
8369 echo "Could not find manual pages in source form." >&4
8372 : determine where manual pages go
8373 set man1dir man1dir none
8377 $spackage has manual pages available in source form.
8381 echo "However, you don't have nroff, so they're probably useless to you."
8383 '') man1dir="none";;
8386 echo "If you don't want the manual sources installed, answer 'none'."
8391 lookpath="$prefixexp/share/man/man1"
8392 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8393 lookpath="$lookpath $prefixexp/man/p_man/man1"
8394 lookpath="$lookpath $prefixexp/man/u_man/man1"
8395 lookpath="$lookpath $prefixexp/man/man.1"
8397 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8398 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8408 rp="Where do the main $spackage manual pages (source) go?"
8410 if $test "X$man1direxp" != "X$ansexp"; then
8421 : What suffix to use on installed man pages
8428 rp="What suffix should be used for the main $spackage man pages?"
8430 '') case "$man1dir" in
8444 *) dflt="$man1ext";;
8451 : see if we can have long filenames
8453 first=123456789abcdef
8455 if (echo hi >$first) 2>/dev/null; then
8456 if $test -f 123456789abcde; then
8457 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8460 echo 'You can have filenames longer than 14 characters.'>&4
8465 You can't have filenames longer than 14 chars.
8466 You can't even think about them!
8472 $rm -rf 123456789abcde*
8474 : determine where library module manual pages go
8475 set man3dir man3dir none
8479 $spackage has manual pages for many of the library modules.
8485 However, you don't have nroff, so they're probably useless to you.
8488 '') man3dir="none";;
8492 case "$d_flexfnam" in
8495 However, your system can't handle the long file names like File::Basename.3.
8498 '') man3dir="none";;
8502 echo "If you don't want the manual sources installed, answer 'none'."
8503 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8505 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8506 if $test -d "$privlib/man/man3"; then
8509 WARNING: Previous versions of perl installed man3 pages into
8510 $privlib/man/man3. This version will suggest a
8511 new default of $dflt.
8515 rp='Do you wish to preserve the old behavior?(y/n)'
8518 y*) dflt="$privlib/man/man3" ;;
8523 *) dflt="$man3dir" ;;
8530 rp="Where do the $package library man pages (source) go?"
8540 : What suffix to use on installed man pages
8546 rp="What suffix should be used for the $package library man pages?"
8548 '') case "$man3dir" in
8562 *) dflt="$man3ext";;
8569 : see if we have to deal with yellow pages, now NIS.
8570 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8571 if $test -f /usr/etc/nibindd; then
8573 echo "I'm fairly confident you're on a NeXT."
8575 rp='Do you get the hosts file via NetInfo?'
8584 y*) hostcat='nidump hosts .';;
8585 *) case "$hostcat" in
8586 nidump*) hostcat='';;
8596 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8604 rp='Are you getting the hosts file via yellow pages?'
8607 y*) hostcat='ypcat hosts';;
8608 *) hostcat='cat /etc/hosts';;
8614 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8617 '') test -f /etc/group && groupcat='cat /etc/group';;
8620 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8623 : now get the host name
8625 echo "Figuring out host name..." >&4
8626 case "$myhostname" in
8628 echo 'Maybe "hostname" will work...'
8629 if tans=`sh -c hostname 2>&1` ; then
8637 if $test "$cont"; then
8639 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8640 if tans=`cat /etc/systemid 2>&1` ; then
8642 phostname='cat /etc/systemid'
8643 echo "Whadyaknow. Xenix always was a bit strange..."
8646 elif $test -r /etc/systemid; then
8647 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8650 if $test "$cont"; then
8651 echo 'No, maybe "uuname -l" will work...'
8652 if tans=`sh -c 'uuname -l' 2>&1` ; then
8654 phostname='uuname -l'
8656 echo 'Strange. Maybe "uname -n" will work...'
8657 if tans=`sh -c 'uname -n' 2>&1` ; then
8659 phostname='uname -n'
8661 echo 'Oh well, maybe I can mine it out of whoami.h...'
8662 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8663 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8664 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8666 case "$myhostname" in
8667 '') echo "Does this machine have an identity crisis or something?"
8670 echo "Well, you said $myhostname before..."
8671 phostname='echo $myhostname';;
8677 case "$myhostname" in
8678 '') myhostname=noname ;;
8680 : you do not want to know about this
8685 if $test "$myhostname" ; then
8687 rp='Your host name appears to be "'$myhostname'".'" Right?"
8695 : bad guess or no guess
8696 while $test "X$myhostname" = X ; do
8698 rp="Please type the (one word) name of your host:"
8703 : translate upper to lower if necessary
8704 case "$myhostname" in
8706 echo "(Normalizing case in your host name)"
8707 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8711 case "$myhostname" in
8713 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8714 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8715 echo "(Trimming domain name from host name--host name is now $myhostname)"
8717 *) case "$mydomain" in
8720 test "X$hostcat" = "Xypcat hosts" &&
8721 ypmatch "$myhostname" hosts 2>/dev/null |\
8722 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8725 test "X$hostcat" != "X" &&
8726 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8727 /[ ]$myhostname[ . ]/p" > hosts
8730 if $test -f hosts; then
8731 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8732 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8733 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8734 hosts | $sort | $uniq | \
8735 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8736 case `$echo X$dflt` in
8737 X*\ *) echo "(Several hosts in the database matched hostname)"
8740 X.) echo "(You do not have fully-qualified names in the hosts database)"
8744 echo "(I cannot locate a hosts database anywhere)"
8749 tans=`./loc resolv.conf X /etc /usr/etc`
8750 if $test -f "$tans"; then
8751 echo "(Attempting domain name extraction from $tans)"
8752 dflt=.`$sed -n -e 's/ / /g' \
8753 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8756 .) dflt=.`$sed -n -e 's/ / /g' \
8757 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8765 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8766 dflt=.`sh -c domainname 2>/dev/null`
8769 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8773 case "$dflt$osname" in
8774 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8775 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8779 .) echo "(Lost all hope -- silly guess then)"
8785 *) dflt="$mydomain";;
8789 rp="What is your domain name?"
8799 : translate upper to lower if necessary
8802 echo "(Normalizing case in your domain name)"
8803 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8807 : a little sanity check here
8808 case "$phostname" in
8811 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8812 $myhostname$mydomain|$myhostname) ;;
8814 case "$phostname" in
8816 echo "(That doesn't agree with your whoami.h file, by the way.)"
8819 echo "(That doesn't agree with your $phostname command, by the way.)"
8827 : determine the e-mail address of the user who is running us
8830 I need to get your e-mail address in Internet format if possible, i.e.
8831 something like user@host.domain. Please answer accurately since I have
8832 no easy means to double check it. The default value provided below
8833 is most probably close to reality but may not be valid from outside
8834 your organization...
8838 while test "$cont"; do
8840 '') dflt="$cf_by@$myhostname$mydomain";;
8841 *) dflt="$cf_email";;
8843 rp='What is your e-mail address?'
8849 rp='Address does not look like an Internet one. Use it anyway?'
8863 : Ask e-mail of administrator
8866 If you or somebody else will be maintaining perl at your site, please
8867 fill in the correct e-mail address here so that they may be contacted
8868 if necessary. Currently, the "perlbug" program included with perl
8869 will send mail to this address in addition to perlbug@perl.org. You may
8870 enter "none" for no administrator.
8873 case "$perladmin" in
8874 '') dflt="$cf_email";;
8875 *) dflt="$perladmin";;
8877 rp='Perl administrator e-mail address'
8881 : determine whether to only install version-specific parts.
8884 Do you want to install only the version-specific parts of the perl
8885 distribution? Usually you do *not* want to do this.
8887 case "$versiononly" in
8888 "$define"|[Yy]*|true) dflt='y' ;;
8891 rp="Do you want to install only the version-specific parts of perl?"
8894 [yY]*) val="$define";;
8900 case "$versiononly" in
8901 "$define") inc_version_list=''
8902 inc_version_list_init=0
8906 : figure out how to guarantee perl startup
8907 : XXX Note that this currently takes advantage of the bug that binexp ignores
8908 : the Configure -Dinstallprefix setting, which in turn means that under
8909 : relocatable @INC, initialinstalllocation is what binexp started as.
8910 case "$startperl" in
8912 case "$sharpbang" in
8916 I can use the #! construct to start perl on your system. This will
8917 make startup of perl scripts faster, but may cause problems if you
8918 want to share those scripts and perl is not in a standard place
8919 ($initialinstalllocation/perl) on all your platforms. The alternative
8920 is to force a shell by starting the script with a single ':' character.
8923 case "$versiononly" in
8924 "$define") dflt="$initialinstalllocation/perl$version";;
8925 *) dflt="$initialinstalllocation/perl";;
8927 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8930 none) startperl=": # use perl";;
8931 *) startperl="#!$ans"
8932 if $test 30 -lt `echo "$ans" | wc -c`; then
8935 WARNING: Some systems limit the #! command to 32 characters.
8936 If you experience difficulty running Perl scripts with #!, try
8937 installing Perl in a directory with a shorter pathname.
8943 *) startperl=": # use perl"
8948 echo "I'll use $startperl to start perl scripts."
8950 : figure best path for perl in scripts
8953 case "$versiononly" in
8954 "$define") perlpath="$initialinstalllocation/perl$version";;
8955 *) perlpath="$initialinstalllocation/perl";;
8957 case "$startperl" in
8962 I will use the "eval 'exec'" idiom to start Perl on your system.
8963 I can use the full path of your Perl binary for this purpose, but
8964 doing so may cause problems if you want to share those scripts and
8965 Perl is not always in a standard place ($initialinstalllocation/perl).
8968 dflt="$initialinstalllocation/perl"
8969 rp="What path shall I use in \"eval 'exec'\"?"
8976 case "$startperl" in
8978 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8981 : determine where public executable scripts go
8982 set scriptdir scriptdir
8984 case "$scriptdir" in
8987 : guess some guesses
8988 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8989 $test -d /usr/share/bin && dflt=/usr/share/bin
8990 $test -d /usr/local/script && dflt=/usr/local/script
8991 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8992 $test -d $prefixexp/script && dflt=$prefixexp/script
8996 *) dflt="$scriptdir"
9001 Some installations have a separate directory just for executable scripts so
9002 that they can mount it across multiple architectures but keep the scripts in
9003 one spot. You might, for example, have a subdirectory of /usr/share for this.
9004 Or you might just lump your scripts in with all your other executables.
9008 rp='Where do you keep publicly executable scripts?'
9010 if $test "X$ansexp" != "X$scriptdirexp"; then
9016 : A little fix up for an irregularly named variable.
9017 installscript="$installscriptdir"
9019 : determine where add-on public executables go
9021 '') dflt=$siteprefix/bin ;;
9025 rp='Pathname where the add-on public executables should be installed?'
9030 : determine where add-on html pages go
9031 : There is no standard location, so try to copy the previously-selected
9032 : directory structure for the core html pages.
9033 case "$sitehtml1dir" in
9034 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9035 *) dflt=$sitehtml1dir ;;
9038 ''|' ') dflt=none ;;
9041 rp='Pathname where the site-specific html pages should be installed?'
9043 prefixvar=sitehtml1dir
9046 : determine where add-on library html pages go
9047 : There is no standard location, so try to copy the previously-selected
9048 : directory structure for the core html pages.
9049 case "$sitehtml3dir" in
9050 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9051 *) dflt=$sitehtml3dir ;;
9054 ''|' ') dflt=none ;;
9057 rp='Pathname where the site-specific library html pages should be installed?'
9059 prefixvar=sitehtml3dir
9062 : determine where add-on manual pages go
9063 case "$siteman1dir" in
9064 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9065 *) dflt=$siteman1dir ;;
9068 ''|' ') dflt=none ;;
9071 rp='Pathname where the site-specific manual pages should be installed?'
9073 prefixvar=siteman1dir
9076 : determine where add-on library man pages go
9077 case "$siteman3dir" in
9078 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9079 *) dflt=$siteman3dir ;;
9082 ''|' ') dflt=none ;;
9085 rp='Pathname where the site-specific library manual pages should be installed?'
9087 prefixvar=siteman3dir
9090 : determine where add-on public executable scripts go
9091 case "$sitescript" in
9092 '') dflt=$siteprefix/script
9093 $test -d $dflt || dflt=$sitebin ;;
9094 *) dflt="$sitescript" ;;
9097 rp='Pathname where add-on public executable scripts should be installed?'
9099 prefixvar=sitescript
9102 : Check if faststdio is requested and available
9103 case "$usefaststdio" in
9104 $define|true|[yY]*|'')
9105 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9115 Perl can be built to use 'fast stdio', which means using the stdio
9116 library but also directly manipulating the stdio buffers to enable
9117 faster I/O. Using stdio is better for backward compatibility (especially
9118 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9119 interface has been preferred instead of stdio.
9121 If this doesn't make any sense to you, just accept the default '$dflt'.
9123 rp='Use the "fast stdio" if available?'
9126 y|Y) val="$define" ;;
9133 : define an is-a-typedef? function
9134 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9136 "") inclist="sys/types.h";;
9138 eval "varval=\$$var";
9142 for inc in $inclist; do
9143 echo "#include <$inc>" >>temp.c;
9145 echo "#ifdef $type" >> temp.c;
9146 echo "printf(\"We have $type\");" >> temp.c;
9147 echo "#endif" >> temp.c;
9148 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9149 if $contains $type temp.E >/dev/null 2>&1; then
9155 *) eval "$var=\$varval";;
9158 : define an is-a-typedef? function that prompts if the type is not available.
9159 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9161 "") inclist="sys/types.h";;
9163 eval "varval=\$$var";
9167 for inc in $inclist; do
9168 echo "#include <$inc>" >>temp.c;
9170 echo "#ifdef $type" >> temp.c;
9171 echo "printf(\"We have $type\");" >> temp.c;
9172 echo "#endif" >> temp.c;
9173 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9175 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9176 if $contains $type temp.E >/dev/null 2>&1; then
9177 echo "$type found." >&4;
9180 echo "$type NOT found." >&4;
9186 *) eval "$var=\$varval";;
9189 : see what type lseek is declared as in the kernel
9190 rp="What is the type used for lseek's offset on this system?"
9191 set off_t lseektype long stdio.h sys/types.h
9195 echo "Checking to see how big your file offsets are..." >&4
9197 #include <sys/types.h>
9201 printf("%d\n", (int)sizeof($lseektype));
9206 if eval $compile_ok; then
9207 lseeksize=`$run ./try`
9208 echo "Your file offsets are $lseeksize bytes long."
9212 echo "(I can't seem to compile the test program. Guessing...)"
9213 rp="What is the size of your file offsets (in bytes)?"
9219 : see what type file positions are declared as in the library
9220 rp="What is the type for file position used by fsetpos()?"
9221 set fpos_t fpostype long stdio.h sys/types.h
9224 : Check size for Fpos_t
9227 *_t) zzz="$fpostype" ;;
9230 echo "Checking the size of $zzz..." >&4
9232 #include <sys/types.h>
9239 printf("%d\n", (int)sizeof($fpostype));
9244 if eval $compile_ok; then
9248 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9251 echo "Your $zzz is $fpossize bytes long."
9257 echo "(I can't compile the test program. Guessing...)" >&4
9258 rp="What is the size of your file positions (in bytes)?"
9263 : Check for large file support
9264 # Backward compatibility (uselfs is deprecated).
9266 "$define"|true|[yY]*)
9269 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9271 uselargefiles="$define"
9275 case "$lseeksize:$fpossize" in
9278 You can have files larger than 2 gigabytes.
9281 *) case "$uselargefiles" in
9282 "$undef"|false|[nN]*) dflt='n' ;;
9287 Perl can be built to understand large files (files larger than 2 gigabytes)
9288 on some systems. To do so, Configure can be run with -Duselargefiles.
9290 If this doesn't make any sense to you, just accept the default '$dflt'.
9292 rp='Try to understand large files, if available?'
9295 y|Y) val="$define" ;;
9302 : Look for a hint-file generated 'call-back-unit'. If the
9303 : user has specified that a large files perl is to be built,
9304 : we may need to set or change some other defaults.
9305 if $test -f uselargefiles.cbu; then
9306 echo "Your platform has some specific hints regarding large file builds, using them..."
9307 . ./uselargefiles.cbu
9309 case "$uselargefiles" in
9311 if $test -f uselargefiles.cbu; then
9313 echo "Rechecking to see how big your file offsets are..." >&4
9315 #include <sys/types.h>
9319 printf("%d\n", (int)sizeof($lseektype));
9324 if eval $compile_ok; then
9325 lseeksize=`$run ./try`
9326 $echo "Your file offsets are now $lseeksize bytes long."
9330 echo "(I can't seem to compile the test program. Guessing...)"
9331 rp="What is the size of your file offsets (in bytes)?"
9336 *_t) zzz="$fpostype" ;;
9339 $echo $n "Rechecking the size of $zzz...$c" >&4
9341 #include <sys/types.h>
9348 printf("%d\n", (int)sizeof($fpostype));
9353 if eval $compile_ok; then
9358 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9361 echo " $fpossize bytes." >&4
9367 echo "(I can't compile the test program. Guessing...)" >&4
9368 rp="What is the size of your file positions (in bytes)?"
9377 : Check if we want perlio
9380 : Set the vendorbin variables
9381 case "$vendorprefix" in
9382 '') d_vendorbin="$undef"
9386 *) d_vendorbin="$define"
9387 : determine where vendor-supplied executables go.
9388 case "$vendorbin" in
9389 '') dflt=$vendorprefix/bin ;;
9390 *) dflt="$vendorbin" ;;
9393 rp='Pathname for the vendor-supplied executables directory?'
9396 vendorbinexp="$ansexp"
9402 : Set the vendorhtml1dir variables
9403 case "$vendorprefix" in
9404 '') vendorhtml1dir=''
9405 vendorhtml1direxp=''
9407 *) : determine where vendor-supplied html pages go.
9408 : There is no standard location, so try to copy the previously-selected
9409 : directory structure for the core html pages.
9410 : XXX Better default suggestions would be welcome.
9411 case "$vendorhtml1dir" in
9412 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9413 *) dflt=$vendorhtml1dir ;;
9416 ''|' ') dflt=none ;;
9419 rp='Pathname for the vendor-supplied html pages?'
9421 vendorhtml1dir="$ans"
9422 vendorhtml1direxp="$ansexp"
9425 : Use ' ' for none so value is preserved next time through Configure
9426 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9427 prefixvar=vendorhtml1dir
9430 : Set the vendorhtml3dir variables
9431 case "$vendorprefix" in
9432 '') vendorhtml3dir=''
9433 vendorhtml3direxp=''
9435 *) : determine where vendor-supplied module html pages go.
9436 : There is no standard location, so try to copy the previously-selected
9437 : directory structure for the core html pages.
9438 : XXX Better default suggestions would be welcome.
9439 case "$vendorhtml3dir" in
9440 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9441 *) dflt=$vendorhtml3dir ;;
9444 ''|' ') dflt=none ;;
9447 rp='Pathname for the vendor-supplied html pages?'
9449 vendorhtml3dir="$ans"
9450 vendorhtml3direxp="$ansexp"
9453 : Use ' ' for none so value is preserved next time through Configure
9454 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9455 prefixvar=vendorhtml3dir
9458 : Set the vendorman1dir variables
9459 case "$vendorprefix" in
9460 '') vendorman1dir=''
9463 *) : determine where vendor-supplied manual pages go.
9464 case "$vendorman1dir" in
9465 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9466 *) dflt=$vendorman1dir ;;
9469 ''|' ') dflt=none ;;
9472 rp='Pathname for the vendor-supplied manual section 1 pages?'
9474 vendorman1dir="$ans"
9475 vendorman1direxp="$ansexp"
9478 : Use ' ' for none so value is preserved next time through Configure
9479 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9480 prefixvar=vendorman1dir
9483 : Set the vendorman3dir variables
9484 case "$vendorprefix" in
9485 '') vendorman3dir=''
9488 *) : determine where vendor-supplied module manual pages go.
9489 case "$vendorman3dir" in
9490 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9491 *) dflt=$vendorman3dir ;;
9494 ''|' ') dflt=none ;;
9497 rp='Pathname for the vendor-supplied manual section 3 pages?'
9499 vendorman3dir="$ans"
9500 vendorman3direxp="$ansexp"
9503 : Use ' ' for none so value is preserved next time through Configure
9504 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9505 prefixvar=vendorman3dir
9508 : Set the vendorscript variables
9509 case "$vendorprefix" in
9510 '') d_vendorscript="$undef"
9514 *) d_vendorscript="$define"
9515 : determine where vendor-supplied scripts go.
9516 case "$vendorscript" in
9517 '') dflt=$vendorprefix/script
9518 $test -d $dflt || dflt=$vendorbin ;;
9519 *) dflt="$vendorscript" ;;
9523 The installation process will create a directory for
9524 vendor-supplied scripts.
9528 rp='Pathname for the vendor-supplied scripts directory?'
9531 vendorscriptexp="$ansexp"
9534 prefixvar=vendorscript
9537 : script used to emit important warnings
9540 if test \$# -gt 0; then
9545 echo "*** WARNING:" >&4
9546 sed -e 's/^/*** /' <msg >&4
9548 cat msg >>config.msg
9549 echo " " >>config.msg
9555 : see which of string.h or strings.h is needed
9557 strings=`./findhdr string.h`
9558 if $test "$strings" && $test -r "$strings"; then
9559 echo "Using <string.h> instead of <strings.h>." >&4
9563 strings=`./findhdr strings.h`
9564 if $test "$strings" && $test -r "$strings"; then
9565 echo "Using <strings.h> instead of <string.h>." >&4
9567 ./warn "No string header found -- You'll surely have problems."
9573 "$undef") strings=`./findhdr strings.h`;;
9574 *) strings=`./findhdr string.h`;;
9577 : see if qgcvt exists
9581 : Check print/scan long double stuff
9584 if $test X"$d_longdbl" = X"$define"; then
9586 echo "Checking how to print long doubles..." >&4
9588 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9589 $cat >try.c <<'EOCP'
9590 #include <sys/types.h>
9594 printf("%.3f\n", d);
9598 if eval $compile; then
9602 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9603 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9604 echo "We will use %f."
9610 if $test X"$sPRIfldbl" = X; then
9611 $cat >try.c <<'EOCP'
9612 #include <sys/types.h>
9615 long double d = 123.456;
9616 printf("%.3Lf\n", d);
9620 if eval $compile; then
9624 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9625 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9626 echo "We will use %Lf."
9632 if $test X"$sPRIfldbl" = X; then
9633 $cat >try.c <<'EOCP'
9634 #include <sys/types.h>
9637 long double d = 123.456;
9638 printf("%.3llf\n", d);
9642 if eval $compile; then
9646 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9647 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9648 echo "We will use %llf."
9654 if $test X"$sPRIfldbl" = X; then
9655 $cat >try.c <<'EOCP'
9656 #include <sys/types.h>
9659 long double d = 123.456;
9660 printf("%.3lf\n", d);
9664 if eval $compile; then
9668 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9669 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9670 echo "We will use %lf."
9676 if $test X"$sPRIfldbl" = X; then
9677 echo "Cannot figure out how to print long doubles." >&4
9679 sSCNfldbl=$sPRIfldbl # expect consistency
9686 case "$sPRIfldbl" in
9687 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9688 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9689 d_SCNfldbl="$undef";
9691 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9692 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9693 d_SCNfldbl="$define";
9697 : Check how to convert floats to strings.
9699 if test "X$d_Gconvert" = X; then
9702 echo "Checking for an efficient way to convert floats to strings."
9704 case "$uselongdouble" in
9705 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9707 case "$d_longdbl" in
9708 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9710 case "$d_PRIgldbl" in
9711 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9715 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9716 char *myname = "gconvert";
9719 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9720 char *myname = "gcvt";
9723 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9724 char *myname = "qgcvt";
9725 #define DOUBLETYPE long double
9728 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9730 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9732 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9735 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9737 char *myname = "sprintf";
9741 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9742 #define DOUBLETYPE long double
9744 #define DOUBLETYPE double
9756 # include <string.h>
9758 # include <strings.h>
9761 int checkit(char *expect, char *got)
9763 if (strcmp(expect, got)) {
9764 printf("%s oddity: Expected %s, got %s\n",
9765 myname, expect, got);
9775 /* This must be 1st test on (which?) platform */
9776 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9777 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9778 checkit("0.1", buf);
9780 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9781 checkit("0.01", buf);
9783 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9784 checkit("0.001", buf);
9786 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9787 checkit("0.0001", buf);
9789 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9790 if (strlen(buf) > 5)
9791 checkit("9e-005", buf); /* for Microsoft ?? */
9793 checkit("9e-05", buf);
9795 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9798 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9799 checkit("1.1", buf);
9801 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9802 checkit("1.01", buf);
9804 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9805 checkit("1.001", buf);
9807 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9808 checkit("1.0001", buf);
9810 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9811 checkit("1.00001", buf);
9813 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9814 checkit("1.000001", buf);
9816 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9819 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9822 /* Some Linux gcvt's give 1.e+5 here. */
9823 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9824 checkit("100000", buf);
9826 /* Some Linux gcvt's give -1.e+5 here. */
9827 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9828 checkit("-100000", buf);
9830 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9831 checkit("123.456", buf);
9833 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9834 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9835 /* 34 should be enough to scare even long double
9836 * places into using the e notation. */
9837 if (strlen(buf) > 5)
9838 checkit("1e+034", buf); /* for Microsoft */
9840 checkit("1e+34", buf);
9842 /* For Perl, if you add additional tests here, also add them to
9843 * t/base/num.t for benefit of platforms not using Configure or
9844 * overriding d_Gconvert */
9849 : first add preferred functions to our list
9851 for xxx_convert in $gconvert_preference; do
9852 case $xxx_convert in
9853 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9854 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9857 : then add any others
9858 for xxx_convert in gconvert gcvt sprintf; do
9861 *) xxx_list="$xxx_list $xxx_convert" ;;
9865 case "$d_longdbl$uselongdouble" in
9867 : again, add preferred functions to our list first
9869 for xxx_convert in $gconvert_ld_preference; do
9870 case $xxx_convert in
9871 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9872 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9875 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9876 for xxx_convert in qgcvt sprintf $xxx_list; do
9877 case "$xxx_ld_list" in
9878 $xxx_convert*|*" $xxx_convert"*) ;;
9879 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9882 : if sprintf cannot do long doubles, move it to the end
9883 if test "$d_PRIgldbl" != "$define"; then
9884 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9886 : if no qgcvt, remove it
9887 if test "$d_qgcvt" != "$define"; then
9888 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9891 xxx_list="$xxx_ld_list"
9895 for xxx_convert in $xxx_list; do
9896 echo "Trying $xxx_convert..."
9897 $rm -f try try$_o core
9898 set try -DTRY_$xxx_convert
9899 if eval $compile; then
9900 echo "$xxx_convert() found." >&4
9902 echo "I'll use $xxx_convert to convert floats into a string." >&4
9905 echo "...But $xxx_convert didn't work as I expected."
9909 echo "$xxx_convert NOT found." >&4
9913 if test X$xxx_convert = X; then
9914 echo "*** WHOA THERE!!! ***" >&4
9915 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9919 case "$xxx_convert" in
9920 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9921 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9922 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9923 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9924 "$define$define$define")
9925 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9926 "$define$define$undef")
9927 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9928 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9936 : see if _fwalk exists
9940 : Initialize h_fcntl
9943 : Initialize h_sysfile
9946 : access call always available on UNIX
9950 : locate the flags for 'access()'
9954 $cat >access.c <<EOCP
9955 #include <sys/types.h>
9960 #include <sys/file.h>
9973 : check sys/file.h first, no particular reason here
9974 if $test `./findhdr sys/file.h` && \
9975 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9977 echo "<sys/file.h> defines the *_OK access constants." >&4
9978 elif $test `./findhdr fcntl.h` && \
9979 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9981 echo "<fcntl.h> defines the *_OK access constants." >&4
9982 elif $test `./findhdr unistd.h` && \
9983 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9984 echo "<unistd.h> defines the *_OK access constants." >&4
9986 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9992 : see if accessx exists
9993 set accessx d_accessx
9996 : see if aintl exists
10000 : see if alarm exists
10004 : see if 64bit time functions exists
10006 set ctime64 d_ctime64
10009 set localtime64 d_localtime64
10012 set gmtime64 d_gmtime64
10015 set mktime64 d_mktime64
10018 set difftime64 d_difftime64
10021 set asctime64 d_asctime64
10024 : see if POSIX threads are available
10025 set pthread.h i_pthread
10028 : define a function to check prototypes
10029 $cat > protochk <<EOSH
10032 optimize="$optimize"
10034 prototype="$prototype"
10037 usethreads=$usethreads
10038 i_pthread=$i_pthread
10039 pthread_h_first=$pthread_h_first
10042 $cat >> protochk <<'EOSH'
10047 while test $# -ge 2; do
10049 $define) echo "#include <$2>" >> try.c ;;
10050 literal) echo "$2" >> try.c ;;
10052 # Extra magic for the benefit of systems that need pthread.h
10053 # to be included early to correctly detect threadsafe functions.
10054 # Such functions must guarantee themselves, though, that the usethreads
10055 # and i_pthread have been defined, before calling protochk.
10056 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10057 echo "#include <pthread.h>" >> try.c
10062 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10063 cat >> try.c <<'EOCP'
10064 #ifdef CAN_PROTOTYPE
10065 #define _(args) args
10070 echo "$foo" >> try.c
10071 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10072 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10078 $eunicefix protochk
10080 : Define hasproto macro for Configure internal use
10081 hasproto='varname=$1; func=$2; shift; shift;
10082 while $test $# -ge 2; do
10084 $define) echo "#include <$2>";;
10088 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10089 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10090 echo "$func() prototype found.";
10093 echo "$func() prototype NOT found.";
10100 : see if sys/types.h has to be included
10101 set sys/types.h i_systypes
10104 : see if sys/select.h has to be included
10105 set sys/select.h i_sysselct
10108 : Define hasfield macro for Configure internal use
10109 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10110 while $test $# -ge 2; do
10112 $define) echo "#include <$2>";;
10116 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10118 if eval $compile; then
10127 : see if we should include time.h, sys/time.h, or both
10129 if test "X$timeincl" = X; then
10130 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10131 $echo $n "I'm now running the test program...$c"
10133 #include <sys/types.h>
10138 #ifdef SYSTIMEKERNEL
10141 #include <sys/time.h>
10144 #include <sys/select.h>
10146 #$i_stdlib I_STDLIB
10148 #include <stdlib.h>
10154 struct timeval bar;
10157 struct timezone tzp;
10159 if (foo.tm_sec == foo.tm_sec)
10162 if (bar.tv_sec == bar.tv_sec)
10169 for s_timezone in '-DS_TIMEZONE' ''; do
10171 for s_timeval in '-DS_TIMEVAL' ''; do
10172 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10173 for i_time in '' '-DI_TIME'; do
10174 for i_systime in '-DI_SYSTIME' ''; do
10177 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10178 if eval $compile; then
10179 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10183 $echo $n "Succeeded with $flags$c"
10195 *SYSTIMEKERNEL*) i_systimek="$define"
10196 timeincl=`./findhdr sys/time.h`
10197 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10198 *) i_systimek="$undef";;
10201 *I_TIME*) i_time="$define"
10202 timeincl=`./findhdr time.h`" $timeincl"
10203 echo "We'll include <time.h>." >&4;;
10204 *) i_time="$undef";;
10207 *I_SYSTIME*) i_systime="$define"
10208 timeincl=`./findhdr sys/time.h`" $timeincl"
10209 echo "We'll include <sys/time.h>." >&4;;
10210 *) i_systime="$undef";;
10214 : see if struct tm knows about tm_zone
10215 case "$i_systime$i_time" in
10218 echo "Checking to see if your struct tm has tm_zone field..." >&4
10219 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10227 case "$d_tm_tm_zone" in
10228 "$define") echo "Yes, it does." ;;
10229 *) echo "No, it doesn't." ;;
10231 : see if struct tm knows about tm_gmtoff
10232 case "$i_systime$i_time" in
10235 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10236 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10244 case "$d_tm_tm_gmtoff" in
10245 "$define") echo "Yes, it does." ;;
10246 *) echo "No, it doesn't." ;;
10249 : see if asctime_r exists
10250 set asctime_r d_asctime_r
10252 case "$d_asctime_r" in
10254 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10255 case "$d_asctime_r_proto:$usethreads" in
10256 ":define") d_asctime_r_proto=define
10257 set d_asctime_r_proto asctime_r $hdrs
10261 case "$d_asctime_r_proto" in
10263 case "$asctime_r_proto" in
10264 ''|0) try='char* asctime_r(const struct tm*, char*);'
10265 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10267 case "$asctime_r_proto" in
10268 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10269 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10271 case "$asctime_r_proto" in
10272 ''|0) try='int asctime_r(const struct tm*, char*);'
10273 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10275 case "$asctime_r_proto" in
10276 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10277 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10279 case "$asctime_r_proto" in
10280 ''|0) d_asctime_r=undef
10282 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10283 * ) case "$asctime_r_proto" in
10284 REENTRANT_PROTO*) ;;
10285 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10287 echo "Prototype: $try" ;;
10290 *) case "$usethreads" in
10291 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10298 *) asctime_r_proto=0
10302 : see if atolf exists
10306 : see if atoll exists
10310 : Look for GCC-style attribute format
10311 case "$d_attribute_format" in
10314 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10315 $cat >attrib.c <<'EOCP'
10317 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10319 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10320 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10321 echo "Your C compiler doesn't support __attribute__((format))."
10324 echo "Your C compiler supports __attribute__((format))."
10328 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10332 *) val="$d_attribute_format" ;;
10334 set d_attribute_format
10338 : Look for GCC-style attribute format with null format allowed
10339 case "$d_printf_format_null" in
10340 '') case "$d_attribute_format" in
10343 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10344 $cat >attrib.c <<EOCP
10346 #$i_stdlib I_STDLIB
10348 #include <stdlib.h>
10350 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10351 int null_printf (char* pat,...) { return (int)pat; }
10352 int main () { exit(null_printf(NULL)); }
10354 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10355 : run the executable in case it produces a run-time warning
10356 if $run ./attrib >>attrib.out 2>&1; then
10357 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10358 echo "Your C compiler doesn't allow __printf__ format to be null."
10361 echo "Your C compiler allows __printf__ format to be null."
10365 echo "Your C compiler executable failed with __printf__ format null."
10369 echo "Your C compiler fails with __printf__ format null."
10376 *) val="$d_printf_format_null" ;;
10378 set d_printf_format_null
10382 : Look for GCC-style attribute malloc
10383 case "$d_attribute_malloc" in
10386 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10387 $cat >attrib.c <<'EOCP'
10389 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10391 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10392 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10393 echo "Your C compiler doesn't support __attribute__((malloc))."
10396 echo "Your C compiler supports __attribute__((malloc))."
10400 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10404 *) val="$d_attribute_malloc" ;;
10406 set d_attribute_malloc
10410 : Look for GCC-style attribute nonnull
10411 case "$d_attribute_nonnull" in
10414 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10415 $cat >attrib.c <<'EOCP'
10417 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10419 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10420 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10421 echo "Your C compiler doesn't support __attribute__((nonnull))."
10424 echo "Your C compiler supports __attribute__((nonnull))."
10428 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10432 *) val="$d_attribute_nonnull" ;;
10434 set d_attribute_nonnull
10438 : Look for GCC-style attribute noreturn
10439 case "$d_attribute_noreturn" in
10442 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10443 $cat >attrib.c <<'EOCP'
10445 void fall_over_dead( void ) __attribute__((noreturn));
10447 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10448 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10449 echo "Your C compiler doesn't support __attribute__((noreturn))."
10452 echo "Your C compiler supports __attribute__((noreturn))."
10456 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10460 *) val="$d_attribute_noreturn" ;;
10462 set d_attribute_noreturn
10466 : Look for GCC-style attribute pure
10467 case "$d_attribute_pure" in
10470 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10471 $cat >attrib.c <<'EOCP'
10473 int square( int n ) __attribute__((pure));
10475 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10476 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10477 echo "Your C compiler doesn't support __attribute__((pure))."
10480 echo "Your C compiler supports __attribute__((pure))."
10484 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10488 *) val="$d_attribute_pure" ;;
10490 set d_attribute_pure
10494 : Look for GCC-style attribute unused
10495 case "$d_attribute_unused" in
10498 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10499 $cat >attrib.c <<'EOCP'
10501 int do_something( int dummy __attribute__((unused)), int n );
10503 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10504 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10505 echo "Your C compiler doesn't support __attribute__((unused))."
10508 echo "Your C compiler supports __attribute__((unused))."
10512 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10516 *) val="$d_attribute_unused" ;;
10518 set d_attribute_unused
10522 : Look for GCC-style attribute deprecated
10523 case "$d_attribute_deprecated" in
10526 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10527 $cat >attrib.c <<'EOCP'
10529 int I_am_deprecated(void) __attribute__((deprecated));
10531 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10532 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10533 echo "Your C compiler doesn't support __attribute__((deprecated))."
10536 echo "Your C compiler supports __attribute__((deprecated))."
10540 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10544 *) val="$d_attribute_deprecated" ;;
10546 set d_attribute_deprecated
10550 : Look for GCC-style attribute warn_unused_result
10551 case "$d_attribute_warn_unused_result" in
10554 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10555 $cat >attrib.c <<'EOCP'
10557 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10559 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10560 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10561 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10564 echo "Your C compiler supports __attribute__((warn_unused_result))."
10568 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10572 *) val="$d_attribute_warn_unused_result" ;;
10574 set d_attribute_warn_unused_result
10578 : see if bcmp exists
10582 : see if bcopy exists
10586 : see if getpgrp exists
10587 set getpgrp d_getpgrp
10590 case "$d_getpgrp" in
10593 echo "Checking to see which flavor of getpgrp is in use..."
10595 #$i_unistd I_UNISTD
10596 #include <sys/types.h>
10598 # include <unistd.h>
10600 #$i_stdlib I_STDLIB
10602 #include <stdlib.h>
10606 if (getuid() == 0) {
10607 printf("(I see you are running Configure as super-user...)\n");
10610 #ifdef TRY_BSD_PGRP
10611 if (getpgrp(1) == 0)
10620 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10621 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10623 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10624 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10627 echo "I can't seem to compile and run the test program."
10629 xxx="a USG one, i.e. you use getpgrp()."
10631 # SVR4 systems can appear rather BSD-ish.
10632 case "$i_unistd" in
10634 xxx="a BSD one, i.e. you use getpgrp(pid)."
10638 xxx="probably a USG one, i.e. you use getpgrp()."
10643 echo "Assuming your getpgrp is $xxx" >&4
10652 : see if setpgrp exists
10653 set setpgrp d_setpgrp
10656 case "$d_setpgrp" in
10659 echo "Checking to see which flavor of setpgrp is in use..."
10661 #$i_unistd I_UNISTD
10662 #include <sys/types.h>
10664 # include <unistd.h>
10666 #$i_stdlib I_STDLIB
10668 #include <stdlib.h>
10672 if (getuid() == 0) {
10673 printf("(I see you are running Configure as super-user...)\n");
10676 #ifdef TRY_BSD_PGRP
10677 if (-1 == setpgrp(1, 1))
10680 if (setpgrp() != -1)
10686 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10687 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10689 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10690 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10693 echo "(I can't seem to compile and run the test program.)"
10695 xxx="a USG one, i.e. you use setpgrp()."
10697 # SVR4 systems can appear rather BSD-ish.
10698 case "$i_unistd" in
10700 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10704 xxx="probably a USG one, i.e. you use setpgrp()."
10709 echo "Assuming your setpgrp is $xxx" >&4
10718 : Look for GCC-style __builtin_choose_expr
10719 case "$d_builtin_choose_expr" in
10722 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10723 $cat >try.c <<'EOCP'
10724 #include <assert.h>
10725 #include <stdlib.h>
10728 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10731 assert( SYRINX(1) == 2112 );
10732 assert( SYRINX(1) != 5150 );
10733 assert( SYRINX(0) == 5150 );
10734 assert( SYRINX(0) != 2112 );
10735 puts( "All good!" );
10741 if eval $compile && $run ./try; then
10742 echo "Your C compiler supports __builtin_choose_expr."
10745 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10749 *) val="$d_builtin_choose_expr" ;;
10752 set d_builtin_choose_expr
10756 : Look for GCC-style __builtin_expect
10757 case "$d_builtin_expect" in
10760 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10761 $cat >try.c <<'EOCP'
10764 if ( __builtin_expect(n, 0) ) n = 1;
10765 /* Remember shell exit code truth is 0, C truth is non-zero */
10770 if eval $compile && $run ./try; then
10771 echo "Your C compiler supports __builtin_expect."
10774 echo "Your C compiler doesn't seem to understand __builtin_expect."
10778 *) val="$d_builtin_expect" ;;
10781 set d_builtin_expect
10785 : see if bzero exists
10789 : see if stdarg is available
10791 if $test `./findhdr stdarg.h`; then
10792 echo "<stdarg.h> found." >&4
10795 echo "<stdarg.h> NOT found." >&4
10799 : see if varags is available
10801 if $test `./findhdr varargs.h`; then
10802 echo "<varargs.h> found." >&4
10804 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10807 : set up the varargs testing programs
10808 $cat > varargs.c <<EOP
10810 #include <stdarg.h>
10813 #include <varargs.h>
10817 int f(char *p, ...)
10831 p = va_arg(ap, char *);
10837 $cat > varargs <<EOP
10839 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10848 : now check which varargs header should be included
10853 if `./varargs I_STDARG`; then
10855 elif `./varargs I_VARARGS`; then
10860 if `./varargs I_VARARGS`; then
10867 echo "I could not find the definition for va_dcl... You have problems..." >&4
10868 val="$undef"; set i_stdarg; eval $setvar
10869 val="$undef"; set i_varargs; eval $setvar
10874 case "$i_varhdr" in
10876 val="$define"; set i_stdarg; eval $setvar
10877 val="$undef"; set i_varargs; eval $setvar
10880 val="$undef"; set i_stdarg; eval $setvar
10881 val="$define"; set i_varargs; eval $setvar
10884 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10888 : see if the Compiler supports C99 variadic macros
10889 case "$i_stdarg$i_stdlib" in
10891 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10894 #include <stdarg.h>
10896 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10900 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10906 if eval $compile && $run ./try 2>&1 >/dev/null; then
10907 case "`$run ./try`" in
10909 echo "You have C99 variadic macros." >&4
10910 d_c99_variadic_macros="$define"
10913 echo "You don't have functional C99 variadic macros." >&4
10914 d_c99_variadic_macros="$undef"
10918 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10919 d_c99_variadic_macros="$undef"
10924 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10925 d_c99_variadic_macros="$undef"
10929 : see if signal is declared as pointer to function returning int or void
10931 xxx=`./findhdr signal.h`
10932 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10933 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10934 echo "You have int (*signal())() instead of void." >&4
10936 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10937 echo "You have void (*signal())()." >&4
10939 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10940 echo "You have int (*signal())() instead of void." >&4
10942 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10943 echo "You have void (*signal())()." >&4
10946 case "$d_voidsig" in
10948 echo "I can't determine whether signal handler returns void or int..." >&4
10950 rp="What type does your signal handler return?"
10953 v*) val="$define";;
10957 echo "As you already told me, signal handler returns void." >&4
10960 *) echo "As you already told me, signal handler returns int." >&4
10967 case "$d_voidsig" in
10968 "$define") signal_t="void";;
10969 *) signal_t="int";;
10973 : check for ability to cast large floats to 32-bit ints.
10975 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10976 if $test "$intsize" -ge 4; then
10983 #$i_stdlib I_STDLIB
10985 #include <stdlib.h>
10987 #include <sys/types.h>
10988 #include <signal.h>
10989 $signal_t blech(int s) { exit(3); }
10996 signal(SIGFPE, blech);
10998 /* Don't let compiler optimize the test away. Store the number
10999 in a writable string for gcc to pass to sscanf under HP-UX.
11001 sprintf(str, "2147483647");
11002 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11006 /* x86 processors will probably give 0x8000 0000, which is a
11007 sign change. We don't want that. We want to mimic SPARC
11008 behavior here, which is to preserve the sign and give
11011 if (i32 != ($xxx) f)
11017 if eval $compile_ok; then
11021 echo "(I can't seem to compile the test program--assuming it can't)"
11026 echo "Yup, it can."
11029 echo "Nope, it can't."
11036 : check for ability to cast negative floats to unsigned
11038 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11041 #$i_stdlib I_STDLIB
11043 #include <stdlib.h>
11045 #include <sys/types.h>
11046 #include <signal.h>
11047 $signal_t blech(int s) { exit(7); }
11048 $signal_t blech_in_list(int s) { exit(4); }
11049 unsigned long dummy_long(unsigned long p) { return p; }
11050 unsigned int dummy_int(unsigned int p) { return p; }
11051 unsigned short dummy_short(unsigned short p) { return p; }
11055 unsigned long along;
11057 unsigned short ashort;
11061 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11062 a direct f = -123. assignment. gcc-2.8.0 reportedly
11063 optimized the whole file away
11065 /* Store the number in a writable string for gcc to pass to
11066 sscanf under HP-UX.
11068 sprintf(str, "-123");
11069 sscanf(str, "%lf", &f); /* f = -123.; */
11071 signal(SIGFPE, blech);
11072 along = (unsigned long)f;
11073 aint = (unsigned int)f;
11074 ashort = (unsigned short)f;
11075 if (along != (unsigned long)-123)
11077 if (aint != (unsigned int)-123)
11079 if (ashort != (unsigned short)-123)
11081 sprintf(str, "1073741824.");
11082 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11085 along = (unsigned long)f;
11086 if (along != 0x80000000)
11090 along = (unsigned long)f;
11091 if (along != 0x7fffffff)
11095 along = (unsigned long)f;
11096 if (along != 0x80000001)
11100 signal(SIGFPE, blech_in_list);
11101 sprintf(str, "123.");
11102 sscanf(str, "%lf", &f); /* f = 123.; */
11103 along = dummy_long((unsigned long)f);
11104 aint = dummy_int((unsigned int)f);
11105 ashort = dummy_short((unsigned short)f);
11106 if (along != (unsigned long)123)
11108 if (aint != (unsigned int)123)
11110 if (ashort != (unsigned short)123)
11117 if eval $compile_ok; then
11121 echo "(I can't seem to compile the test program--assuming it can't)"
11124 case "$castflags" in
11126 echo "Yup, it can."
11129 echo "Nope, it can't."
11136 : see if vprintf exists
11138 if set vprintf val -f d_vprintf; eval $csym; $val; then
11139 echo 'vprintf() found.' >&4
11142 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11143 #$i_varargs I_VARARGS
11145 #$i_stdlib I_STDLIB
11146 #$i_unistd I_UNISTD
11149 # include <stdarg.h>
11150 #else /* I_VARARGS */
11151 # include <varargs.h>
11155 # include <unistd.h>
11159 # include <stdlib.h>
11162 #include <stdio.h> /* vsprintf prototype */
11165 void xxx(int n, ...)
11170 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11172 int main() { xxx(1, "foo"); }
11174 #else /* I_VARARGS */
11182 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11184 int main() { xxx("foo"); }
11190 if eval $compile_ok; then
11191 if $run ./try; then
11192 echo "Your vsprintf() returns (int)." >&4
11195 echo "Your vsprintf() returns (char*)." >&4
11199 echo 'I am unable to compile the vsprintf() test program.' >&4
11200 # We shouldn't get here. If we do, assume the standard signature,
11201 # not the old BSD one.
11202 echo 'Guessing that vsprintf() returns (int).' >&4
11206 echo 'vprintf() NOT found.' >&4
11217 : see if chown exists
11221 : see if chroot exists
11222 set chroot d_chroot
11225 : see if chsize exists
11226 set chsize d_chsize
11229 : see if class exists
11233 : see if clearenv exists
11234 set clearenv d_clearenv
11237 : Define hasstruct macro for Configure internal use
11238 hasstruct='varname=$1; struct=$2; shift; shift;
11239 while $test $# -ge 2; do
11241 $define) echo "#include <$2>";;
11245 echo "int main () { struct $struct foo; }" >> try.c;
11247 if eval $compile; then
11256 : see whether socket exists
11260 $echo $n "Hmm... $c" >&4
11261 if set socket val -f d_socket; eval $csym; $val; then
11262 echo "Looks like you have Berkeley networking support." >&4
11264 if set setsockopt val -f; eval $csym; $val; then
11267 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11268 d_oldsock="$define"
11271 if $contains socklib libc.list >/dev/null 2>&1; then
11272 echo "Looks like you have Berkeley networking support." >&4
11274 : we will have to assume that it supports the 4.2 BSD interface
11277 echo "You don't have Berkeley networking in libc$_a..." >&4
11278 if test "X$d_socket" = "X$define"; then
11279 echo "...but you seem to believe that you have sockets." >&4
11281 for net in net socket
11283 if test -f /usr/lib/lib$net$_a; then
11284 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11285 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11286 if $contains socket libc.list >/dev/null 2>&1; then
11291 echo "...but the Wollongong group seems to have hacked it in." >&4
11292 sockethdr="-I/usr/netinclude"
11295 echo "Found Berkeley sockets interface in lib$net." >&4
11296 if $contains setsockopt libc.list >/dev/null 2>&1; then
11299 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11300 d_oldsock="$define"
11306 if test "X$d_socket" != "X$define"; then
11307 echo "or anywhere else I see." >&4
11315 : see if socketpair exists
11316 set socketpair d_sockpair
11321 echo "Checking the availability sa_len in the sock struct ..." >&4
11323 #include <sys/types.h>
11324 #include <sys/socket.h>
11326 struct sockaddr sa;
11327 return (sa.sa_len);
11331 set try; if eval $compile; then
11334 set d_sockaddr_sa_len; eval $setvar
11338 echo "Checking the availability struct sockaddr_in6 ..." >&4
11340 #include <sys/types.h>
11341 #include <sys/socket.h>
11342 #include <netinet/in.h>
11344 struct sockaddr_in6 sin6;
11345 return (sin6.sin6_family);
11349 set try; if eval $compile; then
11352 set d_sockaddr_in6; eval $setvar
11356 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11358 #include <sys/types.h>
11359 #include <sys/socket.h>
11360 #include <netinet/in.h>
11362 struct sockaddr_in6 sin6;
11363 return (sin6.sin6_scope_id);
11367 set try; if eval $compile; then
11370 set d_sin6_scope_id; eval $setvar
11374 echo "Checking the availability struct ipv6_mreq ..." >&4
11376 #include <sys/types.h>
11377 #include <sys/socket.h>
11378 #include <netinet/in.h>
11380 struct ipv6_mreq mreq;
11381 return (mreq.ipv6mr_interface);
11385 set try; if eval $compile; then
11388 set d_ipv6_mreq; eval $setvar
11392 echo "Checking the availability of certain socket constants..." >&4
11393 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11394 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11396 #include <sys/types.h>
11397 #include <sys/socket.h>
11403 set try; if eval $compile; then
11406 set d_${enum}; eval $setvar
11410 : see if this is a sys/uio.h system
11411 set sys/uio.h i_sysuio
11414 : Check for cmsghdr support
11416 echo "Checking to see if your system supports struct cmsghdr..." >&4
11417 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11419 case "$d_cmsghdr_s" in
11420 "$define") echo "Yes, it does." ;;
11421 *) echo "No, it doesn't." ;;
11425 : check for const keyword
11427 echo 'Checking to see if your C compiler knows about "const"...' >&4
11428 $cat >const.c <<'EOCP'
11429 typedef struct spug { int drokk; } spug;
11433 const spug y = { 0 };
11436 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11438 echo "Yup, it does."
11441 echo "Nope, it doesn't."
11446 : see if copysignl exists
11447 set copysignl d_copysignl
11450 : see if crypt exists
11455 $define) cryptlib='' ;;
11456 *) if set crypt val -f d_crypt; eval $csym; $val; then
11457 echo 'crypt() found.' >&4
11461 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11462 if $test -z "$cryptlib"; then
11463 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11467 if $test -z "$cryptlib"; then
11468 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11472 if $test -z "$cryptlib"; then
11473 cryptlib=`./loc libcrypt$_a "" $libpth`
11477 if $test -z "$cryptlib"; then
11478 echo 'crypt() NOT found.' >&4
11489 : see if this is a crypt.h system
11490 set crypt.h i_crypt
11493 : see if crypt_r exists
11494 set crypt_r d_crypt_r
11496 case "$d_crypt_r" in
11498 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11499 case "$d_crypt_r_proto:$usethreads" in
11500 ":define") d_crypt_r_proto=define
11501 set d_crypt_r_proto crypt_r $hdrs
11505 case "$d_crypt_r_proto" in
11507 case "$crypt_r_proto" in
11508 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11509 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11511 case "$crypt_r_proto" in
11512 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11513 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11515 case "$crypt_r_proto" in
11516 ''|0) d_crypt_r=undef
11518 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11519 * ) case "$crypt_r_proto" in
11520 REENTRANT_PROTO*) ;;
11521 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11523 echo "Prototype: $try" ;;
11526 *) case "$usethreads" in
11527 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11538 : get csh whereabouts
11540 'csh') val="$undef" ;;
11541 *) val="$define" ;;
11545 : Respect a hint or command line value for full_csh.
11546 case "$full_csh" in
11547 '') full_csh=$csh ;;
11550 : see if ctermid exists
11551 set ctermid d_ctermid
11554 : see if ctermid_r exists
11555 set ctermid_r d_ctermid_r
11557 case "$d_ctermid_r" in
11559 hdrs="$i_systypes sys/types.h define stdio.h "
11560 case "$d_ctermid_r_proto:$usethreads" in
11561 ":define") d_ctermid_r_proto=define
11562 set d_ctermid_r_proto ctermid_r $hdrs
11566 case "$d_ctermid_r_proto" in
11568 case "$ctermid_r_proto" in
11569 ''|0) try='char* ctermid_r(char*);'
11570 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11572 case "$ctermid_r_proto" in
11573 ''|0) d_ctermid_r=undef
11575 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11576 * ) case "$ctermid_r_proto" in
11577 REENTRANT_PROTO*) ;;
11578 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11580 echo "Prototype: $try" ;;
11583 *) case "$usethreads" in
11584 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11591 *) ctermid_r_proto=0
11595 : see if ctime_r exists
11596 set ctime_r d_ctime_r
11598 case "$d_ctime_r" in
11600 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11601 case "$d_ctime_r_proto:$usethreads" in
11602 ":define") d_ctime_r_proto=define
11603 set d_ctime_r_proto ctime_r $hdrs
11607 case "$d_ctime_r_proto" in
11609 case "$ctime_r_proto" in
11610 ''|0) try='char* ctime_r(const time_t*, char*);'
11611 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11613 case "$ctime_r_proto" in
11614 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11615 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11617 case "$ctime_r_proto" in
11618 ''|0) try='int ctime_r(const time_t*, char*);'
11619 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11621 case "$ctime_r_proto" in
11622 ''|0) try='int ctime_r(const time_t*, char*, int);'
11623 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11625 case "$ctime_r_proto" in
11626 ''|0) d_ctime_r=undef
11628 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11629 * ) case "$ctime_r_proto" in
11630 REENTRANT_PROTO*) ;;
11631 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11633 echo "Prototype: $try" ;;
11636 *) case "$usethreads" in
11637 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11648 : see if cuserid exists
11649 set cuserid d_cuserid
11652 : see if this is a limits.h system
11653 set limits.h i_limits
11656 : see if this is a float.h system
11657 set float.h i_float
11660 : See if number of significant digits in a double precision number is known
11662 $cat >dbl_dig.c <<EOM
11663 #$i_limits I_LIMITS
11666 #include <limits.h>
11672 printf("Contains DBL_DIG");
11675 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11676 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11677 echo "DBL_DIG found." >&4
11680 echo "DBL_DIG NOT found." >&4
11687 : see if dbm.h is available
11688 : see if dbmclose exists
11689 set dbmclose d_dbmclose
11692 case "$d_dbmclose" in
11702 *) set rpcsvc/dbm.h i_rpcsvcdbm
11707 *) echo "We won't be including <dbm.h>"
11717 : see if prototype for dbminit is available
11719 set d_dbminitproto dbminit $i_dbm dbm.h
11722 : see if difftime exists
11723 set difftime d_difftime
11726 : see if this is a dirent system
11728 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11730 echo "<dirent.h> found." >&4
11733 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11734 echo "<sys/dir.h> found." >&4
11737 xinc=`./findhdr sys/ndir.h`
11739 echo "<dirent.h> NOT found." >&4
11744 : Look for type of directory structure.
11746 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11748 case "$direntrytype" in
11750 case "$i_dirent" in
11751 $define) guess1='struct dirent' ;;
11752 *) guess1='struct direct' ;;
11755 *) guess1="$direntrytype"
11760 'struct dirent') guess2='struct direct' ;;
11761 *) guess2='struct dirent' ;;
11764 if $contains "$guess1" try.c >/dev/null 2>&1; then
11765 direntrytype="$guess1"
11766 echo "Your directory entries are $direntrytype." >&4
11767 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11768 direntrytype="$guess2"
11769 echo "Your directory entries seem to be $direntrytype." >&4
11771 echo "I don't recognize your system's directory entries." >&4
11772 rp="What type is used for directory entries on this system?"
11775 direntrytype="$ans"
11779 : see if the directory entry stores field length
11781 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11782 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11783 echo "Good, your directory entry keeps length information in d_namlen." >&4
11786 echo "Your directory entry does not know about the d_namlen field." >&4
11793 : Look for DIR.dd_fd
11794 case "$i_dirent" in
11796 echo "Checking to see if DIR has a dd_fd member variable" >&4
11798 #$i_stdlib I_STDLIB
11800 #include <stdlib.h>
11802 #include <dirent.h>
11812 if eval $compile; then
11813 echo "Yes, it does."
11816 echo "No, it does not."
11821 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11829 : see if this is an sysdir system
11830 set sys/dir.h i_sysdir
11833 : see if this is an sysndir system
11834 set sys/ndir.h i_sysndir
11839 $cat >dirfd.c <<EOM
11841 #$i_stdlib I_STDLIB
11843 #include <stdlib.h>
11845 #$i_dirent I_DIRENT /**/
11846 #$i_sysdir I_SYS_DIR /**/
11847 #$i_sysndir I_SYS_NDIR /**/
11848 #$i_systypes I_SYS_TYPES /**/
11849 #if defined(I_SYS_TYPES)
11850 #include <sys/types.h>
11852 #if defined(I_DIRENT)
11853 #include <dirent.h>
11854 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11855 #include <sys/dir.h>
11859 #include <sys/ndir.h>
11863 #include <ndir.h> /* may be wrong in the future */
11865 #include <sys/dir.h>
11871 DIR *dirp = opendir(".");
11872 if (dirfd(dirp) >= 0)
11880 if eval $compile; then
11884 $define) echo "dirfd() found." >&4 ;;
11885 *) echo "dirfd() NOT found." >&4 ;;
11891 : see if dlerror exists
11894 set dlerror d_dlerror
11898 : see if dlfcn is available
11899 set dlfcn.h i_dlfcn
11902 : Check what extension to use for shared libs
11907 On a few systems, the dynamically loaded modules that perl generates and uses
11908 will need a different extension than shared libs. The default will probably
11914 *) dflt="$dlext" ;;
11916 rp='What is the extension of dynamically loaded modules'
11925 : Check if dlsym need a leading underscore
11931 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11932 $cat >dyna.c <<'EOM'
11939 #$i_stdlib I_STDLIB
11941 #include <stdlib.h>
11945 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11947 #include <sys/types.h>
11952 extern int fred() ;
11961 int mode = RTLD_LAZY ;
11963 handle = dlopen("./dyna.$dlext", mode) ;
11964 if (handle == NULL) {
11969 symbol = dlsym(handle, "fred") ;
11970 if (symbol == NULL) {
11971 /* try putting a leading underscore */
11972 symbol = dlsym(handle, "_fred") ;
11973 if (symbol == NULL) {
11986 : Call the object file tmp-dyna.o in case dlext=o.
11987 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11988 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11989 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11990 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11993 1) echo "Test program failed using dlopen." >&4
11994 echo "Perhaps you should not use dynamic loading." >&4;;
11995 2) echo "Test program failed using dlsym." >&4
11996 echo "Perhaps you should not use dynamic loading." >&4;;
11997 3) echo "dlsym needs a leading underscore" >&4
11999 4) echo "dlsym doesn't need a leading underscore." >&4;;
12002 echo "I can't compile and run the test program." >&4
12003 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12008 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12013 : see if drand48_r exists
12014 set drand48_r d_drand48_r
12016 case "$d_drand48_r" in
12018 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12019 case "$d_drand48_r_proto:$usethreads" in
12020 ":define") d_drand48_r_proto=define
12021 set d_drand48_r_proto drand48_r $hdrs
12025 case "$d_drand48_r_proto" in
12027 case "$drand48_r_proto" in
12028 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12029 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12031 case "$drand48_r_proto" in
12032 ''|0) d_drand48_r=undef
12034 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12035 * ) case "$drand48_r_proto" in
12036 REENTRANT_PROTO*) ;;
12037 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12039 echo "Prototype: $try" ;;
12042 *) case "$usethreads" in
12043 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12050 *) drand48_r_proto=0
12054 : see if prototype for drand48 is available
12056 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12059 : see if dup2 exists
12063 : see if eaccess exists
12064 set eaccess d_eaccess
12067 : see if endgrent exists
12068 set endgrent d_endgrent
12071 : see if this is an grp system
12077 xxx=`./findhdr grp.h`
12078 $cppstdin $cppflags $cppminus < $xxx >$$.h
12080 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12092 set d_grpasswd; eval $setvar
12096 : see if endgrent_r exists
12097 set endgrent_r d_endgrent_r
12099 case "$d_endgrent_r" in
12101 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12102 case "$d_endgrent_r_proto:$usethreads" in
12103 ":define") d_endgrent_r_proto=define
12104 set d_endgrent_r_proto endgrent_r $hdrs
12108 case "$d_endgrent_r_proto" in
12110 case "$endgrent_r_proto" in
12111 ''|0) try='int endgrent_r(FILE**);'
12112 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12114 case "$endgrent_r_proto" in
12115 ''|0) try='void endgrent_r(FILE**);'
12116 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12118 case "$endgrent_r_proto" in
12119 ''|0) d_endgrent_r=undef
12121 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12122 * ) case "$endgrent_r_proto" in
12123 REENTRANT_PROTO*) ;;
12124 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12126 echo "Prototype: $try" ;;
12129 *) case "$usethreads" in
12130 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12137 *) endgrent_r_proto=0
12141 : see if endhostent exists
12142 set endhostent d_endhent
12145 : see if this is a netdb.h system
12146 set netdb.h i_netdb
12149 : see if endhostent_r exists
12150 set endhostent_r d_endhostent_r
12152 case "$d_endhostent_r" in
12154 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12155 case "$d_endhostent_r_proto:$usethreads" in
12156 ":define") d_endhostent_r_proto=define
12157 set d_endhostent_r_proto endhostent_r $hdrs
12161 case "$d_endhostent_r_proto" in
12163 case "$endhostent_r_proto" in
12164 ''|0) try='int endhostent_r(struct hostent_data*);'
12165 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12167 case "$endhostent_r_proto" in
12168 ''|0) try='void endhostent_r(struct hostent_data*);'
12169 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12171 case "$endhostent_r_proto" in
12172 ''|0) d_endhostent_r=undef
12173 endhostent_r_proto=0
12174 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12175 * ) case "$endhostent_r_proto" in
12176 REENTRANT_PROTO*) ;;
12177 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12179 echo "Prototype: $try" ;;
12182 *) case "$usethreads" in
12183 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12185 d_endhostent_r=undef
12186 endhostent_r_proto=0
12190 *) endhostent_r_proto=0
12194 : see if endnetent exists
12195 set endnetent d_endnent
12198 : see if endnetent_r exists
12199 set endnetent_r d_endnetent_r
12201 case "$d_endnetent_r" in
12203 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12204 case "$d_endnetent_r_proto:$usethreads" in
12205 ":define") d_endnetent_r_proto=define
12206 set d_endnetent_r_proto endnetent_r $hdrs
12210 case "$d_endnetent_r_proto" in
12212 case "$endnetent_r_proto" in
12213 ''|0) try='int endnetent_r(struct netent_data*);'
12214 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12216 case "$endnetent_r_proto" in
12217 ''|0) try='void endnetent_r(struct netent_data*);'
12218 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12220 case "$endnetent_r_proto" in
12221 ''|0) d_endnetent_r=undef
12222 endnetent_r_proto=0
12223 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12224 * ) case "$endnetent_r_proto" in
12225 REENTRANT_PROTO*) ;;
12226 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12228 echo "Prototype: $try" ;;
12231 *) case "$usethreads" in
12232 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12234 d_endnetent_r=undef
12235 endnetent_r_proto=0
12239 *) endnetent_r_proto=0
12243 : see if endprotoent exists
12244 set endprotoent d_endpent
12247 : see if endprotoent_r exists
12248 set endprotoent_r d_endprotoent_r
12250 case "$d_endprotoent_r" in
12252 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12253 case "$d_endprotoent_r_proto:$usethreads" in
12254 ":define") d_endprotoent_r_proto=define
12255 set d_endprotoent_r_proto endprotoent_r $hdrs
12259 case "$d_endprotoent_r_proto" in
12261 case "$endprotoent_r_proto" in
12262 ''|0) try='int endprotoent_r(struct protoent_data*);'
12263 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12265 case "$endprotoent_r_proto" in
12266 ''|0) try='void endprotoent_r(struct protoent_data*);'
12267 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12269 case "$endprotoent_r_proto" in
12270 ''|0) d_endprotoent_r=undef
12271 endprotoent_r_proto=0
12272 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12273 * ) case "$endprotoent_r_proto" in
12274 REENTRANT_PROTO*) ;;
12275 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12277 echo "Prototype: $try" ;;
12280 *) case "$usethreads" in
12281 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12283 d_endprotoent_r=undef
12284 endprotoent_r_proto=0
12288 *) endprotoent_r_proto=0
12292 : see if endpwent exists
12293 set endpwent d_endpwent
12296 : see if this is a pwd.h system
12302 xxx=`./findhdr pwd.h`
12303 $cppstdin $cppflags $cppminus < $xxx >$$.h
12305 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12313 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12321 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12329 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12337 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12345 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12353 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12361 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12373 set d_pwquota; eval $setvar
12374 set d_pwage; eval $setvar
12375 set d_pwchange; eval $setvar
12376 set d_pwclass; eval $setvar
12377 set d_pwexpire; eval $setvar
12378 set d_pwcomment; eval $setvar
12379 set d_pwgecos; eval $setvar
12380 set d_pwpasswd; eval $setvar
12384 : see if endpwent_r exists
12385 set endpwent_r d_endpwent_r
12387 case "$d_endpwent_r" in
12389 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12390 case "$d_endpwent_r_proto:$usethreads" in
12391 ":define") d_endpwent_r_proto=define
12392 set d_endpwent_r_proto endpwent_r $hdrs
12396 case "$d_endpwent_r_proto" in
12398 case "$endpwent_r_proto" in
12399 ''|0) try='int endpwent_r(FILE**);'
12400 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12402 case "$endpwent_r_proto" in
12403 ''|0) try='void endpwent_r(FILE**);'
12404 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12406 case "$endpwent_r_proto" in
12407 ''|0) d_endpwent_r=undef
12409 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12410 * ) case "$endpwent_r_proto" in
12411 REENTRANT_PROTO*) ;;
12412 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12414 echo "Prototype: $try" ;;
12417 *) case "$usethreads" in
12418 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12425 *) endpwent_r_proto=0
12429 : see if endservent exists
12430 set endservent d_endsent
12433 : see if endservent_r exists
12434 set endservent_r d_endservent_r
12436 case "$d_endservent_r" in
12438 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12439 case "$d_endservent_r_proto:$usethreads" in
12440 ":define") d_endservent_r_proto=define
12441 set d_endservent_r_proto endservent_r $hdrs
12445 case "$d_endservent_r_proto" in
12447 case "$endservent_r_proto" in
12448 ''|0) try='int endservent_r(struct servent_data*);'
12449 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12451 case "$endservent_r_proto" in
12452 ''|0) try='void endservent_r(struct servent_data*);'
12453 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12455 case "$endservent_r_proto" in
12456 ''|0) d_endservent_r=undef
12457 endservent_r_proto=0
12458 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12459 * ) case "$endservent_r_proto" in
12460 REENTRANT_PROTO*) ;;
12461 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12463 echo "Prototype: $try" ;;
12466 *) case "$usethreads" in
12467 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12469 d_endservent_r=undef
12470 endservent_r_proto=0
12474 *) endservent_r_proto=0
12478 : Locate the flags for 'open()'
12481 #include <sys/types.h>
12486 #include <sys/file.h>
12488 #$i_stdlib I_STDLIB
12490 #include <stdlib.h>
12501 : check sys/file.h first to get FREAD on Sun
12502 if $test `./findhdr sys/file.h` && \
12503 set try -DI_SYS_FILE && eval $compile; then
12505 echo "<sys/file.h> defines the O_* constants..." >&4
12506 if $run ./try; then
12507 echo "and you have the 3 argument form of open()." >&4
12510 echo "but not the 3 argument form of open(). Oh, well." >&4
12513 elif $test `./findhdr fcntl.h` && \
12514 set try -DI_FCNTL && eval $compile; then
12516 echo "<fcntl.h> defines the O_* constants..." >&4
12517 if $run ./try; then
12518 echo "and you have the 3 argument form of open()." >&4
12521 echo "but not the 3 argument form of open(). Oh, well." >&4
12526 echo "I can't find the O_* constant definitions! You got problems." >&4
12532 : see if this is a sys/file.h system
12537 : do we need to include sys/file.h ?
12541 if $h_sysfile; then
12543 echo "We'll be including <sys/file.h>." >&4
12546 echo "We won't be including <sys/file.h>." >&4
12556 : see if fcntl.h is there
12561 : see if we can include fcntl.h
12567 echo "We'll be including <fcntl.h>." >&4
12570 if $h_sysfile; then
12571 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12573 echo "We won't be including <fcntl.h>." >&4
12585 : see if fork exists
12589 : see if pipe exists
12593 : check for non-blocking I/O stuff
12594 case "$h_sysfile" in
12595 true) echo "#include <sys/file.h>" > head.c;;
12598 true) echo "#include <fcntl.h>" > head.c;;
12599 *) echo "#include <sys/fcntl.h>" > head.c;;
12604 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12605 case "$o_nonblock" in
12607 $cat head.c > try.c
12608 $cat >>try.c <<EOCP
12610 #$i_stdlib I_STDLIB
12612 #include <stdlib.h>
12620 printf("O_NONBLOCK\n");
12624 printf("O_NDELAY\n");
12628 printf("FNDELAY\n");
12635 if eval $compile_ok; then
12636 o_nonblock=`$run ./try`
12637 case "$o_nonblock" in
12638 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12639 *) echo "Seems like we can use $o_nonblock.";;
12642 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12645 *) echo "Using $hint value $o_nonblock.";;
12650 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12653 case "$d_fork:$d_pipe" in
12655 $cat head.c > try.c
12656 $cat >>try.c <<EOCP
12658 #include <sys/types.h>
12659 #include <signal.h>
12661 #$i_stdlib I_STDLIB
12663 #include <stdlib.h>
12669 #define MY_O_NONBLOCK $o_nonblock
12670 #ifndef errno /* XXX need better Configure test */
12673 #$i_unistd I_UNISTD
12675 #include <unistd.h>
12677 #$i_string I_STRING
12679 #include <string.h>
12681 #include <strings.h>
12683 $signal_t blech(int x) { exit(3); }
12685 $cat >> try.c <<'EOCP'
12693 pipe(pd); /* Down: child -> parent */
12694 pipe(pu); /* Up: parent -> child */
12697 close(pd[1]); /* Parent reads from pd[0] */
12698 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12700 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12705 signal(SIGALRM, blech);
12707 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12709 sprintf(string, "%d\n", ret);
12710 write(2, string, strlen(string));
12713 if (errno == EAGAIN) {
12714 printf("EAGAIN\n");
12719 if (errno == EWOULDBLOCK)
12720 printf("EWOULDBLOCK\n");
12723 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12724 sleep(2); /* Give it time to close our pipe */
12726 ret = read(pd[0], buf, 1); /* Should read EOF */
12728 sprintf(string, "%d\n", ret);
12729 write(4, string, strlen(string));
12733 close(pd[0]); /* We write to pd[1] */
12734 close(pu[1]); /* We read from pu[0] */
12735 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12736 close(pd[1]); /* Pipe pd is now fully closed! */
12737 exit(0); /* Bye bye, thank you for playing! */
12741 if eval $compile_ok; then
12742 echo "$startsh" >mtry
12743 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12745 ./mtry >/dev/null 2>&1
12747 0) eagain=`$cat try.out`;;
12748 1) echo "Could not perform non-blocking setting!";;
12749 2) echo "I did a successful read() for something that was not there!";;
12750 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12751 4) echo "Could not find F_SETFL!";;
12752 *) echo "Something terribly wrong happened during testing.";;
12754 rd_nodata=`$cat try.ret`
12755 echo "A read() system call with no data present returns $rd_nodata."
12756 case "$rd_nodata" in
12759 echo "(That's peculiar, fixing that to be -1.)"
12765 echo "Forcing errno EAGAIN on read() with no data available."
12769 echo "Your read() sets errno to $eagain when no data is available."
12772 status=`$cat try.err`
12774 0) echo "And it correctly returns 0 to signal EOF.";;
12775 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12776 *) echo "However, your read() returns '$status' on EOF??";;
12779 if test "$status" = "$rd_nodata"; then
12780 echo "WARNING: you can't distinguish between EOF and no data!"
12784 echo "I can't compile the test program--assuming errno EAGAIN will do."
12788 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12797 echo "Using $hint value $eagain."
12798 echo "Your read() returns $rd_nodata when no data is present."
12799 case "$d_eofnblk" in
12800 "$define") echo "And you can see EOF because read() returns 0.";;
12801 "$undef") echo "But you can't see EOF status from read() returned value.";;
12803 echo "(Assuming you can't see EOF status from read anyway.)"
12809 $rm_try head.c mtry
12811 : see if _ptr and _cnt from stdio act std
12814 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12815 echo "(Looks like you have stdio.h from BSD.)"
12816 case "$stdio_ptr" in
12817 '') stdio_ptr='((fp)->_p)'
12820 *) ptr_lval=$d_stdio_ptr_lval;;
12822 case "$stdio_cnt" in
12823 '') stdio_cnt='((fp)->_r)'
12826 *) cnt_lval=$d_stdio_cnt_lval;;
12828 case "$stdio_base" in
12829 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12831 case "$stdio_bufsiz" in
12832 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12834 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12835 echo "(Looks like you have stdio.h from Linux.)"
12836 case "$stdio_ptr" in
12837 '') stdio_ptr='((fp)->_IO_read_ptr)'
12840 *) ptr_lval=$d_stdio_ptr_lval;;
12842 case "$stdio_cnt" in
12843 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12846 *) cnt_lval=$d_stdio_cnt_lval;;
12848 case "$stdio_base" in
12849 '') stdio_base='((fp)->_IO_read_base)';;
12851 case "$stdio_bufsiz" in
12852 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12855 case "$stdio_ptr" in
12856 '') stdio_ptr='((fp)->_ptr)'
12859 *) ptr_lval=$d_stdio_ptr_lval;;
12861 case "$stdio_cnt" in
12862 '') stdio_cnt='((fp)->_cnt)'
12865 *) cnt_lval=$d_stdio_cnt_lval;;
12867 case "$stdio_base" in
12868 '') stdio_base='((fp)->_base)';;
12870 case "$stdio_bufsiz" in
12871 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12875 : test whether _ptr and _cnt really work
12876 echo "Checking how std your stdio is..." >&4
12879 #$i_stdlib I_STDLIB
12881 #include <stdlib.h>
12883 #define FILE_ptr(fp) $stdio_ptr
12884 #define FILE_cnt(fp) $stdio_cnt
12886 FILE *fp = fopen("try.c", "r");
12889 18 <= FILE_cnt(fp) &&
12890 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12898 if eval $compile && $to try.c; then
12899 if $run ./try; then
12900 echo "Your stdio acts pretty std."
12903 echo "Your stdio isn't very std."
12906 echo "Your stdio doesn't appear very std."
12910 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12911 # direct buffer manipulation no longer works. The Configure tests
12912 # should be changed to correctly detect this, but until then,
12913 # the following check should at least let perl compile and run.
12914 # (This quick fix should be updated before 5.8.1.)
12915 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12916 # A. Dougherty, June 3, 2002.
12917 case "$d_gnulibc" in
12919 case "$gnulibc_version" in
12923 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12932 : Can _ptr be used as an lvalue?
12933 case "$d_stdstdio$ptr_lval" in
12934 $define$define) val=$define ;;
12937 set d_stdio_ptr_lval
12940 : Can _cnt be used as an lvalue?
12941 case "$d_stdstdio$cnt_lval" in
12942 $define$define) val=$define ;;
12945 set d_stdio_cnt_lval
12949 : test whether setting _ptr sets _cnt as a side effect
12950 d_stdio_ptr_lval_sets_cnt="$undef"
12951 d_stdio_ptr_lval_nochange_cnt="$undef"
12952 case "$d_stdio_ptr_lval$d_stdstdio" in
12954 echo "Checking to see what happens if we set the stdio ptr..." >&4
12957 /* Can we scream? */
12958 /* Eat dust sed :-) */
12959 /* In the buffer space, no one can hear you scream. */
12960 #$i_stdlib I_STDLIB
12962 #include <stdlib.h>
12964 #define FILE_ptr(fp) $stdio_ptr
12965 #define FILE_cnt(fp) $stdio_cnt
12966 #include <sys/types.h>
12968 FILE *fp = fopen("try.c", "r");
12973 puts("Fail even to read");
12976 c = getc(fp); /* Read away the first # */
12978 puts("Fail even to read");
12982 18 <= FILE_cnt(fp) &&
12983 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12985 puts("Fail even to read");
12988 ptr = (char*) FILE_ptr(fp);
12989 cnt = (size_t)FILE_cnt(fp);
12991 FILE_ptr(fp) += 42;
12993 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12994 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12997 if (FILE_cnt(fp) <= 20) {
12998 printf ("Fail (<20 chars to test)");
13001 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13002 puts("Fail compare");
13005 if (cnt == FILE_cnt(fp)) {
13006 puts("Pass_unchanged");
13009 if (FILE_cnt(fp) == (cnt - 42)) {
13010 puts("Pass_changed");
13013 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13019 if eval $compile && $to try.c; then
13020 case `$run ./try` in
13022 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13023 d_stdio_ptr_lval_sets_cnt="$define" ;;
13025 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13026 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13028 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13030 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13033 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13039 : see if _base is also standard
13041 case "$d_stdstdio" in
13045 #$i_stdlib I_STDLIB
13047 #include <stdlib.h>
13049 #define FILE_base(fp) $stdio_base
13050 #define FILE_bufsiz(fp) $stdio_bufsiz
13052 FILE *fp = fopen("try.c", "r");
13055 19 <= FILE_bufsiz(fp) &&
13056 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13063 if eval $compile && $to try.c; then
13064 if $run ./try; then
13065 echo "And its _base field acts std."
13068 echo "But its _base field isn't std."
13071 echo "However, it seems to be lacking the _base field."
13079 : see if fast_stdio exists
13081 case "$d_stdstdio:$d_stdio_ptr_lval" in
13083 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13085 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13096 : see if fchdir exists
13097 set fchdir d_fchdir
13100 : see if fchmod exists
13101 set fchmod d_fchmod
13104 : see if fchown exists
13105 set fchown d_fchown
13108 : see if this is an fcntl system
13112 : See if fcntl-based locking works.
13115 #$i_stdlib I_STDLIB
13117 #include <stdlib.h>
13119 #include <unistd.h>
13121 #include <signal.h>
13122 $signal_t blech(int x) { exit(3); }
13124 #if defined(F_SETLK) && defined(F_SETLKW)
13125 struct flock flock;
13127 fd = open("try.c", O_RDONLY);
13128 flock.l_type = F_RDLCK;
13129 flock.l_whence = SEEK_SET;
13130 flock.l_start = flock.l_len = 0;
13131 signal(SIGALRM, blech);
13133 retval = fcntl(fd, F_SETLK, &flock);
13135 (retval < 0 ? exit(2) : exit(0));
13141 echo "Checking if fcntl-based file locking works... "
13145 if eval $compile_ok; then
13146 if $run ./try; then
13147 echo "Yes, it seems to work."
13150 echo "Nope, it didn't work."
13155 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13156 *** This is (almost) impossible.
13157 *** If your NFS lock daemons are not feeling well, something like
13158 *** this may happen, please investigate. Cannot continue, aborting.
13166 echo "I'm unable to compile the test program, so I'll assume not."
13171 echo "Nope, since you don't even have fcntl()."
13174 set d_fcntl_can_lock
13178 : check for fd_set items
13181 Checking to see how well your C compiler handles fd_set and friends ...
13184 #$i_stdlib I_STDLIB
13186 #include <stdlib.h>
13188 #$i_systime I_SYS_TIME
13189 #$i_sysselct I_SYS_SELECT
13190 #$d_socket HAS_SOCKET
13191 #include <sys/types.h>
13193 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13196 #include <sys/time.h>
13198 #ifdef I_SYS_SELECT
13199 #include <sys/select.h>
13208 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13216 if eval $compile; then
13217 d_fds_bits="$define"
13219 echo "Well, your system knows about the normal fd_set typedef..." >&4
13220 if $run ./try; then
13221 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13222 d_fd_macros="$define"
13225 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13227 d_fd_macros="$undef"
13231 Hmm, your compiler has some difficulty with fd_set. Checking further...
13234 if eval $compile; then
13235 d_fds_bits="$undef"
13237 echo "Well, your system has some sort of fd_set available..." >&4
13238 if $run ./try; then
13239 echo "and you have the normal fd_set macros." >&4
13240 d_fd_macros="$define"
13243 but not the normal fd_set macros! Gross! More work for me...
13245 d_fd_macros="$undef"
13248 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13250 d_fds_bits="$undef"
13251 d_fd_macros="$undef"
13256 : see if fgetpos exists
13257 set fgetpos d_fgetpos
13260 : see if finite exists
13261 set finite d_finite
13264 : see if finitel exists
13265 set finitel d_finitel
13268 : see if flock exists
13272 : see if prototype for flock is available
13274 set d_flockproto flock $i_sysfile sys/file.h
13277 : see if fp_class exists
13278 set fp_class d_fp_class
13281 : see if pathconf exists
13282 set pathconf d_pathconf
13285 : see if fpathconf exists
13286 set fpathconf d_fpathconf
13289 : see if fpclass exists
13290 set fpclass d_fpclass
13293 : see if fpclassify exists
13294 set fpclassify d_fpclassify
13297 : see if fpclassl exists
13298 set fpclassl d_fpclassl
13301 : check for fpos64_t
13303 echo "Checking to see if you have fpos64_t..." >&4
13306 int main() { fpos64_t x = 7; }
13309 if eval $compile; then
13311 echo "You have fpos64_t."
13314 echo "You do not have fpos64_t."
13315 case "$fpossize" in
13316 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13323 : see if frexpl exists
13324 set frexpl d_frexpl
13327 : see if this is a sys/param system
13328 set sys/param.h i_sysparam
13331 : see if this is a sys/mount.h system
13332 set sys/mount.h i_sysmount
13335 : Check for fs_data_s
13337 echo "Checking to see if your system supports struct fs_data..." >&4
13338 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13340 case "$d_fs_data_s" in
13341 "$define") echo "Yes, it does." ;;
13342 *) echo "No, it doesn't." ;;
13345 : see if fseeko exists
13346 set fseeko d_fseeko
13348 case "$longsize" in
13349 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13352 : see if fsetpos exists
13353 set fsetpos d_fsetpos
13356 : see if fstatfs exists
13357 set fstatfs d_fstatfs
13360 : see if statvfs exists
13361 set statvfs d_statvfs
13364 : see if fstatvfs exists
13365 set fstatvfs d_fstatvfs
13369 : see if fsync exists
13373 : see if ftello exists
13374 set ftello d_ftello
13376 case "$longsize" in
13377 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13380 : check for a working futimes
13383 echo "Checking if you have a working futimes()" >&4
13386 #include <sys/time.h>
13393 fd = open ("try.c", O_RDWR);
13394 if (-1 == fd) exit (1);
13395 rv = futimes (fd, NULL);
13396 exit (rv == -1 ? errno : 0);
13400 if eval $compile; then
13404 0) echo "Yes, you have" >&4
13405 d_futimes="$define"
13407 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13411 echo "No, it does not (probably harmless)" >&4
13415 : see if ndbm.h is available
13418 : Compatibility location for RedHat 7.1
13419 set gdbm/ndbm.h i_gdbmndbm
13421 : Compatibility location for Debian 4.0
13422 set gdbm-ndbm.h i_gdbm_ndbm
13426 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13427 : see if dbm_open exists
13428 set dbm_open d_dbm_open
13430 case "$d_dbm_open" in
13433 i_gdbmndbm="$undef"
13434 i_gdbm_ndbm="$undef"
13435 echo "We won't be including <ndbm.h>"
13445 ndbm_hdr_protochk='name=$1; hdr=$2;
13446 eval "ihdr=\$""i_$name";
13448 if $test "$ihdr" = "$define"; then
13449 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13450 case "$d_cplusplus" in
13451 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13452 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13455 $define) $echo "Your <$hdr> seems to have prototypes";;
13456 *) $echo "Your <$hdr> does not seem to have prototypes";;
13459 set "d_${name}_h_uses_prototypes";
13463 eval $ndbm_hdr_protochk
13464 set gdbmndbm gdbm/ndbm.h
13465 eval $ndbm_hdr_protochk
13466 set gdbm_ndbm gdbm-ndbm.h
13467 eval $ndbm_hdr_protochk
13469 : see if getaddrinfo exists
13470 set getaddrinfo d_getaddrinfo
13473 : see if getcwd exists
13474 set getcwd d_getcwd
13477 : see if getespwnam exists
13478 set getespwnam d_getespwnam
13481 : see if getfsstat exists
13482 set getfsstat d_getfsstat
13485 : see if getgrent exists
13486 set getgrent d_getgrent
13489 : see if getgrent_r exists
13490 set getgrent_r d_getgrent_r
13492 case "$d_getgrent_r" in
13494 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13495 case "$d_getgrent_r_proto:$usethreads" in
13496 ":define") d_getgrent_r_proto=define
13497 set d_getgrent_r_proto getgrent_r $hdrs
13501 case "$d_getgrent_r_proto" in
13503 case "$getgrent_r_proto" in
13504 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13505 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13507 case "$getgrent_r_proto" in
13508 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13509 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13511 case "$getgrent_r_proto" in
13512 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13513 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13515 case "$getgrent_r_proto" in
13516 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13517 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13519 case "$getgrent_r_proto" in
13520 ''|0) try='int getgrent_r(struct group*, char*, int);'
13521 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13523 case "$getgrent_r_proto" in
13524 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13525 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13527 case "$getgrent_r_proto" in
13528 ''|0) d_getgrent_r=undef
13530 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13531 * ) case "$getgrent_r_proto" in
13532 REENTRANT_PROTO*) ;;
13533 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13535 echo "Prototype: $try" ;;
13538 *) case "$usethreads" in
13539 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13546 *) getgrent_r_proto=0
13550 : see if getgrgid_r exists
13551 set getgrgid_r d_getgrgid_r
13553 case "$d_getgrgid_r" in
13555 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13556 case "$d_getgrgid_r_proto:$usethreads" in
13557 ":define") d_getgrgid_r_proto=define
13558 set d_getgrgid_r_proto getgrgid_r $hdrs
13562 case "$d_getgrgid_r_proto" in
13564 case "$getgrgid_r_proto" in
13565 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13566 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13568 case "$getgrgid_r_proto" in
13569 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13570 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13572 case "$getgrgid_r_proto" in
13573 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13574 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13576 case "$getgrgid_r_proto" in
13577 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13578 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13580 case "$getgrgid_r_proto" in
13581 ''|0) d_getgrgid_r=undef
13583 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13584 * ) case "$getgrgid_r_proto" in
13585 REENTRANT_PROTO*) ;;
13586 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13588 echo "Prototype: $try" ;;
13591 *) case "$usethreads" in
13592 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13599 *) getgrgid_r_proto=0
13603 : see if getgrnam_r exists
13604 set getgrnam_r d_getgrnam_r
13606 case "$d_getgrnam_r" in
13608 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13609 case "$d_getgrnam_r_proto:$usethreads" in
13610 ":define") d_getgrnam_r_proto=define
13611 set d_getgrnam_r_proto getgrnam_r $hdrs
13615 case "$d_getgrnam_r_proto" in
13617 case "$getgrnam_r_proto" in
13618 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13619 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13621 case "$getgrnam_r_proto" in
13622 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13623 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13625 case "$getgrnam_r_proto" in
13626 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13627 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13629 case "$getgrnam_r_proto" in
13630 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13631 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13633 case "$getgrnam_r_proto" in
13634 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13635 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13637 case "$getgrnam_r_proto" in
13638 ''|0) d_getgrnam_r=undef
13640 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getgrnam_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13645 echo "Prototype: $try" ;;
13648 *) case "$usethreads" in
13649 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13656 *) getgrnam_r_proto=0
13660 : see if gethostbyaddr exists
13661 set gethostbyaddr d_gethbyaddr
13664 : see if gethostbyname exists
13665 set gethostbyname d_gethbyname
13668 : see if gethostent exists
13669 set gethostent d_gethent
13672 : see how we will look up host name
13675 if set gethostname val -f d_gethname; eval $csym; $val; then
13676 echo 'gethostname() found.' >&4
13677 d_gethname="$define"
13680 if set uname val -f d_uname; eval $csym; $val; then
13683 uname() was found, but you're running xenix, and older versions of xenix
13684 have a broken uname(). If you don't really know whether your xenix is old
13685 enough to have a broken system call, use the default answer.
13690 "$define") dflt=n;;
13692 rp='Is your uname() broken?'
13695 n*) d_uname="$define"; call=uname;;
13698 echo 'uname() found.' >&4
13705 case "$d_gethname" in
13706 '') d_gethname="$undef";;
13709 '') d_uname="$undef";;
13711 case "$d_uname$d_gethname" in
13716 Every now and then someone has a $call() that lies about the hostname
13717 but can't be fixed for political or economic reasons. If you wish, I can
13718 pretend $call() isn't there and maybe compute hostname at run-time
13719 thanks to the '$phostname' command.
13722 rp="Shall I ignore $call() from now on?"
13725 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13728 case "$phostname" in
13729 '') aphostname='';;
13730 *) case "$aphostname" in
13732 *) set X $phostname
13736 file=`./loc $file $file $pth`
13737 aphostname=`echo $file $*`
13742 case "$d_uname$d_gethname" in
13745 case "$phostname" in
13747 echo "There will be no way for $package to get your hostname." >&4;;
13749 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13753 case "$d_phostname" in
13754 '') d_phostname="$undef";;
13757 : see if gethostbyaddr_r exists
13758 set gethostbyaddr_r d_gethostbyaddr_r
13760 case "$d_gethostbyaddr_r" in
13762 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13763 case "$d_gethostbyaddr_r_proto:$usethreads" in
13764 ":define") d_gethostbyaddr_r_proto=define
13765 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13769 case "$d_gethostbyaddr_r_proto" in
13771 case "$gethostbyaddr_r_proto" in
13772 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13773 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13775 case "$gethostbyaddr_r_proto" in
13776 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13777 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13779 case "$gethostbyaddr_r_proto" in
13780 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13781 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13783 case "$gethostbyaddr_r_proto" in
13784 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13785 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13787 case "$gethostbyaddr_r_proto" in
13788 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13789 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13791 case "$gethostbyaddr_r_proto" in
13792 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13793 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13795 case "$gethostbyaddr_r_proto" in
13796 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13797 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13799 case "$gethostbyaddr_r_proto" in
13800 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13801 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13803 case "$gethostbyaddr_r_proto" in
13804 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13805 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13807 case "$gethostbyaddr_r_proto" in
13808 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13809 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13811 case "$gethostbyaddr_r_proto" in
13812 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13813 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13815 case "$gethostbyaddr_r_proto" in
13816 ''|0) d_gethostbyaddr_r=undef
13817 gethostbyaddr_r_proto=0
13818 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13819 * ) case "$gethostbyaddr_r_proto" in
13820 REENTRANT_PROTO*) ;;
13821 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13823 echo "Prototype: $try" ;;
13826 *) case "$usethreads" in
13827 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13829 d_gethostbyaddr_r=undef
13830 gethostbyaddr_r_proto=0
13834 *) gethostbyaddr_r_proto=0
13838 : see if gethostbyname_r exists
13839 set gethostbyname_r d_gethostbyname_r
13841 case "$d_gethostbyname_r" in
13843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13844 case "$d_gethostbyname_r_proto:$usethreads" in
13845 ":define") d_gethostbyname_r_proto=define
13846 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13850 case "$d_gethostbyname_r_proto" in
13852 case "$gethostbyname_r_proto" in
13853 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13856 case "$gethostbyname_r_proto" in
13857 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13858 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13860 case "$gethostbyname_r_proto" in
13861 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13862 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13864 case "$gethostbyname_r_proto" in
13865 ''|0) d_gethostbyname_r=undef
13866 gethostbyname_r_proto=0
13867 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13868 * ) case "$gethostbyname_r_proto" in
13869 REENTRANT_PROTO*) ;;
13870 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13872 echo "Prototype: $try" ;;
13875 *) case "$usethreads" in
13876 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13878 d_gethostbyname_r=undef
13879 gethostbyname_r_proto=0
13883 *) gethostbyname_r_proto=0
13887 : see if gethostent_r exists
13888 set gethostent_r d_gethostent_r
13890 case "$d_gethostent_r" in
13892 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13893 case "$d_gethostent_r_proto:$usethreads" in
13894 ":define") d_gethostent_r_proto=define
13895 set d_gethostent_r_proto gethostent_r $hdrs
13899 case "$d_gethostent_r_proto" in
13901 case "$gethostent_r_proto" in
13902 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13903 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13905 case "$gethostent_r_proto" in
13906 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13907 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13909 case "$gethostent_r_proto" in
13910 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13911 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13913 case "$gethostent_r_proto" in
13914 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13915 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13917 case "$gethostent_r_proto" in
13918 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13919 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13921 case "$gethostent_r_proto" in
13922 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13923 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13925 case "$gethostent_r_proto" in
13926 ''|0) d_gethostent_r=undef
13927 gethostent_r_proto=0
13928 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13929 * ) case "$gethostent_r_proto" in
13930 REENTRANT_PROTO*) ;;
13931 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13933 echo "Prototype: $try" ;;
13936 *) case "$usethreads" in
13937 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13939 d_gethostent_r=undef
13940 gethostent_r_proto=0
13944 *) gethostent_r_proto=0
13948 : see if prototypes for various gethostxxx netdb.h functions are available
13950 set d_gethostprotos gethostent $i_netdb netdb.h
13953 : see if getitimer exists
13954 set getitimer d_getitimer
13957 : see if getlogin exists
13958 set getlogin d_getlogin
13961 : see if getlogin_r exists
13962 set getlogin_r d_getlogin_r
13964 case "$d_getlogin_r" in
13966 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13967 case "$d_getlogin_r_proto:$usethreads" in
13968 ":define") d_getlogin_r_proto=define
13969 set d_getlogin_r_proto getlogin_r $hdrs
13973 case "$d_getlogin_r_proto" in
13975 case "$getlogin_r_proto" in
13976 ''|0) try='int getlogin_r(char*, size_t);'
13977 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13979 case "$getlogin_r_proto" in
13980 ''|0) try='int getlogin_r(char*, int);'
13981 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13983 case "$getlogin_r_proto" in
13984 ''|0) try='char* getlogin_r(char*, size_t);'
13985 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13987 case "$getlogin_r_proto" in
13988 ''|0) try='char* getlogin_r(char*, int);'
13989 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13991 case "$getlogin_r_proto" in
13992 ''|0) d_getlogin_r=undef
13994 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13995 * ) case "$getlogin_r_proto" in
13996 REENTRANT_PROTO*) ;;
13997 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13999 echo "Prototype: $try" ;;
14002 *) case "$usethreads" in
14003 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14010 *) getlogin_r_proto=0
14014 : see if getmnt exists
14015 set getmnt d_getmnt
14018 : see if getmntent exists
14019 set getmntent d_getmntent
14022 : see if getnameinfo exists
14023 set getnameinfo d_getnameinfo
14026 : see if getnetbyaddr exists
14027 set getnetbyaddr d_getnbyaddr
14030 : see if getnetbyname exists
14031 set getnetbyname d_getnbyname
14034 : see if getnetent exists
14035 set getnetent d_getnent
14038 : see if getnetbyaddr_r exists
14039 set getnetbyaddr_r d_getnetbyaddr_r
14041 case "$d_getnetbyaddr_r" in
14043 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14044 case "$d_getnetbyaddr_r_proto:$usethreads" in
14045 ":define") d_getnetbyaddr_r_proto=define
14046 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14050 case "$d_getnetbyaddr_r_proto" in
14052 case "$getnetbyaddr_r_proto" in
14053 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14054 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14056 case "$getnetbyaddr_r_proto" in
14057 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14058 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14060 case "$getnetbyaddr_r_proto" in
14061 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14062 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14064 case "$getnetbyaddr_r_proto" in
14065 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14066 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14068 case "$getnetbyaddr_r_proto" in
14069 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14070 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14072 case "$getnetbyaddr_r_proto" in
14073 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14074 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14076 case "$getnetbyaddr_r_proto" in
14077 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14078 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14080 case "$getnetbyaddr_r_proto" in
14081 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14082 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14084 case "$getnetbyaddr_r_proto" in
14085 ''|0) d_getnetbyaddr_r=undef
14086 getnetbyaddr_r_proto=0
14087 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14088 * ) case "$getnetbyaddr_r_proto" in
14089 REENTRANT_PROTO*) ;;
14090 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14092 echo "Prototype: $try" ;;
14095 *) case "$usethreads" in
14096 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14098 d_getnetbyaddr_r=undef
14099 getnetbyaddr_r_proto=0
14103 *) getnetbyaddr_r_proto=0
14107 : see if getnetbyname_r exists
14108 set getnetbyname_r d_getnetbyname_r
14110 case "$d_getnetbyname_r" in
14112 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14113 case "$d_getnetbyname_r_proto:$usethreads" in
14114 ":define") d_getnetbyname_r_proto=define
14115 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14119 case "$d_getnetbyname_r_proto" in
14121 case "$getnetbyname_r_proto" in
14122 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14123 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14125 case "$getnetbyname_r_proto" in
14126 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14127 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14129 case "$getnetbyname_r_proto" in
14130 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14131 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14133 case "$getnetbyname_r_proto" in
14134 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14135 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14137 case "$getnetbyname_r_proto" in
14138 ''|0) d_getnetbyname_r=undef
14139 getnetbyname_r_proto=0
14140 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14141 * ) case "$getnetbyname_r_proto" in
14142 REENTRANT_PROTO*) ;;
14143 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14145 echo "Prototype: $try" ;;
14148 *) case "$usethreads" in
14149 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14151 d_getnetbyname_r=undef
14152 getnetbyname_r_proto=0
14156 *) getnetbyname_r_proto=0
14160 : see if getnetent_r exists
14161 set getnetent_r d_getnetent_r
14163 case "$d_getnetent_r" in
14165 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14166 case "$d_getnetent_r_proto:$usethreads" in
14167 ":define") d_getnetent_r_proto=define
14168 set d_getnetent_r_proto getnetent_r $hdrs
14172 case "$d_getnetent_r_proto" in
14174 case "$getnetent_r_proto" in
14175 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14176 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14178 case "$getnetent_r_proto" in
14179 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14180 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14182 case "$getnetent_r_proto" in
14183 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14184 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14186 case "$getnetent_r_proto" in
14187 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14188 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14190 case "$getnetent_r_proto" in
14191 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14192 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14194 case "$getnetent_r_proto" in
14195 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14196 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14198 case "$getnetent_r_proto" in
14199 ''|0) d_getnetent_r=undef
14200 getnetent_r_proto=0
14201 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14202 * ) case "$getnetent_r_proto" in
14203 REENTRANT_PROTO*) ;;
14204 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14206 echo "Prototype: $try" ;;
14209 *) case "$usethreads" in
14210 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14212 d_getnetent_r=undef
14213 getnetent_r_proto=0
14217 *) getnetent_r_proto=0
14221 : see if prototypes for various getnetxxx netdb.h functions are available
14223 set d_getnetprotos getnetent $i_netdb netdb.h
14226 : see if getpagesize exists
14227 set getpagesize d_getpagsz
14230 : Optional checks for getprotobyname and getprotobynumber
14232 : see if getprotobyname exists
14233 set getprotobyname d_getpbyname
14236 : see if getprotobynumber exists
14237 set getprotobynumber d_getpbynumber
14240 : see if getprotoent exists
14241 set getprotoent d_getpent
14244 : see if getpgid exists
14245 set getpgid d_getpgid
14248 : see if getpgrp2 exists
14249 set getpgrp2 d_getpgrp2
14252 : see if getppid exists
14253 set getppid d_getppid
14256 : see if getpriority exists
14257 set getpriority d_getprior
14260 : see if getprotobyname_r exists
14261 set getprotobyname_r d_getprotobyname_r
14263 case "$d_getprotobyname_r" in
14265 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14266 case "$d_getprotobyname_r_proto:$usethreads" in
14267 ":define") d_getprotobyname_r_proto=define
14268 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14272 case "$d_getprotobyname_r_proto" in
14274 case "$getprotobyname_r_proto" in
14275 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14276 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14278 case "$getprotobyname_r_proto" in
14279 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14280 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14282 case "$getprotobyname_r_proto" in
14283 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14284 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14286 case "$getprotobyname_r_proto" in
14287 ''|0) d_getprotobyname_r=undef
14288 getprotobyname_r_proto=0
14289 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14290 * ) case "$getprotobyname_r_proto" in
14291 REENTRANT_PROTO*) ;;
14292 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14294 echo "Prototype: $try" ;;
14297 *) case "$usethreads" in
14298 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14300 d_getprotobyname_r=undef
14301 getprotobyname_r_proto=0
14305 *) getprotobyname_r_proto=0
14309 : see if getprotobynumber_r exists
14310 set getprotobynumber_r d_getprotobynumber_r
14312 case "$d_getprotobynumber_r" in
14314 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14315 case "$d_getprotobynumber_r_proto:$usethreads" in
14316 ":define") d_getprotobynumber_r_proto=define
14317 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14321 case "$d_getprotobynumber_r_proto" in
14323 case "$getprotobynumber_r_proto" in
14324 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14325 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14327 case "$getprotobynumber_r_proto" in
14328 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14329 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14331 case "$getprotobynumber_r_proto" in
14332 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14333 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14335 case "$getprotobynumber_r_proto" in
14336 ''|0) d_getprotobynumber_r=undef
14337 getprotobynumber_r_proto=0
14338 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14339 * ) case "$getprotobynumber_r_proto" in
14340 REENTRANT_PROTO*) ;;
14341 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14343 echo "Prototype: $try" ;;
14346 *) case "$usethreads" in
14347 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14349 d_getprotobynumber_r=undef
14350 getprotobynumber_r_proto=0
14354 *) getprotobynumber_r_proto=0
14358 : see if getprotoent_r exists
14359 set getprotoent_r d_getprotoent_r
14361 case "$d_getprotoent_r" in
14363 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14364 case "$d_getprotoent_r_proto:$usethreads" in
14365 ":define") d_getprotoent_r_proto=define
14366 set d_getprotoent_r_proto getprotoent_r $hdrs
14370 case "$d_getprotoent_r_proto" in
14372 case "$getprotoent_r_proto" in
14373 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14374 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14376 case "$getprotoent_r_proto" in
14377 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14378 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14380 case "$getprotoent_r_proto" in
14381 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14382 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14384 case "$getprotoent_r_proto" in
14385 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14386 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14388 case "$getprotoent_r_proto" in
14389 ''|0) d_getprotoent_r=undef
14390 getprotoent_r_proto=0
14391 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14392 * ) case "$getprotoent_r_proto" in
14393 REENTRANT_PROTO*) ;;
14394 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14396 echo "Prototype: $try" ;;
14399 *) case "$usethreads" in
14400 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14402 d_getprotoent_r=undef
14403 getprotoent_r_proto=0
14407 *) getprotoent_r_proto=0
14411 : see if prototypes for various getprotoxxx netdb.h functions are available
14413 set d_getprotoprotos getprotoent $i_netdb netdb.h
14416 : see if getprpwnam exists
14417 set getprpwnam d_getprpwnam
14420 : see if getpwent exists
14421 set getpwent d_getpwent
14424 : see if getpwent_r exists
14425 set getpwent_r d_getpwent_r
14427 case "$d_getpwent_r" in
14429 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14430 case "$d_getpwent_r_proto:$usethreads" in
14431 ":define") d_getpwent_r_proto=define
14432 set d_getpwent_r_proto getpwent_r $hdrs
14436 case "$d_getpwent_r_proto" in
14438 case "$getpwent_r_proto" in
14439 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14440 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14442 case "$getpwent_r_proto" in
14443 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14444 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14446 case "$getpwent_r_proto" in
14447 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14448 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14450 case "$getpwent_r_proto" in
14451 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14452 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14454 case "$getpwent_r_proto" in
14455 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14456 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14458 case "$getpwent_r_proto" in
14459 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14460 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14462 case "$getpwent_r_proto" in
14463 ''|0) d_getpwent_r=undef
14465 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14466 * ) case "$getpwent_r_proto" in
14467 REENTRANT_PROTO*) ;;
14468 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14470 echo "Prototype: $try" ;;
14473 *) case "$usethreads" in
14474 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14481 *) getpwent_r_proto=0
14485 : see if getpwnam_r exists
14486 set getpwnam_r d_getpwnam_r
14488 case "$d_getpwnam_r" in
14490 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14491 case "$d_getpwnam_r_proto:$usethreads" in
14492 ":define") d_getpwnam_r_proto=define
14493 set d_getpwnam_r_proto getpwnam_r $hdrs
14497 case "$d_getpwnam_r_proto" in
14499 case "$getpwnam_r_proto" in
14500 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14501 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14503 case "$getpwnam_r_proto" in
14504 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14505 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14507 case "$getpwnam_r_proto" in
14508 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14509 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14511 case "$getpwnam_r_proto" in
14512 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14513 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14515 case "$getpwnam_r_proto" in
14516 ''|0) d_getpwnam_r=undef
14518 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14519 * ) case "$getpwnam_r_proto" in
14520 REENTRANT_PROTO*) ;;
14521 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14523 echo "Prototype: $try" ;;
14526 *) case "$usethreads" in
14527 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14534 *) getpwnam_r_proto=0
14538 : see if getpwuid_r exists
14539 set getpwuid_r d_getpwuid_r
14541 case "$d_getpwuid_r" in
14543 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14544 case "$d_getpwuid_r_proto:$usethreads" in
14545 ":define") d_getpwuid_r_proto=define
14546 set d_getpwuid_r_proto getpwuid_r $hdrs
14550 case "$d_getpwuid_r_proto" in
14552 case "$getpwuid_r_proto" in
14553 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14554 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14556 case "$getpwuid_r_proto" in
14557 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14558 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14560 case "$getpwuid_r_proto" in
14561 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14562 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14564 case "$getpwuid_r_proto" in
14565 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14566 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14568 case "$getpwuid_r_proto" in
14569 ''|0) d_getpwuid_r=undef
14571 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14572 * ) case "$getpwuid_r_proto" in
14573 REENTRANT_PROTO*) ;;
14574 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14576 echo "Prototype: $try" ;;
14579 *) case "$usethreads" in
14580 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14587 *) getpwuid_r_proto=0
14591 : Optional checks for getsbyname and getsbyport
14593 : see if getservbyname exists
14594 set getservbyname d_getsbyname
14597 : see if getservbyport exists
14598 set getservbyport d_getsbyport
14601 : see if getservent exists
14602 set getservent d_getsent
14605 : see if getservbyname_r exists
14606 set getservbyname_r d_getservbyname_r
14608 case "$d_getservbyname_r" in
14610 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14611 case "$d_getservbyname_r_proto:$usethreads" in
14612 ":define") d_getservbyname_r_proto=define
14613 set d_getservbyname_r_proto getservbyname_r $hdrs
14617 case "$d_getservbyname_r_proto" in
14619 case "$getservbyname_r_proto" in
14620 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14621 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14623 case "$getservbyname_r_proto" in
14624 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14625 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14627 case "$getservbyname_r_proto" in
14628 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14629 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14631 case "$getservbyname_r_proto" in
14632 ''|0) d_getservbyname_r=undef
14633 getservbyname_r_proto=0
14634 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14635 * ) case "$getservbyname_r_proto" in
14636 REENTRANT_PROTO*) ;;
14637 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14639 echo "Prototype: $try" ;;
14642 *) case "$usethreads" in
14643 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14645 d_getservbyname_r=undef
14646 getservbyname_r_proto=0
14650 *) getservbyname_r_proto=0
14654 : see if getservbyport_r exists
14655 set getservbyport_r d_getservbyport_r
14657 case "$d_getservbyport_r" in
14659 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14660 case "$d_getservbyport_r_proto:$usethreads" in
14661 ":define") d_getservbyport_r_proto=define
14662 set d_getservbyport_r_proto getservbyport_r $hdrs
14666 case "$d_getservbyport_r_proto" in
14668 case "$getservbyport_r_proto" in
14669 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14670 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14672 case "$getservbyport_r_proto" in
14673 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14674 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14676 case "$getservbyport_r_proto" in
14677 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14678 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14680 case "$getservbyport_r_proto" in
14681 ''|0) d_getservbyport_r=undef
14682 getservbyport_r_proto=0
14683 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14684 * ) case "$getservbyport_r_proto" in
14685 REENTRANT_PROTO*) ;;
14686 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14688 echo "Prototype: $try" ;;
14691 *) case "$usethreads" in
14692 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14694 d_getservbyport_r=undef
14695 getservbyport_r_proto=0
14699 *) getservbyport_r_proto=0
14703 : see if getservent_r exists
14704 set getservent_r d_getservent_r
14706 case "$d_getservent_r" in
14708 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14709 case "$d_getservent_r_proto:$usethreads" in
14710 ":define") d_getservent_r_proto=define
14711 set d_getservent_r_proto getservent_r $hdrs
14715 case "$d_getservent_r_proto" in
14717 case "$getservent_r_proto" in
14718 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14719 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14721 case "$getservent_r_proto" in
14722 ''|0) try='int getservent_r(struct servent*, char*, int);'
14723 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14725 case "$getservent_r_proto" in
14726 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14727 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14729 case "$getservent_r_proto" in
14730 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14731 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14733 case "$getservent_r_proto" in
14734 ''|0) d_getservent_r=undef
14735 getservent_r_proto=0
14736 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14737 * ) case "$getservent_r_proto" in
14738 REENTRANT_PROTO*) ;;
14739 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14741 echo "Prototype: $try" ;;
14744 *) case "$usethreads" in
14745 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14747 d_getservent_r=undef
14748 getservent_r_proto=0
14752 *) getservent_r_proto=0
14756 : see if prototypes for various getservxxx netdb.h functions are available
14758 set d_getservprotos getservent $i_netdb netdb.h
14761 : see if getspnam exists
14762 set getspnam d_getspnam
14765 : see if this is a shadow.h system
14766 set shadow.h i_shadow
14769 : see if getspnam_r exists
14770 set getspnam_r d_getspnam_r
14772 case "$d_getspnam_r" in
14774 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14775 case "$d_getspnam_r_proto:$usethreads" in
14776 ":define") d_getspnam_r_proto=define
14777 set d_getspnam_r_proto getspnam_r $hdrs
14781 case "$d_getspnam_r_proto" in
14783 case "$getspnam_r_proto" in
14784 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14785 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14787 case "$getspnam_r_proto" in
14788 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14789 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14791 case "$getspnam_r_proto" in
14792 ''|0) d_getspnam_r=undef
14794 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14795 * ) case "$getspnam_r_proto" in
14796 REENTRANT_PROTO*) ;;
14797 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14799 echo "Prototype: $try" ;;
14802 *) case "$usethreads" in
14803 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14810 *) getspnam_r_proto=0
14814 : see if gettimeofday or ftime exists
14815 set gettimeofday d_gettimeod
14817 case "$d_gettimeod" in
14823 val="$undef"; set d_ftime; eval $setvar
14826 case "$d_gettimeod$d_ftime" in
14829 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14833 : see if gmtime_r exists
14834 set gmtime_r d_gmtime_r
14836 case "$d_gmtime_r" in
14838 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14839 case "$d_gmtime_r_proto:$usethreads" in
14840 ":define") d_gmtime_r_proto=define
14841 set d_gmtime_r_proto gmtime_r $hdrs
14845 case "$d_gmtime_r_proto" in
14847 case "$gmtime_r_proto" in
14848 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14849 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14851 case "$gmtime_r_proto" in
14852 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14853 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14855 case "$gmtime_r_proto" in
14856 ''|0) d_gmtime_r=undef
14858 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14859 * ) case "$gmtime_r_proto" in
14860 REENTRANT_PROTO*) ;;
14861 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14863 echo "Prototype: $try" ;;
14866 *) case "$usethreads" in
14867 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14874 *) gmtime_r_proto=0
14878 : see if hasmntopt exists
14879 set hasmntopt d_hasmntopt
14882 : see if this is a netinet/in.h or sys/in.h system
14883 set netinet/in.h i_niin sys/in.h i_sysin
14886 : see if arpa/inet.h has to be included
14887 set arpa/inet.h i_arpainet
14890 : see if htonl --and friends-- exists
14895 : Maybe they are macros.
14898 $cat >htonl.c <<EOM
14900 #include <sys/types.h>
14901 #$i_niin I_NETINET_IN
14903 #$i_arpainet I_ARPA_INET
14904 #ifdef I_NETINET_IN
14905 #include <netinet/in.h>
14908 #include <sys/in.h>
14911 #include <arpa/inet.h>
14914 printf("Defined as a macro.");
14917 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14918 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14920 echo "But it seems to be defined as a macro." >&4
14928 : see if ilogbl exists
14929 set ilogbl d_ilogbl
14934 if set index val -f; eval $csym; $val; then
14935 if set strchr val -f d_strchr; eval $csym; $val; then
14936 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14939 echo "strchr() found." >&4
14943 echo "index() found." >&4
14948 echo "index() found." >&4
14951 if set strchr val -f d_strchr; eval $csym; $val; then
14954 echo "strchr() found." >&4
14956 echo "No index() or strchr() found!" >&4
14961 set d_strchr; eval $setvar
14963 set d_index; eval $setvar
14965 : check whether inet_aton exists
14966 set inet_aton d_inetaton
14969 : see if inet_ntop exists
14970 set inet_ntop d_inetntop
14973 : see if inet_pton exists
14974 set inet_pton d_inetpton
14979 $cat >isascii.c <<EOCP
14982 #$i_stdlib I_STDLIB
14984 #include <stdlib.h>
14995 if eval $compile; then
14996 echo "isascii() found." >&4
14999 echo "isascii() NOT found." >&4
15008 $cat >isblank.c <<'EOCP'
15019 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15020 echo "isblank() found." >&4
15023 echo "isblank() NOT found." >&4
15030 : see if isfinite exists
15031 set isfinite d_isfinite
15034 : see if isinf exists
15038 : see if isnan exists
15042 : see if isnanl exists
15043 set isnanl d_isnanl
15046 : see if killpg exists
15047 set killpg d_killpg
15050 : see if lchown exists
15052 $cat > try.c <<'EOCP'
15053 /* System header to define __stub macros and hopefully few prototypes,
15054 which can conflict with char lchown(); below. */
15055 #include <assert.h>
15056 /* Override any gcc2 internal prototype to avoid an error. */
15057 /* We use char because int might match the return type of a gcc2
15058 builtin and then its argument prototype would still apply. */
15061 /* The GNU C library defines this for functions which it implements
15062 to always fail with ENOSYS. Some functions are actually named
15063 something starting with __ and the normal name is an alias. */
15064 #if defined (__stub_lchown) || defined (__stub___lchown)
15072 if eval $compile; then
15073 $echo "lchown() found." >&4
15076 $echo "lchown() NOT found." >&4
15082 : See if number of significant digits in a double precision number is known
15084 $cat >ldbl_dig.c <<EOM
15085 #$i_limits I_LIMITS
15088 #include <limits.h>
15094 printf("Contains LDBL_DIG");
15097 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15098 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15099 echo "LDBL_DIG found." >&4
15102 echo "LDBL_DIG NOT found." >&4
15109 : see if this is a math.h system
15113 : check to see if math.h defines _LIB_VERSION
15114 d_libm_lib_version="$undef"
15118 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15120 #include <unistd.h>
15122 int main (int argc, char *argv[])
15124 printf ("%d\n", _LIB_VERSION);
15129 if eval $compile; then
15131 echo "Yes, it does ($foo)" >&4
15132 d_libm_lib_version="$define"
15134 echo "No, it does not (probably harmless)" >&4
15141 : see if link exists
15145 : see if localtime_r exists
15146 set localtime_r d_localtime_r
15148 case "$d_localtime_r" in
15150 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15151 case "$d_localtime_r_proto:$usethreads" in
15152 ":define") d_localtime_r_proto=define
15153 set d_localtime_r_proto localtime_r $hdrs
15157 case "$d_localtime_r_proto" in
15159 case "$localtime_r_proto" in
15160 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15161 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15163 case "$localtime_r_proto" in
15164 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15165 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15167 case "$localtime_r_proto" in
15168 ''|0) d_localtime_r=undef
15169 localtime_r_proto=0
15170 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15171 * ) case "$localtime_r_proto" in
15172 REENTRANT_PROTO*) ;;
15173 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15175 echo "Prototype: $try" ;;
15178 *) case "$usethreads" in
15179 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15181 d_localtime_r=undef
15182 localtime_r_proto=0
15186 *) localtime_r_proto=0
15190 : see if localtime_r calls tzset
15191 case "$localtime_r_proto" in
15194 /* Does our libc's localtime_r call tzset ?
15195 * return 0 if so, 1 otherwise.
15197 #$i_systypes I_SYS_TYPES
15198 #$i_unistd I_UNISTD
15200 #$i_stdlib I_STDLIB
15201 #$i_string I_STRING
15202 #$i_malloc I_MALLOC
15204 # include <sys/types.h>
15207 # include <unistd.h>
15213 #include <stdlib.h>
15216 # include <string.h>
15218 # include <strings.h>
15221 # include <malloc.h>
15225 time_t t = time(0L);
15226 char w_tz[]="TZ" "=GMT+5",
15227 e_tz[]="TZ" "=GMT-5",
15228 *tz_e = (char*)malloc(16),
15229 *tz_w = (char*)malloc(16);
15230 struct tm tm_e, tm_w;
15231 memset(&tm_e,'\0',sizeof(struct tm));
15232 memset(&tm_w,'\0',sizeof(struct tm));
15237 localtime_r(&t, &tm_e);
15240 localtime_r(&t, &tm_w);
15242 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15248 if eval $compile; then
15249 if $run ./try; then
15250 d_localtime_r_needs_tzset=undef;
15252 d_localtime_r_needs_tzset=define;
15255 d_localtime_r_needs_tzset=undef;
15259 d_localtime_r_needs_tzset=undef;
15264 : see if localeconv exists
15265 set localeconv d_locconv
15268 : see if lockf exists
15272 : see if prototype for lseek is available
15274 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15277 : see if lstat exists
15281 : see if madvise exists
15282 set madvise d_madvise
15285 : see if malloc_size exists
15286 set malloc_size d_malloc_size
15289 : see if malloc_size_good exists
15290 set malloc_good_size d_malloc_good_size
15293 : see if mblen exists
15297 : see if mbstowcs exists
15298 set mbstowcs d_mbstowcs
15301 : see if mbtowc exists
15302 set mbtowc d_mbtowc
15305 : see if memchr exists
15306 set memchr d_memchr
15309 : see if memcmp exists
15310 set memcmp d_memcmp
15313 : see if memcpy exists
15314 set memcpy d_memcpy
15317 : see if memmove exists
15318 set memmove d_memmove
15321 : see if memset exists
15322 set memset d_memset
15325 : see if mkdir exists
15329 : see if mkdtemp exists
15330 set mkdtemp d_mkdtemp
15333 : see if mkfifo exists
15334 set mkfifo d_mkfifo
15337 : see if mkstemp exists
15338 set mkstemp d_mkstemp
15341 : see if mkstemps exists
15342 set mkstemps d_mkstemps
15345 : see if mktime exists
15346 set mktime d_mktime
15349 : see if this is a sys/mman.h system
15350 set sys/mman.h i_sysmman
15353 : see if mmap exists
15356 : see what shmat returns
15357 : default to something harmless
15359 case "$i_sysmman$d_mmap" in
15361 $cat >mmap.c <<'END'
15362 #include <sys/mman.h>
15365 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15370 echo "and it returns ($mmaptype)." >&4
15376 : see if sqrtl exists
15380 : see if scalbnl exists
15381 set scalbnl d_scalbnl
15384 : see if modfl exists
15388 : see if prototype for modfl is available
15390 set d_modflproto modfl $i_math math.h
15393 d_modfl_pow32_bug="$undef"
15395 case "$d_longdbl$d_modfl" in
15398 Checking to see whether your modfl() is okay for large values...
15404 if $test "X$d_modflproto" != "X$define"; then
15405 $cat >>try.c <<EOCP
15406 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15407 long double modfl (long double, long double *);
15410 $cat >>try.c <<EOCP
15412 long double nv = 4294967303.15;
15418 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15422 case "$osname:$gccversion" in
15423 aix:) saveccflags="$ccflags"
15424 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15427 if eval $compile; then
15430 *" 4294967303.150000 1.150000 4294967302.000000")
15431 echo >&4 "Your modfl() is broken for large values."
15432 d_modfl_pow32_bug="$define"
15434 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15438 *" 4294967303.150000 0.150000 4294967303.000000")
15439 echo >&4 "Your modfl() seems okay for large values."
15441 *) echo >&4 "I don't understand your modfl() at all."
15447 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15450 case "$osname:$gccversion" in
15451 aix:) ccflags="$saveccflags" ;; # restore
15456 if $test "$uselongdouble" = "$define"; then
15458 if $test "$d_sqrtl" != "$define"; then
15459 message="$message sqrtl"
15461 if $test "$d_modfl" != "$define"; then
15462 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15463 echo "You have both aintl and copysignl, so I can emulate modfl."
15465 message="$message modfl"
15468 if $test "$d_frexpl" != "$define"; then
15469 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15470 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15472 message="$message frexpl"
15476 if $test "$message" != ""; then
15479 *** You requested the use of long doubles but you do not seem to have
15480 *** the following mathematical functions needed for long double support:
15482 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15483 *** Cannot continue, aborting.
15491 : see if mprotect exists
15492 set mprotect d_mprotect
15495 : see if msgctl exists
15496 set msgctl d_msgctl
15499 : see if msgget exists
15500 set msgget d_msgget
15503 : see if msgsnd exists
15504 set msgsnd d_msgsnd
15507 : see if msgrcv exists
15508 set msgrcv d_msgrcv
15511 : see how much of the 'msg*(2)' library is present.
15514 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15515 *"$undef"*) h_msg=false;;
15519 case "`ipcs 2>&1`" in
15520 "SVID messages"*"not configured"*)
15521 echo "Your $osname does not have the msg*(2) configured." >&4
15524 set msgctl d_msgctl
15526 set msgget d_msgget
15528 set msgsnd d_msgsnd
15530 set msgrcv d_msgrcv
15536 : we could also check for sys/ipc.h ...
15537 if $h_msg && $test `./findhdr sys/msg.h`; then
15538 echo "You have the full msg*(2) library." >&4
15541 echo "You don't have the full msg*(2) library." >&4
15547 : Check for msghdr_s
15549 echo "Checking to see if your system supports struct msghdr..." >&4
15550 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15552 case "$d_msghdr_s" in
15553 "$define") echo "Yes, it does." ;;
15554 *) echo "No, it doesn't." ;;
15558 : see if msync exists
15562 : see if munmap exists
15563 set munmap d_munmap
15566 : see if nice exists
15570 : see if this is a langinfo.h system
15571 set langinfo.h i_langinfo
15574 : see if nl_langinfo exists
15575 set nl_langinfo d_nl_langinfo
15578 : check for volatile keyword
15580 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15581 $cat >try.c <<'EOCP'
15584 typedef struct _goo_struct goo_struct;
15585 goo_struct * volatile goo = ((goo_struct *)0);
15586 struct _goo_struct {
15591 typedef unsigned short foo_t;
15592 char *volatile foo;
15594 volatile foo_t blech;
15598 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15600 echo "Yup, it does."
15603 echo "Nope, it doesn't."
15609 : Check basic sizes
15611 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15613 case "$use64bitint:$d_quad:$quadtype" in
15616 uvtype="$uquadtype"
15621 uvtype="unsigned long"
15627 case "$uselongdouble:$d_longdbl" in
15629 nvtype="long double"
15630 nvsize=$longdblsize
15637 $echo "(IV will be "$ivtype", $ivsize bytes)"
15638 $echo "(UV will be "$uvtype", $uvsize bytes)"
15639 $echo "(NV will be "$nvtype", $nvsize bytes)"
15642 #$i_inttypes I_INTTYPES
15644 #include <inttypes.h>
15649 int8_t i = INT8_MAX;
15650 uint8_t u = UINT8_MAX;
15651 printf("int8_t\n");
15654 int16_t i = INT16_MAX;
15655 uint16_t i = UINT16_MAX;
15656 printf("int16_t\n");
15659 int32_t i = INT32_MAX;
15660 uint32_t u = UINT32_MAX;
15661 printf("int32_t\n");
15666 i8type="signed char"
15667 u8type="unsigned char"
15672 '') case "$shortsize" in
15674 u16type="unsigned short"
15682 '') set try -DINT16
15683 if eval $compile; then
15684 case "`$run ./try`" in
15696 '') if $test $shortsize -ge 2; then
15698 u16type="unsigned short"
15706 '') case "$longsize" in
15708 u32type="unsigned long"
15712 *) case "$intsize" in
15714 u32type="unsigned int"
15724 '') set try -DINT32
15725 if eval $compile; then
15726 case "`$run ./try`" in
15738 '') if $test $intsize -ge 4; then
15740 u32type="unsigned int"
15748 '') case "$d_quad:$quadtype" in
15750 i64type="$quadtype"
15751 u64type="$uquadtype"
15759 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15760 : volatile so that the compiler has to store it out to memory.
15761 if test X"$d_volatile" = X"$define"; then
15766 #$i_stdlib I_STDLIB
15768 #include <stdlib.h>
15770 #include <sys/types.h>
15771 #include <signal.h>
15773 $volatile int bletched = 0;
15774 $signal_t blech(int s) { bletched = 1; }
15779 int n = 8 * $uvsize;
15782 signal(SIGFPE, blech);
15785 for (i = 0; i < n; i++) {
15786 u = u << 1 | ($uvtype)1;
15788 if (($uvtype)d != u)
15792 d = ($nvtype)(u - 1);
15793 if (($uvtype)d != (u - 1))
15800 printf("%d\n", ((i == n) ? -n : i));
15806 d_nv_preserves_uv="$undef"
15807 if eval $compile; then
15808 nv_preserves_uv_bits="`$run ./try`"
15810 case "$nv_preserves_uv_bits" in
15812 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15813 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15814 d_nv_preserves_uv="$define"
15816 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15817 d_nv_preserves_uv="$undef" ;;
15818 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15819 nv_preserves_uv_bits="0" ;;
15823 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15824 : volatile so that the compiler has to store it out to memory.
15825 if test X"$d_volatile" = X"$define"; then
15831 typedef $nvtype NV;
15838 while(count < 256) {
15839 $volatile NV up = value + 1.0;
15840 $volatile NV negated = -value;
15841 $volatile NV down = negated - 1.0;
15842 $volatile NV got_up = up - value;
15843 int up_good = got_up == 1.0;
15844 int got_down = down - negated;
15845 int down_good = got_down == -1.0;
15847 if (down_good != up_good) {
15849 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15850 up_good, (double) got_up, down_good, (double) got_down,
15851 count, (double) value);
15858 fputs("256.0", stdout);
15861 fputs("2.0", stdout);
15867 fputs("*", stdout);
15873 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15874 count, (double) value);
15880 nv_overflows_integers_at='0'
15881 if eval $compile; then
15887 The largest integer your NVs can preserve is equal to $xxx
15889 nv_overflows_integers_at="$xxx"
15892 Cannot determine the largest integer value your NVs can hold, unexpected output
15899 Cannot determine the largest integer value your NVs can hold
15906 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15907 : volatile so that the compiler has to store it out to memory.
15908 if test X"$d_volatile" = X"$define"; then
15913 #$i_stdlib I_STDLIB
15915 #include <stdlib.h>
15917 #$i_string I_STRING
15919 # include <string.h>
15921 # include <strings.h>
15923 #include <sys/types.h>
15924 #include <signal.h>
15926 $volatile int bletched = 0;
15927 $signal_t blech(int s) { bletched = 1; }
15930 int checkit($nvtype d, char *where) {
15931 unsigned char *p = (char *)&d;
15932 unsigned char *end = p + sizeof(d);
15942 printf("No - %s: 0x", where);
15944 printf ("%02X", *p++);
15949 int main(int argc, char **argv) {
15952 fail += checkit(d, "0.0");
15954 /* The compiler shouldn't be assuming that bletched is 0 */
15957 fail += checkit(d, "bleched");
15960 signal(SIGFPE, blech);
15963 /* Paranoia - the compiler should have no way of knowing that ANSI says
15964 that argv[argc] will always be NULL. Actually, if it did assume this it
15965 would be buggy, as this is C and main() can be called from elsewhere in
15967 d = argv[argc] ? 1 : 0;
15970 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15973 fail += checkit(d, "ternary");
15975 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15978 printf("No - memset doesn't give 0.0\n");
15979 /* This might just blow up: */
15980 printf("(gives %g)\n", d);
15986 printf("No - something bleched\n");
15991 printf("No - %d fail(s)\n", fail);
16000 d_nv_zero_is_allbits_zero="$undef"
16001 if eval $compile; then
16007 0.0 is represented as all bits zero in memory
16009 d_nv_zero_is_allbits_zero="$define"
16012 0.0 is not represented as all bits zero in memory
16014 d_nv_zero_is_allbits_zero="$undef"
16019 0.0 is not represented as all bits zero in memory
16021 d_nv_zero_is_allbits_zero="$undef"
16027 : check for off64_t
16029 echo "Checking to see if you have off64_t..." >&4
16031 #include <sys/types.h>
16032 #include <unistd.h>
16033 int main() { off64_t x = 7; }
16036 if eval $compile; then
16038 echo "You have off64_t."
16041 echo "You do not have off64_t."
16042 case "$lseeksize" in
16043 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16050 : how to create joinable pthreads
16051 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16053 echo "Checking what constant to use for creating joinable pthreads..." >&4
16054 $cat >try.c <<'EOCP'
16055 #include <pthread.h>
16057 int detachstate = JOINABLE;
16060 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16061 if eval $compile; then
16062 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16063 val="$undef" # Yes, undef.
16064 set d_old_pthread_create_joinable
16067 set old_pthread_create_joinable
16070 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16071 if eval $compile; then
16072 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16074 set d_old_pthread_create_joinable
16076 val=PTHREAD_CREATE_UNDETACHED
16077 set old_pthread_create_joinable
16080 set try -DJOINABLE=__UNDETACHED
16081 if eval $compile; then
16082 echo "You seem to use __UNDETACHED." >&4
16084 set d_old_pthread_create_joinable
16087 set old_pthread_create_joinable
16090 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16092 set d_old_pthread_create_joinable
16095 set old_pthread_create_joinable
16102 d_old_pthread_create_joinable="$undef"
16103 old_pthread_create_joinable=""
16106 : see if pause exists
16110 : see if poll exists
16114 : see if prctl exists
16118 : see if prctl supports PR_SET_NAME
16119 d_prctl_set_name=$undef
16123 #include <sys/prctl.h>
16125 int main (int argc, char *argv[])
16127 return (prctl (PR_SET_NAME, "Test"));
16131 if eval $compile_ok && $run ./try; then
16132 echo "Your prctl (PR_SET_NAME, ...) works"
16133 d_prctl_set_name=$define
16139 : see if readlink exists
16140 set readlink d_readlink
16143 : Check if exe is symlink to abs path of executing program
16147 case "$d_readlink" in
16149 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16150 : more tidy to avoid an extra level of symlink
16151 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16152 while test $# -gt 0; do
16155 if $issymlink $try; then
16156 $ls -l $try > reflect
16157 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16158 echo "You have $type-like $try."
16159 procselfexe='"'$try'"'
16161 : This will break out of the loop
16172 : backward compatibility for d_hvfork
16173 if test X$d_hvfork != X; then
16174 d_vfork="$d_hvfork"
16177 : see if there is a vfork
16182 d_pseudofork=$undef
16184 : Ok, but do we want to use it. vfork is reportedly unreliable in
16185 : perl on Solaris 2.x, and probably elsewhere.
16189 case "$usevfork" in
16195 Perl can only use a vfork() that doesn't suffer from strict
16196 restrictions on calling functions or modifying global data in
16197 the child. For example, glibc-2.1 contains such a vfork()
16198 that is unsuitable. If your system provides a proper fork()
16199 call, chances are that you do NOT want perl to use vfork().
16202 rp="Do you still want to use vfork()?"
16207 echo "Ok, we won't use vfork()."
16216 $define) usevfork='true';;
16217 *) usevfork='false';;
16220 : see whether the pthread_atfork exists
16222 #include <pthread.h>
16225 #ifdef PTHREAD_ATFORK
16226 pthread_atfork(NULL,NULL,NULL);
16231 : see if pthread_atfork exists
16232 set try -DPTHREAD_ATFORK
16233 if eval $compile; then
16238 case "$usethreads" in
16241 $define) echo 'pthread_atfork found.' >&4 ;;
16242 *) echo 'pthread_atfork NOT found.' >&4 ;;
16245 set d_pthread_atfork
16248 : see if pthread_attr_setscope exists
16249 set pthread_attr_setscope d_pthread_attr_setscope
16252 : see whether the various POSIXish _yields exist
16254 #include <pthread.h>
16260 #ifdef PTHREAD_YIELD
16263 #ifdef PTHREAD_YIELD_NULL
16264 pthread_yield(NULL);
16270 : see if sched_yield exists
16271 set try -DSCHED_YIELD
16272 if eval $compile; then
16274 sched_yield='sched_yield()'
16278 case "$usethreads" in
16281 $define) echo 'sched_yield() found.' >&4 ;;
16282 *) echo 'sched_yield() NOT found.' >&4 ;;
16288 : see if pthread_yield exists
16289 set try -DPTHREAD_YIELD
16290 if eval $compile; then
16292 case "$sched_yield" in
16293 '') sched_yield='pthread_yield()' ;;
16296 set try -DPTHREAD_YIELD_NULL
16297 if eval $compile; then
16299 case "$sched_yield" in
16300 '') sched_yield='pthread_yield(NULL)' ;;
16306 case "$usethreads" in
16309 $define) echo 'pthread_yield() found.' >&4 ;;
16310 *) echo 'pthread_yield() NOT found.' >&4 ;;
16314 set d_pthread_yield
16316 case "$sched_yield" in
16317 '') sched_yield=undef ;;
16321 : see if random_r exists
16322 set random_r d_random_r
16324 case "$d_random_r" in
16326 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16327 case "$d_random_r_proto:$usethreads" in
16328 ":define") d_random_r_proto=define
16329 set d_random_r_proto random_r $hdrs
16333 case "$d_random_r_proto" in
16335 case "$random_r_proto" in
16336 ''|0) try='int random_r(int*, struct random_data*);'
16337 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16339 case "$random_r_proto" in
16340 ''|0) try='int random_r(long*, struct random_data*);'
16341 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16343 case "$random_r_proto" in
16344 ''|0) try='int random_r(struct random_data*, int32_t*);'
16345 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16347 case "$random_r_proto" in
16348 ''|0) d_random_r=undef
16350 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16351 * ) case "$random_r_proto" in
16352 REENTRANT_PROTO*) ;;
16353 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16355 echo "Prototype: $try" ;;
16358 *) case "$usethreads" in
16359 define) echo "random_r has no prototype, not using it." >&4 ;;
16366 *) random_r_proto=0
16370 : see if readdir and friends exist
16371 set readdir d_readdir
16373 set seekdir d_seekdir
16375 set telldir d_telldir
16377 set rewinddir d_rewinddir
16380 : see if readdir64_r exists
16381 set readdir64_r d_readdir64_r
16383 case "$d_readdir64_r" in
16385 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16386 case "$d_readdir64_r_proto:$usethreads" in
16387 ":define") d_readdir64_r_proto=define
16388 set d_readdir64_r_proto readdir64_r $hdrs
16392 case "$d_readdir64_r_proto" in
16394 case "$readdir64_r_proto" in
16395 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16396 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16398 case "$readdir64_r_proto" in
16399 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16400 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16402 case "$readdir64_r_proto" in
16403 ''|0) d_readdir64_r=undef
16404 readdir64_r_proto=0
16405 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16406 * ) case "$readdir64_r_proto" in
16407 REENTRANT_PROTO*) ;;
16408 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16410 echo "Prototype: $try" ;;
16413 *) case "$usethreads" in
16414 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16416 d_readdir64_r=undef
16417 readdir64_r_proto=0
16421 *) readdir64_r_proto=0
16425 : see if readdir_r exists
16426 set readdir_r d_readdir_r
16428 case "$d_readdir_r" in
16430 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16431 case "$d_readdir_r_proto:$usethreads" in
16432 ":define") d_readdir_r_proto=define
16433 set d_readdir_r_proto readdir_r $hdrs
16437 case "$d_readdir_r_proto" in
16439 case "$readdir_r_proto" in
16440 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16441 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16443 case "$readdir_r_proto" in
16444 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16445 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16447 case "$readdir_r_proto" in
16448 ''|0) d_readdir_r=undef
16450 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16451 * ) case "$readdir_r_proto" in
16452 REENTRANT_PROTO*) ;;
16453 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16455 echo "Prototype: $try" ;;
16458 *) case "$usethreads" in
16459 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16466 *) readdir_r_proto=0
16470 : see if readv exists
16474 : see if recvmsg exists
16475 set recvmsg d_recvmsg
16478 : see if rename exists
16479 set rename d_rename
16482 : see if rmdir exists
16486 : see if memory.h is available.
16491 : See if it conflicts with string.h
16497 $cppstdin $cppflags $cppminus < $strings > mem.h
16498 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16500 echo "We won't be including <memory.h>."
16510 : can bcopy handle overlapping blocks?
16513 case "$d_memmove" in
16514 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16515 *) case "$d_bcopy" in
16517 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16519 #$i_memory I_MEMORY
16520 #$i_stdlib I_STDLIB
16521 #$i_string I_STRING
16522 #$i_unistd I_UNISTD
16524 $cat >>try.c <<'EOCP'
16527 # include <memory.h>
16530 # include <stdlib.h>
16533 # include <string.h>
16535 # include <strings.h>
16538 # include <unistd.h> /* Needed for NetBSD */
16542 char buf[128], abc[128];
16548 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16549 try to store the string in read-only memory. */
16550 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16552 for (align = 7; align >= 0; align--) {
16553 for (len = 36; len; len--) {
16555 bcopy(abc, b, len);
16556 for (off = 1; off <= len; off++) {
16557 bcopy(b, b+off, len);
16558 bcopy(b+off, b, len);
16559 if (bcmp(b, abc, len))
16568 if eval $compile_ok; then
16569 if $run ./try 2>/dev/null; then
16570 echo "Yes, it can."
16573 echo "It can't, sorry."
16576 echo "(I can't compile the test program, so we'll assume not...)"
16586 : can memcpy handle overlapping blocks?
16589 case "$d_memmove" in
16590 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16591 *) case "$d_memcpy" in
16593 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16595 #$i_memory I_MEMORY
16596 #$i_stdlib I_STDLIB
16597 #$i_string I_STRING
16598 #$i_unistd I_UNISTD
16600 $cat >>try.c <<'EOCP'
16603 # include <memory.h>
16606 # include <stdlib.h>
16609 # include <string.h>
16611 # include <strings.h>
16614 # include <unistd.h> /* Needed for NetBSD */
16618 char buf[128], abc[128];
16624 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16625 try to store the string in read-only memory. */
16626 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16628 for (align = 7; align >= 0; align--) {
16629 for (len = 36; len; len--) {
16631 memcpy(b, abc, len);
16632 for (off = 1; off <= len; off++) {
16633 memcpy(b+off, b, len);
16634 memcpy(b, b+off, len);
16635 if (memcmp(b, abc, len))
16644 if eval $compile_ok; then
16645 if $run ./try 2>/dev/null; then
16646 echo "Yes, it can."
16649 echo "It can't, sorry."
16652 echo "(I can't compile the test program, so we'll assume not...)"
16662 : can memcmp be trusted to compare relative magnitude?
16664 case "$d_memcmp" in
16667 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16669 #$i_memory I_MEMORY
16670 #$i_stdlib I_STDLIB
16671 #$i_string I_STRING
16672 #$i_unistd I_UNISTD
16674 $cat >>try.c <<'EOCP'
16677 # include <memory.h>
16680 # include <stdlib.h>
16683 # include <string.h>
16685 # include <strings.h>
16688 # include <unistd.h> /* Needed for NetBSD */
16694 if ((a < b) && memcmp(&a, &b, 1) < 0)
16700 if eval $compile_ok; then
16701 if $run ./try 2>/dev/null; then
16702 echo "Yes, it can."
16705 echo "No, it can't (it uses signed chars)."
16708 echo "(I can't compile the test program, so we'll assume not...)"
16716 : see if prototype for sbrk is available
16718 set d_sbrkproto sbrk $i_unistd unistd.h
16721 : see if select exists
16722 set select d_select
16725 : see if semctl exists
16726 set semctl d_semctl
16729 : see if semget exists
16730 set semget d_semget
16733 : see if semop exists
16737 : see how much of the 'sem*(2)' library is present.
16740 case "$d_semctl$d_semget$d_semop" in
16741 *"$undef"*) h_sem=false;;
16745 case "`ipcs 2>&1`" in
16746 "SVID messages"*"not configured"*)
16747 echo "Your $osname does not have the sem*(2) configured." >&4
16750 set semctl d_semctl
16752 set semget d_semget
16760 : we could also check for sys/ipc.h ...
16761 if $h_sem && $test `./findhdr sys/sem.h`; then
16762 echo "You have the full sem*(2) library." >&4
16765 echo "You don't have the full sem*(2) library." >&4
16771 : see whether sys/sem.h defines union semun
16773 $cat > try.c <<'END'
16774 #include <sys/types.h>
16775 #include <sys/ipc.h>
16776 #include <sys/sem.h>
16777 int main () { union semun semun; semun.buf = 0; }
16780 if eval $compile; then
16781 echo "You have union semun in <sys/sem.h>." >&4
16784 echo "You do not have union semun in <sys/sem.h>." >&4
16791 : see how to do semctl IPC_STAT
16795 $cat > tryh.h <<END
16798 # define S_IRUSR S_IREAD
16799 # define S_IWUSR S_IWRITE
16800 # define S_IXUSR S_IEXEC
16802 # define S_IRUSR 0400
16803 # define S_IWUSR 0200
16804 # define S_IXUSR 0100
16806 # define S_IRGRP (S_IRUSR>>3)
16807 # define S_IWGRP (S_IWUSR>>3)
16808 # define S_IXGRP (S_IXUSR>>3)
16809 # define S_IROTH (S_IRUSR>>6)
16810 # define S_IWOTH (S_IWUSR>>6)
16811 # define S_IXOTH (S_IXUSR>>6)
16814 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16815 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16816 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16819 : see whether semctl IPC_STAT can use union semun
16820 case "$d_semctl_semun" in
16824 #include <sys/types.h>
16825 #include <sys/ipc.h>
16826 #include <sys/sem.h>
16827 #include <sys/stat.h>
16834 #$d_union_semun HAS_UNION_SEMUN
16837 #ifndef HAS_UNION_SEMUN
16840 struct semid_ds *buf;
16841 unsigned short *array;
16847 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16848 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16850 struct semid_ds argbuf;
16853 st = semctl(sem, 0, IPC_STAT, arg);
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);
16870 if eval $compile; then
16873 semun) val="$define" ;;
16881 case "$d_semctl_semun" in
16883 echo "You can use union semun for semctl IPC_STAT." >&4
16886 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16891 : see whether semctl IPC_STAT can use struct semid_ds pointer
16892 case "$d_semctl_semid_ds" in
16895 $cat > try.c <<'END'
16896 #include <sys/types.h>
16897 #include <sys/ipc.h>
16898 #include <sys/sem.h>
16899 #include <sys/stat.h>
16907 struct semid_ds arg;
16910 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16911 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16914 st = semctl(sem, 0, IPC_STAT, &arg);
16916 printf("semid_ds\n");
16918 # endif /* IPC_STAT */
16919 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16921 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16922 # endif /* IPC_RMID */
16923 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16925 #endif /* IPC_PRIVATE && ... */
16926 printf("semget failed: errno = %d\n", errno);
16932 if eval $compile; then
16935 semid_ds) val="$define" ;;
16939 set d_semctl_semid_ds
16943 case "$d_semctl_semid_ds" in
16945 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16947 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16953 # We do not have the full sem*(2) library, so assume we can not
16959 set d_semctl_semid_ds
16965 : see if sendmsg exists
16966 set sendmsg d_sendmsg
16969 : see if setegid exists
16970 set setegid d_setegid
16973 : see if seteuid exists
16974 set seteuid d_seteuid
16977 : see if setgrent exists
16978 set setgrent d_setgrent
16981 : see if setgrent_r exists
16982 set setgrent_r d_setgrent_r
16984 case "$d_setgrent_r" in
16986 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16987 case "$d_setgrent_r_proto:$usethreads" in
16988 ":define") d_setgrent_r_proto=define
16989 set d_setgrent_r_proto setgrent_r $hdrs
16993 case "$d_setgrent_r_proto" in
16995 case "$setgrent_r_proto" in
16996 ''|0) try='int setgrent_r(FILE**);'
16997 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16999 case "$setgrent_r_proto" in
17000 ''|0) try='void setgrent_r(FILE**);'
17001 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17003 case "$setgrent_r_proto" in
17004 ''|0) d_setgrent_r=undef
17006 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17007 * ) case "$setgrent_r_proto" in
17008 REENTRANT_PROTO*) ;;
17009 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17011 echo "Prototype: $try" ;;
17014 *) case "$usethreads" in
17015 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17022 *) setgrent_r_proto=0
17026 : see if sethostent exists
17027 set sethostent d_sethent
17030 : see if sethostent_r exists
17031 set sethostent_r d_sethostent_r
17033 case "$d_sethostent_r" in
17035 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17036 case "$d_sethostent_r_proto:$usethreads" in
17037 ":define") d_sethostent_r_proto=define
17038 set d_sethostent_r_proto sethostent_r $hdrs
17042 case "$d_sethostent_r_proto" in
17044 case "$sethostent_r_proto" in
17045 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17046 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17048 case "$sethostent_r_proto" in
17049 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17050 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17052 case "$sethostent_r_proto" in
17053 ''|0) d_sethostent_r=undef
17054 sethostent_r_proto=0
17055 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17056 * ) case "$sethostent_r_proto" in
17057 REENTRANT_PROTO*) ;;
17058 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17060 echo "Prototype: $try" ;;
17063 *) case "$usethreads" in
17064 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17066 d_sethostent_r=undef
17067 sethostent_r_proto=0
17071 *) sethostent_r_proto=0
17075 : see if setitimer exists
17076 set setitimer d_setitimer
17079 : see if setlinebuf exists
17080 set setlinebuf d_setlinebuf
17083 : see if setlocale exists
17084 set setlocale d_setlocale
17087 : see if locale.h is available
17088 set locale.h i_locale
17091 : see if setlocale_r exists
17092 set setlocale_r d_setlocale_r
17094 case "$d_setlocale_r" in
17096 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17097 case "$d_setlocale_r_proto:$usethreads" in
17098 ":define") d_setlocale_r_proto=define
17099 set d_setlocale_r_proto setlocale_r $hdrs
17103 case "$d_setlocale_r_proto" in
17105 case "$setlocale_r_proto" in
17106 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17107 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17109 case "$setlocale_r_proto" in
17110 ''|0) d_setlocale_r=undef
17111 setlocale_r_proto=0
17112 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17113 * ) case "$setlocale_r_proto" in
17114 REENTRANT_PROTO*) ;;
17115 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17117 echo "Prototype: $try" ;;
17120 *) case "$usethreads" in
17121 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17123 d_setlocale_r=undef
17124 setlocale_r_proto=0
17128 *) setlocale_r_proto=0
17132 : see if setnetent exists
17133 set setnetent d_setnent
17136 : see if setnetent_r exists
17137 set setnetent_r d_setnetent_r
17139 case "$d_setnetent_r" in
17141 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17142 case "$d_setnetent_r_proto:$usethreads" in
17143 ":define") d_setnetent_r_proto=define
17144 set d_setnetent_r_proto setnetent_r $hdrs
17148 case "$d_setnetent_r_proto" in
17150 case "$setnetent_r_proto" in
17151 ''|0) try='int setnetent_r(int, struct netent_data*);'
17152 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17154 case "$setnetent_r_proto" in
17155 ''|0) try='void setnetent_r(int, struct netent_data*);'
17156 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17158 case "$setnetent_r_proto" in
17159 ''|0) d_setnetent_r=undef
17160 setnetent_r_proto=0
17161 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17162 * ) case "$setnetent_r_proto" in
17163 REENTRANT_PROTO*) ;;
17164 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17166 echo "Prototype: $try" ;;
17169 *) case "$usethreads" in
17170 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17172 d_setnetent_r=undef
17173 setnetent_r_proto=0
17177 *) setnetent_r_proto=0
17181 : see if setprotoent exists
17182 set setprotoent d_setpent
17185 : see if setpgid exists
17186 set setpgid d_setpgid
17189 : see if setpgrp2 exists
17190 set setpgrp2 d_setpgrp2
17193 : see if setpriority exists
17194 set setpriority d_setprior
17197 : see if setproctitle exists
17198 set setproctitle d_setproctitle
17201 : see if setprotoent_r exists
17202 set setprotoent_r d_setprotoent_r
17204 case "$d_setprotoent_r" in
17206 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17207 case "$d_setprotoent_r_proto:$usethreads" in
17208 ":define") d_setprotoent_r_proto=define
17209 set d_setprotoent_r_proto setprotoent_r $hdrs
17213 case "$d_setprotoent_r_proto" in
17215 case "$setprotoent_r_proto" in
17216 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17217 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17219 case "$setprotoent_r_proto" in
17220 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17221 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17223 case "$setprotoent_r_proto" in
17224 ''|0) d_setprotoent_r=undef
17225 setprotoent_r_proto=0
17226 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17227 * ) case "$setprotoent_r_proto" in
17228 REENTRANT_PROTO*) ;;
17229 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17231 echo "Prototype: $try" ;;
17234 *) case "$usethreads" in
17235 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17237 d_setprotoent_r=undef
17238 setprotoent_r_proto=0
17242 *) setprotoent_r_proto=0
17246 : see if setpwent exists
17247 set setpwent d_setpwent
17250 : see if setpwent_r exists
17251 set setpwent_r d_setpwent_r
17253 case "$d_setpwent_r" in
17255 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17256 case "$d_setpwent_r_proto:$usethreads" in
17257 ":define") d_setpwent_r_proto=define
17258 set d_setpwent_r_proto setpwent_r $hdrs
17262 case "$d_setpwent_r_proto" in
17264 case "$setpwent_r_proto" in
17265 ''|0) try='int setpwent_r(FILE**);'
17266 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17268 case "$setpwent_r_proto" in
17269 ''|0) try='void setpwent_r(FILE**);'
17270 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17272 case "$setpwent_r_proto" in
17273 ''|0) d_setpwent_r=undef
17275 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17276 * ) case "$setpwent_r_proto" in
17277 REENTRANT_PROTO*) ;;
17278 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17280 echo "Prototype: $try" ;;
17283 *) case "$usethreads" in
17284 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17291 *) setpwent_r_proto=0
17295 : see if setregid exists
17296 set setregid d_setregid
17298 set setresgid d_setresgid
17301 : see if setreuid exists
17302 set setreuid d_setreuid
17304 set setresuid d_setresuid
17307 : see if setrgid exists
17308 set setrgid d_setrgid
17311 : see if setruid exists
17312 set setruid d_setruid
17315 : see if setservent exists
17316 set setservent d_setsent
17319 : see if setservent_r exists
17320 set setservent_r d_setservent_r
17322 case "$d_setservent_r" in
17324 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17325 case "$d_setservent_r_proto:$usethreads" in
17326 ":define") d_setservent_r_proto=define
17327 set d_setservent_r_proto setservent_r $hdrs
17331 case "$d_setservent_r_proto" in
17333 case "$setservent_r_proto" in
17334 ''|0) try='int setservent_r(int, struct servent_data*);'
17335 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17337 case "$setservent_r_proto" in
17338 ''|0) try='void setservent_r(int, struct servent_data*);'
17339 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17341 case "$setservent_r_proto" in
17342 ''|0) d_setservent_r=undef
17343 setservent_r_proto=0
17344 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17345 * ) case "$setservent_r_proto" in
17346 REENTRANT_PROTO*) ;;
17347 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17349 echo "Prototype: $try" ;;
17352 *) case "$usethreads" in
17353 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17355 d_setservent_r=undef
17356 setservent_r_proto=0
17360 *) setservent_r_proto=0
17364 : see if setsid exists
17365 set setsid d_setsid
17368 : see if setvbuf exists
17369 set setvbuf d_setvbuf
17372 : see if sfio.h is available
17376 : see if sfio library is available
17387 : Ok, but do we want to use it.
17391 true|$define|[yY]*) dflt='y';;
17394 echo "$package can use the sfio library, but it is experimental."
17395 rp="You seem to have sfio available, do you want to try using it?"
17398 y|Y) echo "Ok, turning on sfio then."
17401 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17406 *) case "$usesfio" in
17407 true|$define|[yY]*)
17408 echo "Sorry, cannot find sfio on this machine." >&4
17409 echo "Ignoring your setting of usesfio=$usesfio." >&4
17418 $define) usesfio='true';;
17419 *) usesfio='false';;
17423 *) : Remove sfio from list of libraries to use
17426 echo "Removing unneeded -lsfio from library list" >&4
17427 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17430 echo "libs = $libs" >&4
17437 : see if shmctl exists
17438 set shmctl d_shmctl
17441 : see if shmget exists
17442 set shmget d_shmget
17445 : see if shmat exists
17448 : see what shmat returns
17451 $cat >shmat.c <<'END'
17452 #include <sys/shm.h>
17455 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17460 echo "and it returns ($shmattype)." >&4
17461 : see if a prototype for shmat is available
17462 xxx=`./findhdr sys/shm.h`
17463 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17464 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17475 set d_shmatprototype
17478 : see if shmdt exists
17482 : see how much of the 'shm*(2)' library is present.
17485 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17486 *"$undef"*) h_shm=false;;
17490 case "`ipcs 2>&1`" in
17491 "SVID shared memory"*"not configured"*)
17492 echo "Your $osname does not have the shm*(2) configured." >&4
17495 set shmctl d_shmctl
17497 set shmget d_shmget
17507 : we could also check for sys/ipc.h ...
17508 if $h_shm && $test `./findhdr sys/shm.h`; then
17509 echo "You have the full shm*(2) library." >&4
17512 echo "You don't have the full shm*(2) library." >&4
17518 : see if we have sigaction
17520 if set sigaction val -f d_sigaction; eval $csym; $val; then
17521 echo 'sigaction() found.' >&4
17524 #include <sys/types.h>
17525 #include <signal.h>
17526 #$i_stdlib I_STDLIB
17528 #include <stdlib.h>
17532 struct sigaction act, oact;
17534 oact.sa_handler = 0;
17535 /* so that act and oact are used */
17536 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17540 if eval $compile_ok; then
17543 echo "But you don't seem to have a useable struct sigaction." >&4
17547 echo 'sigaction NOT found.' >&4
17550 set d_sigaction; eval $setvar
17553 : see if this is a sunmath.h system
17554 set sunmath.h i_sunmath
17557 : see if signbit exists
17558 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17561 #$i_sunmath I_SUNMATH
17565 #ifdef I_SUNMATH /* Solaris special math library */
17566 # include <sunmath.h>
17569 int main(int argc, char **argv)
17573 if ((signbit(x) == 0) && (signbit(y) != 0))
17581 if eval $compile; then
17582 if $run ./try; then
17586 $echo "Signbit seems to be available, but doesn't work as I expected."
17587 $echo "I won't use it." >&4
17598 : see if sigprocmask exists
17599 set sigprocmask d_sigprocmask
17602 : see if sigsetjmp exists
17604 case "$d_sigsetjmp" in
17607 #include <setjmp.h>
17608 #$i_stdlib I_STDLIB
17610 #include <stdlib.h>
17616 if (sigsetjmp(env,1))
17619 siglongjmp(env, 1);
17624 if eval $compile; then
17625 if $run ./try >/dev/null 2>&1; then
17626 echo "POSIX sigsetjmp found." >&4
17630 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17636 echo "sigsetjmp not found." >&4
17640 *) val="$d_sigsetjmp"
17641 case "$d_sigsetjmp" in
17642 $define) echo "POSIX sigsetjmp found." >&4;;
17643 $undef) echo "sigsetjmp not found." >&4;;
17651 : see if snprintf exists
17652 set snprintf d_snprintf
17655 : see if vsnprintf exists
17656 set vsnprintf d_vsnprintf
17659 case "$d_snprintf-$d_vsnprintf" in
17662 Checking whether your snprintf() and vsnprintf() work okay...
17664 $cat >try.c <<'EOCP'
17665 /* v?snprintf testing logic courtesy of Russ Allbery.
17666 * According to C99:
17667 * - if the buffer is too short it still must be \0-terminated
17668 * - if the buffer is too short the potentially required length
17669 * must be returned and not -1
17670 * - if the buffer is NULL the potentially required length
17671 * must be returned and not -1 or core dump
17674 #include <stdarg.h>
17678 int test (char *format, ...)
17683 va_start (args, format);
17684 count = vsnprintf (buf, sizeof buf, format, args);
17691 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17692 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17696 if eval $compile; then
17699 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17701 Your snprintf() and snprintf() don't seem to be working okay.
17703 d_snprintf="$undef"
17704 d_vsnprintf="$undef"
17708 echo "(I can't seem to compile the test program--assuming they don't)"
17709 d_snprintf="$undef"
17710 d_vsnprintf="$undef"
17716 : see if sockatmark exists
17717 set sockatmark d_sockatmark
17720 : see if prototype for sockatmark is available
17722 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17725 : see if socks5_init exists
17726 set socks5_init d_socks5_init
17729 : see if sprintf returns the length of the string in the buffer as per ANSI
17730 $echo "Checking whether sprintf returns the length of the string..." >&4
17733 #$i_stdlib I_STDLIB
17735 #include <stdlib.h>
17737 #$i_string I_STRING
17739 # include <string.h>
17741 # include <strings.h>
17750 int check (size_t expect, int test) {
17751 size_t got = strlen(buffer);
17755 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17760 int main(int argc, char **argv) {
17763 check(sprintf(buffer, ""), ++test);
17764 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17765 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17772 if eval $compile; then
17776 sprintf returns the length of the string (as ANSI says it should)
17778 d_sprintf_returns_strlen="$define"
17781 sprintf does not return the length of the string (how old is this system?)
17783 d_sprintf_returns_strlen="$undef"
17787 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17788 d_sprintf_returns_strlen="$undef"
17792 : see if srand48_r exists
17793 set srand48_r d_srand48_r
17795 case "$d_srand48_r" in
17797 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17798 case "$d_srand48_r_proto:$usethreads" in
17799 ":define") d_srand48_r_proto=define
17800 set d_srand48_r_proto srand48_r $hdrs
17804 case "$d_srand48_r_proto" in
17806 case "$srand48_r_proto" in
17807 ''|0) try='int srand48_r(long, struct drand48_data*);'
17808 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17810 case "$srand48_r_proto" in
17811 ''|0) d_srand48_r=undef
17813 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17814 * ) case "$srand48_r_proto" in
17815 REENTRANT_PROTO*) ;;
17816 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17818 echo "Prototype: $try" ;;
17821 *) case "$usethreads" in
17822 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17829 *) srand48_r_proto=0
17833 : see if srandom_r exists
17834 set srandom_r d_srandom_r
17836 case "$d_srandom_r" in
17838 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17839 case "$d_srandom_r_proto:$usethreads" in
17840 ":define") d_srandom_r_proto=define
17841 set d_srandom_r_proto srandom_r $hdrs
17845 case "$d_srandom_r_proto" in
17847 case "$srandom_r_proto" in
17848 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17849 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17851 case "$srandom_r_proto" in
17852 ''|0) d_srandom_r=undef
17854 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17855 * ) case "$srandom_r_proto" in
17856 REENTRANT_PROTO*) ;;
17857 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17859 echo "Prototype: $try" ;;
17862 *) case "$usethreads" in
17863 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17870 *) srandom_r_proto=0
17874 : see if prototype for setresgid is available
17876 set d_sresgproto setresgid $i_unistd unistd.h
17879 : see if prototype for setresuid is available
17881 set d_sresuproto setresuid $i_unistd unistd.h
17884 : see if sys/stat.h is available
17885 set sys/stat.h i_sysstat
17888 : see if stat knows about block sizes
17890 echo "Checking to see if your struct stat has st_blocks field..." >&4
17891 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17894 : see if this is a sys/vfs.h system
17895 set sys/vfs.h i_sysvfs
17898 : see if this is a sys/statfs.h system
17899 set sys/statfs.h i_sysstatfs
17902 : Check for statfs_s
17904 echo "Checking to see if your system supports struct statfs..." >&4
17905 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
17907 case "$d_statfs_s" in
17908 "$define") echo "Yes, it does." ;;
17909 *) echo "No, it doesn't." ;;
17913 : see if struct statfs knows about f_flags
17914 case "$d_statfs_s" in
17917 echo "Checking to see if your struct statfs has f_flags field..." >&4
17918 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
17922 set d_statfs_f_flags
17926 case "$d_statfs_f_flags" in
17927 "$define") echo "Yes, it does." ;;
17928 *) echo "No, it doesn't." ;;
17931 : see what flavor, if any, of static inline is supported
17933 echo "Checking to see if your system supports static inline..."
17934 $cat > try.c <<'EOCP'
17935 #include <stdlib.h>
17936 extern int f_via_a(int x);
17937 extern int f_via_b(int x);
17938 int main(int argc, char **argv)
17947 return EXIT_SUCCESS;
17950 return EXIT_FAILURE;
17954 $cat > a.c <<'EOCP'
17955 static INLINE int f(int x) {
17966 $cat > b.c <<'EOCP'
17967 extern int f(int x);
17975 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17976 case "$perl_static_inline" in
17977 '') # Check the various possibilities, and break out on success.
17978 # For gcc, prefer __inline__, which will still permit
17979 # cflags.SH to add in -ansi.
17980 case "$gccversion" in
17981 '') xxx="inline __inline__ __inline _inline";;
17982 *) xxx="__inline__ inline __inline _inline";;
17984 for inline in $xxx; do
17985 set try -DINLINE=$inline a.c
17986 if eval $compile && $run ./try; then
17987 # Now make sure there is no external linkage of static
17989 set try -DINLINE=$inline -DUSE_B a.c b.c
17990 if eval $compile && $run ./try; then
17991 $echo "Your compiler supports static $inline, " >&4
17992 $echo "but it also creates an external definition," >&4
17993 $echo "so I won't use it." >&4
17996 $echo "Your compiler supports static $inline." >&4
17998 perl_static_inline="static $inline";
18002 $echo "Your compiler does NOT support static $inline." >&4
18007 *inline*) # Some variant of inline exists.
18008 echo "Keeping your $hint value of $perl_static_inline."
18011 static) # No inline capabilities
18012 echo "Keeping your $hint value of $perl_static_inline."
18015 *) # Unrecognized previous value -- blindly trust the supplied
18016 # value and hope it makes sense. Use old value for
18017 # d_static_inline, if there is one.
18018 echo "Keeping your $hint value of $perl_static_inline."
18019 case "$d_static_inline" in
18021 *) val=$d_static_inline ;;
18025 # Fallback to plain 'static' if nothing worked.
18026 case "$perl_static_inline" in
18028 perl_static_inline="static"
18032 set d_static_inline
18034 $rm -f a.[co] b.[co]
18037 : Check stream access
18039 Checking how to access stdio streams by file descriptor number...
18041 case "$stdio_stream_array" in
18042 '') $cat >try.c <<EOCP
18045 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18049 for s in _iob __iob __sF
18051 set try -DSTDIO_STREAM_ARRAY=$s
18052 if eval $compile; then
18053 case "`$run ./try`" in
18054 yes) stdio_stream_array=$s; break ;;
18060 case "$stdio_stream_array" in
18062 I can't figure out how to access stdio streams by file descriptor number.
18064 d_stdio_stream_array="$undef"
18067 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18069 d_stdio_stream_array="$define"
18073 : see if strcoll exists
18074 set strcoll d_strcoll
18077 : check for structure copying
18079 echo "Checking to see if your C compiler can copy structs..." >&4
18080 $cat >try.c <<'EOCP'
18090 if $cc -c try.c >/dev/null 2>&1 ; then
18092 echo "Yup, it can."
18095 echo "Nope, it can't."
18101 : see if strerror and/or sys_errlist[] exist
18103 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18104 if set strerror val -f d_strerror; eval $csym; $val; then
18105 echo 'strerror() found.' >&4
18106 d_strerror="$define"
18107 d_strerrm='strerror(e)'
18108 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18109 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18110 d_syserrlst="$define"
18112 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18113 d_syserrlst="$undef"
18115 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18116 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18117 echo 'strerror() found in string header.' >&4
18118 d_strerror="$define"
18119 d_strerrm='strerror(e)'
18120 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18121 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18122 d_syserrlst="$define"
18124 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18125 d_syserrlst="$undef"
18127 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18128 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18129 d_strerror="$undef"
18130 d_syserrlst="$define"
18131 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18133 echo 'strerror() and sys_errlist[] NOT found.' >&4
18134 d_strerror="$undef"
18135 d_syserrlst="$undef"
18136 d_strerrm='"unknown"'
18140 : see if strerror_r exists
18141 set strerror_r d_strerror_r
18143 case "$d_strerror_r" in
18145 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18146 case "$d_strerror_r_proto:$usethreads" in
18147 ":define") d_strerror_r_proto=define
18148 set d_strerror_r_proto strerror_r $hdrs
18152 case "$d_strerror_r_proto" in
18154 case "$strerror_r_proto" in
18155 ''|0) try='int strerror_r(int, char*, size_t);'
18156 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18158 case "$strerror_r_proto" in
18159 ''|0) try='int strerror_r(int, char*, int);'
18160 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18162 case "$strerror_r_proto" in
18163 ''|0) try='char* strerror_r(int, char*, size_t);'
18164 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18166 case "$strerror_r_proto" in
18167 ''|0) d_strerror_r=undef
18169 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18170 * ) case "$strerror_r_proto" in
18171 REENTRANT_PROTO*) ;;
18172 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18174 echo "Prototype: $try" ;;
18177 *) case "$usethreads" in
18178 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18185 *) strerror_r_proto=0
18189 : see if strftime exists
18190 set strftime d_strftime
18193 : see if strlcat exists
18194 set strlcat d_strlcat
18197 : see if strlcpy exists
18198 set strlcpy d_strlcpy
18201 : see if strtod exists
18202 set strtod d_strtod
18205 : see if strtol exists
18206 set strtol d_strtol
18209 : see if strtold exists
18210 set strtold d_strtold
18213 : see if strtoll exists
18214 set strtoll d_strtoll
18217 case "$d_longlong-$d_strtoll" in
18220 Checking whether your strtoll() works okay...
18222 $cat >try.c <<'EOCP'
18225 #define strtoll __strtoll
18228 #define strtoll _strtoll
18231 extern long long int strtoll(char *s, char **, int);
18232 static int bad = 0;
18233 int check(char *s, long long ell, int een) {
18236 gll = strtoll(s, 0, 10);
18237 if (!((gll == ell) && (errno == een)))
18241 check(" 1", 1LL, 0);
18242 check(" 0", 0LL, 0);
18243 check("-1", -1LL, 0);
18244 check("-9223372036854775808", -9223372036854775808LL, 0);
18245 check("-9223372036854775808", -9223372036854775808LL, 0);
18246 check(" 9223372036854775807", 9223372036854775807LL, 0);
18247 check("-9223372036854775808", -9223372036854775808LL, 0);
18248 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18249 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18255 if eval $compile; then
18258 ok) echo "Your strtoll() seems to be working okay." ;;
18260 Your strtoll() doesn't seem to be working okay.
18266 echo "(I can't seem to compile the test program--assuming it doesn't)"
18272 : see if strtoq exists
18273 set strtoq d_strtoq
18276 : see if strtoul exists
18277 set strtoul d_strtoul
18280 case "$d_strtoul" in
18283 Checking whether your strtoul() works okay...
18285 $cat >try.c <<'EOCP'
18288 extern unsigned long int strtoul(char *s, char **, int);
18289 static int bad = 0;
18290 void check(char *s, unsigned long eul, int een) {
18293 gul = strtoul(s, 0, 10);
18294 if (!((gul == eul) && (errno == een)))
18298 check(" 1", 1L, 0);
18299 check(" 0", 0L, 0);
18301 case "$longsize" in
18303 $cat >>try.c <<'EOCP'
18304 check("18446744073709551615", 18446744073709551615UL, 0);
18305 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18306 #if 0 /* strtoul() for /^-/ strings is undefined. */
18307 check("-1", 18446744073709551615UL, 0);
18308 check("-18446744073709551614", 2, 0);
18309 check("-18446744073709551615", 1, 0);
18310 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18311 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18316 $cat >>try.c <<'EOCP'
18317 check("4294967295", 4294967295UL, 0);
18318 check("4294967296", 4294967295UL, ERANGE);
18319 #if 0 /* strtoul() for /^-/ strings is undefined. */
18320 check("-1", 4294967295UL, 0);
18321 check("-4294967294", 2, 0);
18322 check("-4294967295", 1, 0);
18323 check("-4294967296", 4294967295UL, ERANGE);
18324 check("-4294967297", 4294967295UL, ERANGE);
18329 : Should we write these tests to be more portable by sprintf-ing
18330 : ~0 and then manipulating that char string as input for strtol?
18333 $cat >>try.c <<'EOCP'
18340 if eval $compile; then
18341 case "`$run ./try`" in
18342 ok) echo "Your strtoul() seems to be working okay." ;;
18344 Your strtoul() doesn't seem to be working okay.
18350 echo "(I can't seem to compile the test program--assuming it doesn't)"
18356 : see if strtoull exists
18357 set strtoull d_strtoull
18360 case "$d_longlong-$d_strtoull" in
18363 Checking whether your strtoull() works okay...
18365 $cat >try.c <<'EOCP'
18368 #define strtoull __strtoull
18371 extern unsigned long long int strtoull(char *s, char **, int);
18372 static int bad = 0;
18373 int check(char *s, long long eull, int een) {
18376 gull = strtoull(s, 0, 10);
18377 if (!((gull == eull) && (errno == een)))
18381 check(" 1", 1LL, 0);
18382 check(" 0", 0LL, 0);
18383 check("18446744073709551615", 18446744073709551615ULL, 0);
18384 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18385 #if 0 /* strtoull() for /^-/ strings is undefined. */
18386 check("-1", 18446744073709551615ULL, 0);
18387 check("-18446744073709551614", 2LL, 0);
18388 check("-18446744073709551615", 1LL, 0);
18389 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18390 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18397 if eval $compile; then
18398 case "`$run ./try`" in
18399 ok) echo "Your strtoull() seems to be working okay." ;;
18401 Your strtoull() doesn't seem to be working okay.
18403 d_strtoull="$undef"
18407 echo "(I can't seem to compile the test program--assuming it doesn't)"
18408 d_strtoull="$undef"
18413 : see if strtouq exists
18414 set strtouq d_strtouq
18417 case "$d_strtouq" in
18420 Checking whether your strtouq() works okay...
18422 $cat >try.c <<'EOCP'
18425 extern unsigned long long int strtouq(char *s, char **, int);
18426 static int bad = 0;
18427 void check(char *s, unsigned long long eull, int een) {
18428 unsigned long long gull;
18430 gull = strtouq(s, 0, 10);
18431 if (!((gull == eull) && (errno == een)))
18435 check(" 1", 1LL, 0);
18436 check(" 0", 0LL, 0);
18437 check("18446744073709551615", 18446744073709551615ULL, 0);
18438 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18439 #if 0 /* strtouq() for /^-/ strings is undefined. */
18440 check("-1", 18446744073709551615ULL, 0);
18441 check("-18446744073709551614", 2LL, 0);
18442 check("-18446744073709551615", 1LL, 0);
18443 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18444 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18452 if eval $compile; then
18453 case "`$run ./try`" in
18454 ok) echo "Your strtouq() seems to be working okay." ;;
18456 Your strtouq() doesn't seem to be working okay.
18462 echo "(I can't seem to compile the test program--assuming it doesn't)"
18468 : see if strxfrm exists
18469 set strxfrm d_strxfrm
18472 : see if symlink exists
18473 set symlink d_symlink
18476 : see if syscall exists
18477 set syscall d_syscall
18480 : see if prototype for syscall is available
18482 set d_syscallproto syscall $i_unistd unistd.h
18485 : see if sysconf exists
18486 set sysconf d_sysconf
18489 : see if system exists
18490 set system d_system
18493 : see if tcgetpgrp exists
18494 set tcgetpgrp d_tcgetpgrp
18497 : see if tcsetpgrp exists
18498 set tcsetpgrp d_tcsetpgrp
18501 : see if prototype for telldir is available
18503 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18506 : see if time exists
18508 if test "X$d_time" = X -o X"$timetype" = X; then
18509 if set time val -f d_time; eval $csym; $val; then
18510 echo 'time() found.' >&4
18512 rp="What is the type returned by time() on this system?"
18513 set time_t timetype long stdio.h sys/types.h
18516 echo 'time() not found, hope that will do.' >&4
18524 : see if timegm exists
18525 set timegm d_timegm
18528 : see if this is a sys/times.h system
18529 set sys/times.h i_systimes
18532 : see if times exists
18534 if set times val -f d_times; eval $csym; $val; then
18535 echo 'times() found.' >&4
18538 case "$i_systimes" in
18539 "$define") inc='sys/times.h';;
18541 rp="What is the type returned by times() on this system?"
18542 set clock_t clocktype long stdio.h sys/types.h $inc
18545 echo 'times() NOT found, hope that will do.' >&4
18550 : see if tmpnam_r exists
18551 set tmpnam_r d_tmpnam_r
18553 case "$d_tmpnam_r" in
18555 hdrs="$i_systypes sys/types.h define stdio.h "
18556 case "$d_tmpnam_r_proto:$usethreads" in
18557 ":define") d_tmpnam_r_proto=define
18558 set d_tmpnam_r_proto tmpnam_r $hdrs
18562 case "$d_tmpnam_r_proto" in
18564 case "$tmpnam_r_proto" in
18565 ''|0) try='char* tmpnam_r(char*);'
18566 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18568 case "$tmpnam_r_proto" in
18569 ''|0) d_tmpnam_r=undef
18571 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18572 * ) case "$tmpnam_r_proto" in
18573 REENTRANT_PROTO*) ;;
18574 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18576 echo "Prototype: $try" ;;
18579 *) case "$usethreads" in
18580 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18587 *) tmpnam_r_proto=0
18591 : see if truncate exists
18592 set truncate d_truncate
18595 : see if ttyname_r exists
18596 set ttyname_r d_ttyname_r
18598 case "$d_ttyname_r" in
18600 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18601 case "$d_ttyname_r_proto:$usethreads" in
18602 ":define") d_ttyname_r_proto=define
18603 set d_ttyname_r_proto ttyname_r $hdrs
18607 case "$d_ttyname_r_proto" in
18609 case "$ttyname_r_proto" in
18610 ''|0) try='int ttyname_r(int, char*, size_t);'
18611 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18613 case "$ttyname_r_proto" in
18614 ''|0) try='int ttyname_r(int, char*, int);'
18615 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18617 case "$ttyname_r_proto" in
18618 ''|0) try='char* ttyname_r(int, char*, int);'
18619 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18621 case "$ttyname_r_proto" in
18622 ''|0) d_ttyname_r=undef
18624 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18625 * ) case "$ttyname_r_proto" in
18626 REENTRANT_PROTO*) ;;
18627 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18629 echo "Prototype: $try" ;;
18632 *) case "$usethreads" in
18633 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18640 *) ttyname_r_proto=0
18644 : see if tzname[] exists
18646 if set tzname val -a d_tzname; eval $csym; $val; then
18648 echo 'tzname[] found.' >&4
18651 echo 'tzname[] NOT found.' >&4
18656 : Check if is a multiplatform env
18658 next|rhapsody|darwin) multiarch="$define" ;;
18660 case "$multiarch" in
18661 ''|[nN]*) multiarch="$undef" ;;
18664 : check for ordering of bytes in a UV
18666 case "$usecrosscompile$multiarch" in
18669 You seem to be either cross-compiling or doing a multiarchitecture build,
18670 skipping the byteorder check.
18676 case "$byteorder" in
18679 In the following, larger digits indicate more significance. A big-endian
18680 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18681 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18682 machines may have weird orders like 3412. A Cray will report 87654321,
18683 an Alpha will report 12345678. If the test program works the default is
18685 I'm now running the test program...
18689 #$i_stdlib I_STDLIB
18691 #include <stdlib.h>
18693 #include <sys/types.h>
18694 typedef $uvtype UV;
18704 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18706 u.l = (UV)0x04030201;
18707 for (i = 0; i < $uvsize; i++)
18708 printf("%c", u.c[i]+'0');
18715 if eval $compile && $run ./try > /dev/null; then
18718 [1-4][1-4][1-4][1-4]|12345678|87654321)
18719 echo "(The test program ran ok.)"
18720 echo "byteorder=$dflt"
18723 ????|????????) echo "(The test program ran ok.)" ;;
18724 *) echo "(The test program didn't run right for some reason.)" ;;
18729 (I can't seem to compile the test program. Guessing big-endian...)
18732 case "$xxx_prompt" in
18734 rp="What is the order of bytes in $uvtype?"
18747 : Checking 32bit alignedness
18750 Checking to see whether you can access character data unalignedly...
18752 case "$d_u32align" in
18753 '') $cat >try.c <<EOCP
18755 #$i_stdlib I_STDLIB
18757 #include <stdlib.h>
18759 #define U32 $u32type
18760 #define BYTEORDER 0x$byteorder
18762 #include <signal.h>
18764 $signal_t bletch(int s) { exit(4); }
18767 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18768 volatile U8 buf[8];
18772 if (sizeof(U32) != 4) {
18773 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18780 signal(SIGBUS, bletch);
18792 for (i = 0; i < 4; i++) {
18793 up = (U32*)(buf + i);
18794 if (! ((*up == 1 << (8*i)) || /* big-endian */
18795 (*up == 1 << (8*(3-i))) /* little-endian */
18799 printf("read failed (%x)\n", *up);
18805 for (i = 0; i < 4; i++) {
18806 up = (U32*)(buf + i);
18808 if (*up != 0xBeef) {
18809 printf("write failed (%x)\n", *up);
18823 if eval $compile_ok; then
18824 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18825 $run ./try 2>&1 >/dev/null
18828 You can access character data pretty unalignedly.
18830 d_u32align="$undef"
18833 It seems that you must access character data in an aligned manner.
18835 d_u32align="$define"
18839 rp='Can you access character data at unaligned addresses?'
18843 [yY]*) d_u32align="$undef" ;;
18844 *) d_u32align="$define" ;;
18851 : see if ualarm exists
18852 set ualarm d_ualarm
18855 : see if umask exists
18859 : see if unordered exists
18860 set unordered d_unordered
18863 : see if unsetenv exists
18864 set unsetenv d_unsetenv
18867 : see if usleep exists
18868 set usleep d_usleep
18871 : see if prototype for usleep is available
18873 set d_usleepproto usleep $i_unistd unistd.h
18876 : see if ustat exists
18880 : see if closedir exists
18881 set closedir d_closedir
18884 case "$d_closedir" in
18887 echo "Checking whether closedir() returns a status..." >&4
18889 #$i_dirent I_DIRENT /**/
18890 #$i_sysdir I_SYS_DIR /**/
18891 #$i_sysndir I_SYS_NDIR /**/
18892 #$i_systypes I_SYS_TYPES /**/
18894 #if defined(I_SYS_TYPES)
18895 #include <sys/types.h>
18897 #if defined(I_DIRENT)
18898 #include <dirent.h>
18899 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18900 #include <sys/dir.h>
18904 #include <sys/ndir.h>
18908 #include <ndir.h> /* may be wrong in the future */
18910 #include <sys/dir.h>
18915 int main() { return closedir(opendir(".")); }
18918 if eval $compile_ok; then
18919 if $run ./try > /dev/null 2>&1 ; then
18920 echo "Yes, it does."
18923 echo "No, it doesn't."
18927 echo "(I can't seem to compile the test program--assuming it doesn't)"
18935 set d_void_closedir
18939 : see if there is a wait4
18943 : see if waitpid exists
18944 set waitpid d_waitpid
18947 : see if wcstombs exists
18948 set wcstombs d_wcstombs
18951 : see if wctomb exists
18952 set wctomb d_wctomb
18955 : see if writev exists
18956 set writev d_writev
18959 : preserve RCS keywords in files with variable substitution, grrr
18964 Revision='$Revision'
18966 : check for alignment requirements
18968 case "$usecrosscompile$multiarch" in
18971 You seem to be either cross-compiling or doing a multiarchitecture build,
18972 skipping the memory alignment check.
18975 case "$alignbytes" in
18976 '') alignbytes=8 ;;
18980 case "$alignbytes" in
18981 '') echo "Checking alignment constraints..." >&4
18982 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18983 $cat >try.c <<'EOCP'
18984 typedef long double NV;
18987 $cat >try.c <<'EOCP'
18991 $cat >>try.c <<'EOCP'
18999 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19004 if eval $compile_ok; then
19008 echo "(I can't seem to compile the test program...)"
19011 *) dflt="$alignbytes"
19014 rp="Doubles must be aligned on a how-many-byte boundary?"
19022 : set the base revision
19025 : length of character in bytes. Is always 1, otherwise it isnt C
19026 : This used to be a test using sizeof
19029 : Check for the number of bits in a character
19030 case "$charbits" in
19031 '') echo "Checking how long a character is (in bits)..." >&4
19038 for (c = 1, n = 0; c; c <<= 1, n++) ;
19039 printf ("%d\n", n);
19044 if eval $compile_ok; then
19048 echo "(I can't seem to compile the test program. Guessing...)"
19055 rp="What is the length of a character (in bits)?"
19059 case "$charbits" in
19062 Your system has an unsigned character size of $charbits bits, which
19063 is rather unusual (normally it is 8 bits). Perl likely will not work
19064 correctly on your system, with subtle bugs in various places.
19066 rp='Do you really want to continue?'
19070 [yY]) echo >&4 "Okay, continuing." ;;
19075 : how do we concatenate cpp tokens here?
19077 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19078 $cat >cpp_stuff.c <<'EOCP'
19079 #define RCAT(a,b)a/**/b
19080 #define ACAT(a,b)a ## b
19084 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19085 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19086 echo "Oh! Smells like ANSI's been here." >&4
19087 echo "We can catify or stringify, separately or together!"
19089 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19090 echo "Ah, yes! The good old days!" >&4
19091 echo "However, in the good old days we don't know how to stringify and"
19092 echo "catify at the same time."
19096 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19097 You're going to have to edit the values of CAT[2-5] in config.h...
19099 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19103 : see if this is a db.h system
19109 : Check db version.
19111 echo "Checking Berkeley DB version ..." >&4
19117 #include <sys/types.h>
19119 #$i_stdlib I_STDLIB
19121 #include <stdlib.h>
19124 int main(int argc, char *argv[])
19126 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19127 int Major, Minor, Patch ;
19128 unsigned long Version ;
19129 (void)db_version(&Major, &Minor, &Patch) ;
19131 printf("%d %d %d %d %d %d\n",
19132 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19133 Major, Minor, Patch);
19136 printf("You have Berkeley DB Version 2 or greater.\n");
19138 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19139 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19140 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19141 Major, Minor, Patch) ;
19143 /* check that db.h & libdb are compatible */
19144 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19145 printf("db.h and libdb are incompatible.\n") ;
19149 printf("db.h and libdb are compatible.\n") ;
19151 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19152 + DB_VERSION_PATCH ;
19154 /* needs to be >= 2.3.4 */
19155 if (Version < 2003004) {
19156 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19157 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19163 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19168 printf("You have Berkeley DB Version 1.\n");
19169 exit(0); /* DB version < 2: the coast is clear. */
19171 exit(1); /* <db.h> not Berkeley DB? */
19177 if eval $compile_ok && $run ./try; then
19178 echo 'Looks OK.' >&4
19180 db_version_major=$1
19181 db_version_minor=$2
19182 db_version_patch=$3
19184 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19188 : Remove db from list of libraries to use
19189 echo "Removing unusable -ldb from library list" >&4
19190 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19193 echo "libs = $libs" >&4
19203 : Check the return type needed for hash
19205 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19211 #include <sys/types.h>
19214 #ifndef DB_VERSION_MAJOR
19215 u_int32_t hash_cb (ptr, size)
19223 info.hash = hash_cb;
19227 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19228 if $contains warning try.out >>/dev/null 2>&1 ; then
19231 db_hashtype='u_int32_t'
19234 : XXX Maybe we should just give up here.
19235 db_hashtype=u_int32_t
19237 echo "Help: I can't seem to compile the db test program." >&4
19238 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19241 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19243 *) db_hashtype=u_int32_t
19248 : Check the return type needed for prefix
19250 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19256 #include <sys/types.h>
19259 #ifndef DB_VERSION_MAJOR
19260 size_t prefix_cb (key1, key2)
19268 info.prefix = prefix_cb;
19272 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19273 if $contains warning try.out >>/dev/null 2>&1 ; then
19274 db_prefixtype='int'
19276 db_prefixtype='size_t'
19279 db_prefixtype='size_t'
19280 : XXX Maybe we should just give up here.
19282 echo "Help: I can't seem to compile the db test program." >&4
19283 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19286 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19288 *) db_prefixtype='size_t'
19292 : How can we generate normalized random numbers ?
19294 echo "Looking for a random number function..." >&4
19295 case "$randfunc" in
19297 if set drand48 val -f; eval $csym; $val; then
19299 echo "Good, found drand48()." >&4
19300 elif set random val -f; eval $csym; $val; then
19302 echo "OK, found random()." >&4
19305 echo "Yick, looks like I have to use rand()." >&4
19316 *-Dmy_rand=*|*-Dmy_srand=*)
19317 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19318 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19319 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19320 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19324 while $test "$cont"; do
19325 rp="Use which function to generate random numbers?"
19327 if $test "$ans" = "$dflt"; then
19333 if set $ans val -f; eval $csym; $val; then
19337 rp="I cannot find function $ans. Use that name anyway?"
19346 case "$randfunc" in
19348 drand01="drand48()"
19354 case "$randbits" in
19356 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19358 #$i_unistd I_UNISTD
19359 #$i_stdlib I_STDLIB
19362 # include <unistd.h>
19365 # include <stdlib.h>
19370 register unsigned long tmp;
19371 register unsigned long max = 0L;
19373 for (i = 1000; i; i--) {
19374 tmp = (unsigned long) $randfunc();
19375 if (tmp > max) max = tmp;
19377 for (i = 0; max; i++)
19383 if eval $compile_ok; then
19387 echo "(I can't seem to compile the test program...)"
19394 rp="How many bits does your $randfunc() function produce?"
19398 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19399 seedfunc="s$randfunc"
19400 randseedtype=unsigned
19404 rp="How many bits does your $randfunc() function produce?"
19407 seedfunc="s$randfunc"
19408 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19409 if set $seedfunc val -f; eval $csym; $val; then
19410 echo "(Using $seedfunc() to seed random generator)"
19412 echo "(Warning: no $seedfunc() to seed random generator)"
19415 randseedtype=unsigned
19422 : Determine if this is an EBCDIC system
19424 echo "Determining whether or not we are on an EBCDIC system..." >&4
19425 $cat >try.c <<'EOM'
19428 if ('M'==0xd4) return 0;
19435 if eval $compile_ok; then
19436 if $run ./try; then
19437 echo "You seem to speak EBCDIC." >&4
19440 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19443 echo "I'm unable to compile the test program." >&4
19444 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19450 : Check how to flush
19453 Checking how to flush all pending stdio output...
19455 # I only know how to find the first 32 possibly open files on SunOS.
19456 # See also hints/sunos_4_1.sh and util.c --AD
19458 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19460 $cat >>try.c <<EOCP
19462 #$i_stdlib I_STDLIB
19464 #include <stdlib.h>
19466 #$i_unistd I_UNISTD
19468 # include <unistd.h>
19470 #$d_sysconf HAS_SYSCONF
19471 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19472 #ifdef HAS_STDIO_STREAM_ARRAY
19473 # define STDIO_STREAM_ARRAY $stdio_stream_array
19478 p = fopen("try.out", "w");
19482 # ifdef TRY_FPRINTF
19486 #ifdef TRY_FFLUSH_NULL
19489 #ifdef TRY_FFLUSH_ALL
19491 long open_max = -1;
19492 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19493 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19495 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19496 open_max = sysconf(_SC_OPEN_MAX);
19499 open_max = FOPEN_MAX;
19502 open_max = OPEN_MAX;
19511 # ifdef HAS_STDIO_STREAM_ARRAY
19512 if (open_max > 0) {
19514 for (i = 0; i < open_max; i++)
19515 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19516 STDIO_STREAM_ARRAY[i]._file < open_max &&
19517 STDIO_STREAM_ARRAY[i]._flag)
19518 fflush(&STDIO_STREAM_ARRAY[i]);
19526 : first we have to find out how _not_ to flush
19528 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19530 set try -DTRY_FPUTC
19531 if eval $compile; then
19532 $run ./try 2>/dev/null
19535 if $test ! -s try.out -a "X$code" = X42; then
19541 set try -DTRY_FPRINTF
19542 if eval $compile; then
19543 $run ./try 2>/dev/null
19546 if $test ! -s try.out -a "X$code" = X42; then
19547 output=-DTRY_FPRINTF
19553 : check for fflush NULL behaviour
19554 case "$fflushNULL" in
19555 '') set try -DTRY_FFLUSH_NULL $output
19556 if eval $compile; then
19557 $run ./try 2>/dev/null
19560 if $test -s try.out -a "X$code" = X42; then
19561 fflushNULL="`$cat try.out`"
19563 if $test "X$code" != X42; then
19565 (If this test failed, don't worry, we'll try another method shortly.)
19570 $rm -f core try.core core.try.*
19571 case "$fflushNULL" in
19573 Your fflush(NULL) works okay for output streams.
19574 Let's see if it clobbers input pipes...
19576 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19577 # bug that improperly flushes the input end of pipes. So we avoid the
19578 # autoflush on fork/system/exec support for now. :-(
19579 $cat >tryp.c <<EOCP
19582 main(int argc, char **argv)
19588 while ((i = getc(stdin)) != -1
19589 && (*bp++ = i) != '\n'
19590 && bp < &buf[1024])
19593 fprintf(stdout, "%s", buf);
19601 fflushNULL="$define"
19603 if eval $compile; then
19605 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19606 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19608 fflush(NULL) seems to behave okay with input streams.
19610 fflushNULL="$define"
19613 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19615 fflushNULL="$undef"
19618 $rm -f core tryp.c tryp.core core.tryp.*
19621 Your fflush(NULL) isn't working (contrary to ANSI C).
19623 fflushNULL="$undef"
19626 Cannot figure out whether your fflush(NULL) works or not.
19627 I'm assuming it doesn't (contrary to ANSI C).
19629 fflushNULL="$undef"
19633 $define|true|[yY]*)
19634 fflushNULL="$define"
19637 fflushNULL="$undef"
19640 : check explicit looping only if NULL did not work, and if the pipe
19641 : bug does not show up on an explicit flush too
19642 case "$fflushNULL" in
19644 $cat >tryp.c <<EOCP
19647 main(int argc, char **argv)
19653 while ((i = getc(stdin)) != -1
19654 && (*bp++ = i) != '\n'
19655 && bp < &buf[1024])
19658 fprintf(stdout, "%s", buf);
19667 if eval $compile; then
19669 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19670 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19672 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19674 : now check for fflushall behaviour
19675 case "$fflushall" in
19676 '') set try -DTRY_FFLUSH_ALL $output
19677 if eval $compile; then
19679 (Now testing the other method--but note that this also may fail.)
19681 $run ./try 2>/dev/null
19684 if $test -s try.out -a "X$code" = X42; then
19685 fflushall="`$cat try.out`"
19689 case "$fflushall" in
19691 Whew. Flushing explicitly all the stdio streams works.
19693 fflushall="$define"
19696 Sigh. Flushing explicitly all the stdio streams doesn't work.
19701 Cannot figure out whether flushing stdio streams explicitly works or not.
19702 I'm assuming it doesn't.
19708 "$define"|true|[yY]*)
19709 fflushall="$define"
19717 All is futile. Even fflush(stdin) clobbers input pipes!
19724 $rm -f core tryp.c tryp.core core.tryp.*
19726 *) fflushall="$undef"
19730 case "$fflushNULL$fflushall" in
19733 OK, I give up. I cannot figure out how to flush pending stdio output.
19734 We won't be flushing handles at all before fork/exec/popen.
19740 : Store the full pathname to the ar program for use in the C program
19741 : Respect a hint or command line value for full_ar.
19746 : Store the full pathname to the sed program for use in the C program
19749 : see what type gids are declared as in the kernel
19751 echo "Looking for the type for group ids returned by getgid()."
19752 set gid_t gidtype xxx stdio.h sys/types.h
19756 xxx=`./findhdr sys/user.h`
19757 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19759 unsigned) dflt="$1 $2" ;;
19763 *) dflt="$gidtype";;
19766 gid_t) echo "gid_t found." ;;
19767 *) rp="What is the type for group ids returned by getgid()?"
19773 : Check the size of GID
19776 *_t) zzz="$gidtype" ;;
19779 echo "Checking the size of $zzz..." >&4
19781 #include <sys/types.h>
19783 #$i_stdlib I_STDLIB
19785 #include <stdlib.h>
19788 printf("%d\n", (int)sizeof($gidtype));
19793 if eval $compile_ok; then
19797 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19800 echo "Your $zzz is $gidsize bytes long."
19805 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19809 : Check if GID is signed
19812 *_t) zzz="$gidtype" ;;
19815 echo "Checking the sign of $zzz..." >&4
19817 #include <sys/types.h>
19828 if eval $compile; then
19832 echo "(I can't execute the test program--guessing unsigned.)" >&4
19836 1) echo "Your $zzz is unsigned." ;;
19837 -1) echo "Your $zzz is signed." ;;
19843 echo "(I can't compile the test program--guessing unsigned.)" >&4
19847 : Check 64bit sizes
19850 if $test X"$quadtype" != X; then
19852 echo "Checking how to print 64-bit integers..." >&4
19854 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19855 $cat >try.c <<'EOCP'
19856 #include <sys/types.h>
19859 int q = 12345678901;
19860 printf("%ld\n", q);
19864 if eval $compile; then
19868 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19869 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19870 echo "We will use %d."
19876 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19877 $cat >try.c <<'EOCP'
19878 #include <sys/types.h>
19881 long q = 12345678901;
19882 printf("%ld\n", q);
19886 if eval $compile; then
19890 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19891 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19892 echo "We will use %ld."
19898 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19899 $cat >try.c <<'EOCP'
19900 #include <sys/types.h>
19901 #include <inttypes.h>
19904 int64_t q = 12345678901;
19905 printf("%" PRId64 "\n", q);
19909 if eval $compile; then
19913 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19914 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19915 echo "We will use the C9X style."
19921 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19923 #include <sys/types.h>
19926 $quadtype q = 12345678901;
19927 printf("%Ld\n", q);
19931 if eval $compile; then
19935 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19936 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19937 echo "We will use %Ld."
19943 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19944 $cat >try.c <<'EOCP'
19945 #include <sys/types.h>
19948 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19949 printf("%lld\n", q);
19953 if eval $compile; then
19957 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19958 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19959 echo "We will use the %lld style."
19965 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19967 #include <sys/types.h>
19970 $quadtype q = 12345678901;
19971 printf("%qd\n", q);
19975 if eval $compile; then
19979 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19980 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19981 echo "We will use %qd."
19987 if $test X"$sPRId64" = X; then
19988 echo "Cannot figure out how to print 64-bit integers." >&4
19995 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19996 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19998 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19999 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20003 : Check format strings for internal types
20005 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20007 if $test X"$ivsize" = X8; then
20008 ivdformat="$sPRId64"
20009 uvuformat="$sPRIu64"
20010 uvoformat="$sPRIo64"
20011 uvxformat="$sPRIx64"
20012 uvXUformat="$sPRIXU64"
20014 if $test X"$ivsize" = X"$longsize"; then
20021 if $test X"$ivsize" = X"$intsize"; then
20029 if $test X"$ivsize" = X"$shortsize"; then
20040 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20041 nveformat="$sPRIeldbl"
20042 nvfformat="$sPRIfldbl"
20043 nvgformat="$sPRIgldbl"
20044 nvEUformat="$sPRIEUldbl"
20045 nvFUformat="$sPRIFUldbl"
20046 nvGUformat="$sPRIGUldbl"
20056 case "$ivdformat" in
20057 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20062 : Check format string for GID
20065 $echo "Checking the format string to be used for gids..." >&4
20068 -1) if $test X"$gidsize" = X"$ivsize"; then
20069 gidformat="$ivdformat"
20071 if $test X"$gidsize" = X"$longsize"; then
20074 if $test X"$gidsize" = X"$intsize"; then
20077 if $test X"$gidsize" = X"$shortsize"; then
20084 *) if $test X"$gidsize" = X"$uvsize"; then
20085 gidformat="$uvuformat"
20087 if $test X"$gidsize" = X"$longsize"; then
20090 if $test X"$gidsize" = X"$intsize"; then
20093 if $test X"$gidsize" = X"$shortsize"; then
20102 : see if getgroups exists
20103 set getgroups d_getgrps
20106 : see if setgroups exists
20107 set setgroups d_setgrps
20110 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20112 case "$d_getgrps$d_setgrps" in
20114 case "$groupstype" in
20115 '') dflt="$gidtype" ;;
20116 *) dflt="$groupstype" ;;
20119 What type of pointer is the second argument to getgroups() and setgroups()?
20120 Usually this is the same as group ids, $gidtype, but not always.
20123 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20127 *) groupstype="$gidtype";;
20130 : MAD = Misc Attribute Definition
20132 if $test $patchlevel -lt 9; then
20133 : MAD is not available in 5.8.x or earlier.
20137 $define|true|[yY]*) dflt='y' ;;
20142 Would you like to build with Misc Attribute Decoration? This is development
20143 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20144 overhead on the interpreter.
20146 If this doesn't make any sense to you, just accept the default '$dflt'.
20148 rp='Build Perl with MAD?'
20153 madlyh='madly.h madly.act madly.tab'
20155 madlyobj="madly$_o" ;;
20164 : check whether make sets MAKE
20166 echo "Checking if your $make program sets \$(MAKE)..." >&4
20167 case "$make_set_make" in
20169 $sed 's/^X //' > testmake.mak << 'EOF'
20171 X @echo 'maketemp="$(MAKE)"'
20173 case "`$make -f testmake.mak 2>/dev/null`" in
20174 *maketemp=*) make_set_make='#' ;;
20175 *) make_set_make="MAKE=$make" ;;
20177 $rm -f testmake.mak
20180 case "$make_set_make" in
20181 '#') echo "Yup, it does.";;
20182 *) echo "Nope, it doesn't.";;
20185 : see what type is used for mode_t
20186 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20187 set mode_t modetype int stdio.h sys/types.h
20190 : see if we need va_copy
20192 case "$i_stdarg" in
20195 #include <stdarg.h>
20197 #$i_stdlib I_STDLIB
20199 #include <stdlib.h>
20201 #include <signal.h>
20204 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20206 return vfprintf(f, fmt, *valp);
20210 myvfprintf(FILE *f, const char *fmt, va_list val)
20212 return ivfprintf(f, fmt, &val);
20216 myprintf(char *fmt, ...)
20219 va_start(val, fmt);
20220 return myvfprintf(stdout, fmt, val);
20224 main(int ac, char **av)
20226 signal(SIGSEGV, exit);
20228 myprintf("%s%cs all right, then\n", "that", '\'');
20233 if eval $compile && $run ./try 2>&1 >/dev/null; then
20234 case "`$run ./try`" in
20235 "that's all right, then")
20241 yes) echo "It seems that you don't need va_copy()." >&4
20242 need_va_copy="$undef"
20244 *) echo "It seems that va_copy() or similar will be needed." >&4
20245 need_va_copy="$define"
20250 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20254 : see what type is used for size_t
20255 rp="What is the type used for the length parameter for string functions?"
20256 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20259 : check for type of arguments to gethostbyaddr.
20260 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20261 case "$d_gethbyaddr" in
20265 Checking to see what type of arguments are accepted by gethostbyaddr().
20267 hdrs="$define sys/types.h
20268 $d_socket sys/socket.h
20269 $i_niin netinet/in.h
20271 $i_unistd unistd.h"
20272 : The first arg can 'char *' or 'void *'
20273 : The second arg is some of integral type
20274 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20275 for yyy in size_t long int; do
20276 case "$netdb_host_type" in
20277 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20278 if ./protochk "$try" $hdrs; then
20279 echo "Your system accepts $xxx for the first arg."
20280 echo "...and $yyy for the second arg."
20281 netdb_host_type="$xxx"
20282 netdb_hlen_type="$yyy"
20288 : In case none of those worked, prompt the user.
20289 case "$netdb_host_type" in
20290 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20293 netdb_host_type=$ans
20294 rp='What is the type for the 2nd argument to gethostbyaddr?'
20297 netdb_hlen_type=$ans
20301 *) : no gethostbyaddr, so pick harmless defaults
20302 netdb_host_type='char *'
20303 netdb_hlen_type="$sizetype"
20306 # Remove the "const" if needed. -- but then we'll have a
20308 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20311 : check for type of argument to gethostbyname.
20312 if test "X$netdb_name_type" = X ; then
20313 case "$d_gethbyname" in
20317 Checking to see what type of argument is accepted by gethostbyname().
20319 hdrs="$define sys/types.h
20320 $d_socket sys/socket.h
20321 $i_niin netinet/in.h
20323 $i_unistd unistd.h"
20324 for xxx in "const char *" "char *"; do
20325 case "$netdb_name_type" in
20326 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20327 if ./protochk "$try" $hdrs; then
20328 echo "Your system accepts $xxx."
20329 netdb_name_type="$xxx"
20334 : In case none of those worked, prompt the user.
20335 case "$netdb_name_type" in
20336 '') rp='What is the type for the 1st argument to gethostbyname?'
20339 netdb_name_type=$ans
20343 *) : no gethostbyname, so pick harmless default
20344 netdb_name_type='char *'
20349 : check for type of 1st argument to getnetbyaddr.
20350 if test "X$netdb_net_type" = X ; then
20351 case "$d_getnbyaddr" in
20355 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20357 hdrs="$define sys/types.h
20358 $d_socket sys/socket.h
20359 $i_niin netinet/in.h
20361 $i_unistd unistd.h"
20362 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20363 case "$netdb_net_type" in
20364 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20365 if ./protochk "$try" $hdrs; then
20366 echo "Your system accepts $xxx."
20367 netdb_net_type="$xxx"
20372 : In case none of those worked, prompt the user.
20373 case "$netdb_net_type" in
20374 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20377 netdb_net_type=$ans
20381 *) : no getnetbyaddr, so pick harmless default
20382 netdb_net_type='long'
20386 : locate the preferred pager for this system
20393 [a-zA-Z]:/*) dflt=$pg;;
20397 [a-zA-Z]:/*) dflt=$more;;
20401 [a-zA-Z]:/*) dflt=$less;;
20404 '') dflt=/usr/ucb/more;;
20412 rp='What pager is used on your system?'
20416 : see what type pids are declared as in the kernel
20417 rp="What is the type of process ids on this system?"
20418 set pid_t pidtype int stdio.h sys/types.h
20421 : see if ar generates random libraries by itself
20423 echo "Checking how to generate random libraries on your machine..." >&4
20424 echo 'int bar1() { return bar2(); }' > bar1.c
20425 echo 'int bar2() { return 2; }' > bar2.c
20427 #$i_stdlib I_STDLIB
20429 #include <stdlib.h>
20431 int main() { printf("%d\n", bar1()); exit(0); }
20433 $cc $ccflags -c bar1.c >/dev/null 2>&1
20434 $cc $ccflags -c bar2.c >/dev/null 2>&1
20435 $cc $ccflags -c foo.c >/dev/null 2>&1
20436 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20437 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20438 $run ./foobar >/dev/null 2>&1; then
20439 echo "$ar appears to generate random libraries itself."
20441 if [ "X$ranlib" = "X" ]; then
20444 elif $ar s bar$_a >/dev/null 2>&1 &&
20445 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20446 $run ./foobar >/dev/null 2>&1; then
20447 echo "a table of contents needs to be added with '$ar s'."
20450 elif $ar ts bar$_a >/dev/null 2>&1 &&
20451 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20452 $run ./foobar >/dev/null 2>&1; then
20453 echo "a table of contents needs to be added with '$ar ts'."
20460 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20461 $test -f $ranlib || ranlib=''
20464 if $test -n "$ranlib"; then
20465 echo "your system has '$ranlib'; we'll use that."
20468 echo "your system doesn't seem to support random libraries"
20469 echo "so we'll use lorder and tsort to order the libraries."
20476 : see if this is a values.h system
20477 set values.h i_values
20480 : Check the max offset that gmtime and localtime accept
20481 echo "Checking max offsets that gmtime () accepts"
20484 define) yyy="#include <values.h>" ;;
20488 case "$sGMTIME_min/$sGMTIME_max" in
20491 #include <sys/types.h>
20500 void gm_check (time_t t, int min_year, int max_year)
20503 if ( tmp == NULL ||
20504 /* Check tm_year overflow */
20505 tmp->tm_year < min_year || tmp->tm_year > max_year)
20516 gm_check (MAXLONG, 69, 0x7fffffff);
20518 if (tmp == NULL || tmp->tm_year < 0) {
20519 for (i = 63; i >= 0; i--) {
20520 time_t x = pt | ((time_t)1 << i);
20521 if (x < 0 || x < pt) continue;
20522 gm_check (x, 69, 0x7fffffff);
20525 printf ("sGMTIME_max=%ld\n", pt);
20534 gm_check (MINLONG, -1900, 70);
20537 for (i = 36; i >= 0; i--) {
20538 time_t x = pt - ((time_t)1 << i);
20539 if (x > 0) continue;
20540 gm_check (x, -1900, 70);
20543 printf ("sGMTIME_min=%ld\n", pt);
20547 int main (int argc, char *argv[])
20549 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20556 if eval $compile; then
20559 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20565 echo "Checking max offsets that localtime () accepts"
20567 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20570 #include <sys/types.h>
20579 void local_check (time_t t, int min_year, int max_year)
20581 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20584 tmp = localtime (&t);
20585 if ( tmp == NULL ||
20586 /* Check tm_year overflow */
20587 tmp->tm_year < min_year || tmp->tm_year > max_year)
20591 } /* local_check */
20598 local_check (MAXLONG, 69, 0x7fffffff);
20600 if (tmp == NULL || tmp->tm_year < 0) {
20601 for (i = 63; i >= 0; i--) {
20602 time_t x = pt | ((time_t)1 << i);
20603 if (x < 0 || x < pt) continue;
20604 local_check (x, 69, 0x7fffffff);
20607 printf ("sLOCALTIME_max=%ld\n", pt);
20616 local_check (MINLONG, -1900, 70);
20619 for (i = 36; i >= 0; i--) {
20620 time_t x = pt - ((time_t)1 << i);
20621 if (x > 0) continue;
20622 local_check (x, -1900, 70);
20625 printf ("sLOCALTIME_min=%ld\n", pt);
20629 int main (int argc, char *argv[])
20637 if eval $compile; then
20640 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20646 : check for type of arguments to select.
20647 case "$selecttype" in
20648 '') case "$d_select" in
20652 Checking to see what type of arguments are accepted by select().
20654 hdrs="$define sys/types.h
20655 $i_systime sys/time.h
20656 $i_sysselct sys/select.h
20657 $d_socket sys/socket.h"
20658 : The first arg can be int, unsigned, or size_t
20659 : The last arg may or may not be 'const'
20661 : void pointer has been seen but using that
20662 : breaks the selectminbits test
20663 for xxx in 'fd_set *' 'int *'; do
20664 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20665 for tmo in 'struct timeval *' 'const struct timeval *'; do
20667 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20668 if ./protochk "$try" $hdrs; then
20669 echo "Your system accepts $xxx."
20678 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20679 case "$d_fd_set" in
20680 $define) dflt="fd_set *" ;;
20689 *) : no select, so pick a harmless default
20696 : check for the select 'width'
20697 case "$selectminbits" in
20698 '') safebits=`expr $ptrsize \* 8`
20699 case "$d_select" in
20703 Checking to see on how many bits at a time your select() operates...
20706 #include <sys/types.h>
20708 #$i_systime I_SYS_TIME
20709 #$i_systimek I_SYS_TIME_KERNEL
20714 # ifdef I_SYS_TIME_KERNEL
20717 # include <sys/time.h>
20718 # ifdef I_SYS_TIME_KERNEL
20722 #$i_sysselct I_SYS_SELECT
20723 #ifdef I_SYS_SELECT
20724 #include <sys/select.h>
20726 #$d_socket HAS_SOCKET
20728 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20731 #$i_stdlib I_STDLIB
20733 #include <stdlib.h>
20736 #define S sizeof(*(b))
20738 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20739 #define NBITS (NBYTES * 8)
20741 char *s = (char *)malloc(NBYTES);
20750 fp = fopen("try.c", "r");
20756 b = ($selecttype)s;
20757 for (i = 0; i < NBITS; i++)
20761 select(fd + 1, b, 0, 0, &t);
20762 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20764 printf("%d\n", i + 1);
20769 if eval $compile_ok; then
20770 selectminbits=`$run ./try`
20771 case "$selectminbits" in
20773 Cannot figure out on how many bits at a time your select() operates.
20774 I'll play safe and guess it is $safebits bits.
20776 selectminbits=$safebits
20777 bits="$safebits bits"
20780 *) bits="$selectminbits bits" ;;
20782 echo "Your select() operates on $bits at a time." >&4
20784 rp='What is the minimum number of bits your select() operates on?'
20785 case "$byteorder" in
20786 12345678) dflt=64 ;;
20792 selectminbits="$val"
20796 *) : no select, so pick a harmless default
20797 selectminbits=$safebits
20803 : Trace out the files included by signal.h, then look for SIGxxx names.
20804 if [ "X$fieldn" = X ]; then
20805 : Just make some guesses. We check them later.
20806 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20808 xxx=`echo '#include <signal.h>' |
20809 $cppstdin $cppminus $cppflags 2>/dev/null |
20810 $grep '^[ ]*#.*include' |
20811 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20812 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20815 for xx in $xxx /dev/null ; do
20816 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20818 case "$xxxfiles" in
20819 '') xxxfiles=`./findhdr signal.h` ;;
20822 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20823 print substr($2, 4, 20)
20825 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20826 print substr($3, 4, 20)
20828 : Append some common names just in case the awk scan failed.
20829 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20830 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20831 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20832 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20833 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20835 : generate a few handy files for later
20836 $cat > signal.c <<EOCP
20837 #include <sys/types.h>
20838 #include <signal.h>
20839 #$i_stdlib I_STDLIB
20841 #include <stdlib.h>
20846 /* Strange style to avoid deeply-nested #if/#else/#endif */
20849 # define NSIG (_NSIG)
20855 # define NSIG (SIGMAX+1)
20861 # define NSIG (SIG_MAX+1)
20867 # define NSIG (_SIG_MAX+1)
20873 # define NSIG (MAXSIG+1)
20879 # define NSIG (MAX_SIG+1)
20884 # ifdef SIGARRAYSIZE
20885 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20891 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20895 /* Default to some arbitrary number that's big enough to get most
20896 of the common signals.
20902 printf("NSIG %d\n", NSIG);
20908 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20910 printf "#ifdef SIG"; printf $1; printf "\n"
20911 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20912 printf $1; printf ");\n"
20916 printf "#endif /* JUST_NSIG */\n";
20917 printf "exit(0);\n}\n";
20920 $cat >signal.awk <<'EOP'
20921 BEGIN { ndups = 0 }
20922 $1 ~ /^NSIG$/ { nsig = $2 }
20923 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20924 if ($2 > maxsig) { maxsig = $2 }
20925 if (sig_name[$2]) {
20926 dup_name[ndups] = $1
20927 dup_num[ndups] = $2
20939 printf("NSIG %d\n", nsig);
20940 for (n = 1; n < nsig; n++) {
20942 printf("%s %d\n", sig_name[n], sig_num[n])
20945 printf("NUM%d %d\n", n, n)
20948 for (n = 0; n < ndups; n++) {
20949 printf("%s %d\n", dup_name[n], dup_num[n])
20953 $cat >signal_cmd <<EOS
20955 if $test -s signal.lst; then
20956 echo "Using your existing signal.lst file"
20961 $cat >>signal_cmd <<'EOS'
20964 if eval $compile_ok; then
20965 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20966 $uniq | $awk -f signal.awk >signal.lst
20968 echo "(I can't seem be able to compile the whole test program)" >&4
20969 echo "(I'll try it in little pieces.)" >&4
20970 set signal -DJUST_NSIG
20971 if eval $compile_ok; then
20972 $run ./signal$_exe > signal.nsg
20975 echo "I can't seem to figure out how many signals you have." >&4
20976 echo "Guessing 50." >&4
20977 echo 'NSIG 50' > signal.nsg
20979 : Now look at all the signal names, one at a time.
20980 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20981 $cat > signal.c <<EOCP
20982 #include <sys/types.h>
20983 #include <signal.h>
20986 printf("$xx %d\n", SIG${xx});
20991 if eval $compile; then
20992 echo "SIG${xx} found."
20993 $run ./signal$_exe >> signal.ls1
20995 echo "SIG${xx} NOT found."
20998 if $test -s signal.ls1; then
20999 $cat signal.nsg signal.ls1 |
21000 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21004 if $test -s signal.lst; then
21007 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21008 echo 'kill -l' >signal
21009 set X `csh -f <signal`
21013 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21015 echo $@ | $tr ' ' $trnl | \
21016 $awk '{ printf "%s %d\n", $1, ++s; }
21017 END { printf "NSIG %d\n", ++s }' >signal.lst
21019 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21021 chmod a+x signal_cmd
21022 $eunicefix signal_cmd
21024 : generate list of signal names
21026 case "$sig_name_init" in
21028 *) case "$sig_num_init" in
21029 ''|*,*) doinit=yes ;;
21034 echo "Generating a list of signal names and numbers..." >&4
21036 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21037 sig_name=`$awk 'BEGIN { printf "ZERO " }
21038 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21039 sig_num=`$awk 'BEGIN { printf "0 " }
21040 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21041 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21042 !/^NSIG/ { printf "\"%s\", ", $1 }
21043 END { printf "0\n" }' signal.lst`
21044 sig_num_init=`$awk 'BEGIN { printf "0, " }
21045 !/^NSIG/ { printf "%d, ", $2}
21046 END { printf "0\n"}' signal.lst`
21049 echo "The following $sig_count signals are available:"
21051 echo $sig_name | $awk \
21052 'BEGIN { linelen = 0 }
21054 for (i = 1; i <= NF; i++) {
21055 name = "SIG" $i " "
21056 linelen = linelen + length(name)
21057 if (linelen > 70) {
21059 linelen = length(name)
21065 sig_size=`echo $sig_name | awk '{print NF}'`
21066 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21068 : Check size of size
21070 case "$sizetype" in
21071 *_t) zzz="$sizetype" ;;
21072 *) zzz="filesize" ;;
21074 echo "Checking the size of $zzz..." >&4
21076 #include <sys/types.h>
21078 #$i_stdlib I_STDLIB
21080 #include <stdlib.h>
21083 printf("%d\n", (int)sizeof($sizetype));
21088 if eval $compile_ok; then
21092 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21095 echo "Your $zzz size is $sizesize bytes."
21100 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21104 : check for socklen_t
21106 echo "Checking to see if you have socklen_t..." >&4
21108 #include <sys/types.h>
21109 #$d_socket HAS_SOCKET
21111 #include <sys/socket.h>
21113 int main() { socklen_t x = 16; }
21116 if eval $compile; then
21118 echo "You have socklen_t."
21121 echo "You do not have socklen_t."
21122 case "$sizetype" in
21123 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21130 : see if this is a socks.h system
21131 set socks.h i_socks
21134 : check for type of the size argument to socket calls
21135 case "$d_socket" in
21139 Checking to see what type is the last argument of accept().
21142 case "$d_socklen_t" in
21143 "$define") yyy="$yyy socklen_t"
21145 yyy="$yyy $sizetype int long unsigned"
21146 for xxx in $yyy; do
21147 case "$socksizetype" in
21148 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21149 case "$usesocks" in
21151 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21152 echo "Your system accepts '$xxx *' for the last argument of accept()."
21153 socksizetype="$xxx"
21156 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21157 echo "Your system accepts '$xxx *' for the last argument of accept()."
21158 socksizetype="$xxx"
21165 : In case none of those worked, prompt the user.
21166 case "$socksizetype" in
21167 '') rp='What is the type for socket address structure sizes?'
21174 *) : no sockets, so pick relatively harmless default
21179 : see what type is used for signed size_t
21180 set ssize_t ssizetype int stdio.h sys/types.h
21185 #$i_stdlib I_STDLIB
21187 #include <stdlib.h>
21189 #include <sys/types.h>
21190 #define Size_t $sizetype
21191 #define SSize_t $dflt
21194 if (sizeof(Size_t) == sizeof(SSize_t))
21196 else if (sizeof(Size_t) == sizeof(int))
21205 if eval $compile_ok && $run ./try > /dev/null; then
21206 ssizetype=`$run ./try`
21207 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21210 Help! I can't compile and run the ssize_t test program: please enlighten me!
21211 (This is probably a misconfiguration in your system or libraries, and
21212 you really ought to fix it. Still, I'll try anyway.)
21214 I need a type that is the same size as $sizetype, but is guaranteed to
21215 be signed. Common values are ssize_t, int and long.
21218 rp="What signed type is the same size as $sizetype?"
21224 : Check the size of st_ino
21226 $echo "Checking the size of st_ino..." >&4
21227 $cat > try.c <<EOCP
21228 #include <sys/stat.h>
21230 #$i_stdlib I_STDLIB
21232 #include <stdlib.h>
21236 printf("%d\n", (int)sizeof(st.st_ino));
21241 if eval $compile_ok; then
21245 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21247 *) st_ino_size=$val
21248 $echo "Your st_ino is $st_ino_size bytes long."
21253 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21257 : Check if st_ino is signed
21259 $echo "Checking the sign of st_ino..." >&4
21260 $cat > try.c <<EOCP
21261 #include <sys/stat.h>
21266 if (foo.st_ino < 0)
21273 if eval $compile; then
21277 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21279 *) st_ino_sign=$val
21280 case "$st_ino_sign" in
21281 1) $echo "Your st_ino is unsigned." ;;
21282 -1) $echo "Your st_ino is signed." ;;
21288 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21292 : see what type of char stdio uses.
21294 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21295 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21296 echo "Your stdio uses unsigned chars." >&4
21297 stdchar="unsigned char"
21299 echo "Your stdio uses signed chars." >&4
21304 : see what type uids are declared as in the kernel
21306 echo "Looking for the type for user ids returned by getuid()."
21307 set uid_t uidtype xxx stdio.h sys/types.h
21311 xxx=`./findhdr sys/user.h`
21312 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21314 unsigned) dflt="$1 $2" ;;
21318 *) dflt="$uidtype";;
21321 uid_t) echo "uid_t found." ;;
21322 *) rp="What is the type for user ids returned by getuid()?"
21328 : Check size of UID
21331 *_t) zzz="$uidtype" ;;
21334 echo "Checking the size of $zzz..." >&4
21336 #include <sys/types.h>
21338 #$i_stdlib I_STDLIB
21340 #include <stdlib.h>
21343 printf("%d\n", (int)sizeof($uidtype));
21348 if eval $compile_ok; then
21352 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21355 echo "Your $zzz is $uidsize bytes long."
21360 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21363 : Check if UID is signed
21366 *_t) zzz="$uidtype" ;;
21369 echo "Checking the sign of $zzz..." >&4
21371 #include <sys/types.h>
21382 if eval $compile; then
21386 echo "(I can't execute the test program--guessing unsigned.)" >&4
21390 1) echo "Your $zzz is unsigned." ;;
21391 -1) echo "Your $zzz is signed." ;;
21397 echo "(I can't compile the test program--guessing unsigned.)" >&4
21401 : Check format string for UID
21403 $echo "Checking the format string to be used for uids..." >&4
21406 -1) if $test X"$uidsize" = X"$ivsize"; then
21407 uidformat="$ivdformat"
21409 if $test X"$uidsize" = X"$longsize"; then
21412 if $test X"$uidsize" = X"$intsize"; then
21415 if $test X"$uidsize" = X"$shortsize"; then
21422 *) if $test X"$uidsize" = X"$uvsize"; then
21423 uidformat="$uvuformat"
21425 if $test X"$uidsize" = X"$longsize"; then
21428 if $test X"$uidsize" = X"$intsize"; then
21431 if $test X"$uidsize" = X"$shortsize"; then
21440 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21442 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21443 $cat >try.c <<'EOM'
21444 /* Intentionally a long probe as I'd like to sanity check that the exact
21445 approach is going to work, as thinking it will work, but only having it
21446 part working at runtime is worse than not having it. */
21448 #include <sys/types.h>
21449 #include <sys/sysctl.h>
21450 #include <sys/param.h>
21452 #include <string.h>
21453 #include <stdlib.h>
21454 #include <unistd.h>
21457 main(int argc, char **argv) {
21459 char *argv_leaf = strrchr(argv[0], '/');
21465 mib[1] = KERN_PROC;
21466 mib[2] = KERN_PROC_PATHNAME;
21470 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21474 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21479 if (size < strlen(argv_leaf) + 1) {
21480 fprintf(stderr, "size %lu is too short for a path\n",
21481 (unsigned long) size);
21485 if (size > MAXPATHLEN * MAXPATHLEN) {
21486 fprintf(stderr, "size %lu is too long for a path\n",
21487 (unsigned long) size);
21491 buffer = malloc(size);
21497 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21502 if (strlen(buffer) + 1 != size) {
21503 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21504 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21509 if (*buffer != '/') {
21510 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21514 if (strstr(buffer, "/./")) {
21515 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21519 if (strstr(buffer, "/../")) {
21520 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21524 buffer_leaf = strrchr(buffer, '/');
21525 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21526 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21538 if eval $compile; then
21539 if $run ./try; then
21540 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21543 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21547 echo "I'm unable to compile the test program." >&4
21548 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21552 set usekernprocpathname
21555 : Determine if we can use _NSGetExecutablePath to find executing program
21557 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21558 $cat >try.c <<'EOM'
21559 /* Intentionally a long probe as I'd like to sanity check that the exact
21560 approach is going to work, as thinking it will work, but only having it
21561 part working at runtime is worse than not having it. */
21562 #include <mach-o/dyld.h>
21564 #include <stdlib.h>
21565 #include <sys/param.h>
21566 #include <string.h>
21569 main(int argc, char **argv) {
21571 uint32_t size = sizeof(buf);
21575 char *argv_leaf = strrchr(argv[0], '/');
21579 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21583 _NSGetExecutablePath(buf, &size);
21584 if (size > MAXPATHLEN * MAXPATHLEN) {
21585 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21586 (unsigned int) size);
21590 buffer = malloc(size);
21596 result = _NSGetExecutablePath(buffer, &size);
21598 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21599 result, (unsigned int) size);
21603 tidied = realpath(buffer, NULL);
21605 perror("realpath");
21611 if (*tidied != '/') {
21612 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21616 if (strstr(tidied, "/./")) {
21617 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21621 if (strstr(tidied, "/../")) {
21622 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21626 tidied_leaf = strrchr(tidied, '/');
21627 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21628 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21640 if eval $compile; then
21641 if $run ./try; then
21642 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21645 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21648 echo "I'm unable to compile the test program." >&4
21649 echo "I'll assume no _NSGetExecutablePath here." >&4
21652 set usensgetexecutablepath
21655 : Check if site customization support was requested
21656 case "$usesitecustomize" in
21657 $define|true|[Yy]*)
21658 usesitecustomize="$define"
21661 usesitecustomize="$undef"
21665 : see if prototypes support variable argument declarations
21667 case "$prototype$i_stdarg" in
21669 echo "It appears we'll be able to prototype varargs functions." >&4
21673 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21680 : determine compiler compiler
21689 if $test -f "$byacc$_exe"; then
21691 comp="byacc or $comp"
21693 if $test -f "$bison$_exe"; then
21694 comp="$comp or bison -y"
21696 rp="Which compiler compiler ($comp) shall I use?"
21705 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21711 : see if this is a assert.h system
21712 set assert.h i_assert
21715 : see if this is a fp.h system
21719 : see if this is a fp_class.h system
21720 set fp_class.h i_fp_class
21723 : see if gdbm.h is available
21728 : see if gdbm_open exists
21729 set gdbm_open d_gdbm_open
21731 case "$d_gdbm_open" in
21734 echo "We won't be including <gdbm.h>"
21743 : see if this is a ieeefp.h system
21744 case "$i_ieeefp" in
21745 '' ) set ieeefp.h i_ieeefp
21750 : see if this is a libutil.h system
21751 set libutil.h i_libutil
21754 : see if mach cthreads are available
21755 if test "X$usethreads" = "X$define"; then
21756 set mach/cthreads.h i_machcthr
21759 i_machcthr="$undef"
21762 : see if this is a mntent.h system
21763 set mntent.h i_mntent
21766 : see if net/errno.h is available
21768 set net/errno.h val
21771 : Unfortunately, it causes problems on some systems. Arrgh.
21774 cat > try.c <<'EOM'
21777 #include <net/errno.h>
21783 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21784 echo "We'll be including <net/errno.h>." >&4
21786 echo "We won't be including <net/errno.h>." >&4
21795 : see if netinet/tcp.h is available
21796 set netinet/tcp.h i_netinettcp
21799 : see if this is a poll.h system
21803 : see if this is a prot.h system
21807 : Preprocessor symbols
21809 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21810 $cat <<'EOSH' > Cppsym.know
21811 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21812 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21813 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21814 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21815 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21816 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21817 bull c cadmus clipper CMU COFF COMPILER_VERSION
21818 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21819 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21820 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21821 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21823 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21824 H3050R H3050RX hbullx20 hcx host_mips
21825 hp200 hp300 hp700 HP700 hp800 hp9000
21826 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21827 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21828 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21829 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21830 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21831 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21832 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21833 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21834 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21835 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21836 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21837 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21838 MATH_HAS_NO_SIDE_EFFECTS
21839 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21840 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21841 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21842 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21843 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21844 NetBSD news1500 news1700 news1800 news1900 news3700
21845 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21846 ns32016 ns32332 ns32k nsc32000
21847 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21848 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21849 pc532 pdp11 PGC PIC plexus PORTAR posix
21850 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21851 POSIX_C_SOURCE POSIX_SOURCE POWER
21852 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21853 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21854 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21855 sony sony_news sonyrisc sparc sparclite spectrum
21856 stardent stdc STDC_EXT stratos sun sun3 sun386
21857 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21858 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21859 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21860 sysV68 sysV88 Tek4132 Tek4300 titan
21861 TM3200 TM5400 TM5600
21862 tower tower32 tower32_200 tower32_600 tower32_700
21863 tower32_800 tower32_850 tss
21864 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21865 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21866 unix UNIX95 UNIX99 unixpc unos
21867 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21868 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21869 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21871 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21872 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21873 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21876 # Maybe put other stuff here too.
21877 cat <<EOSH >>Cppsym.know
21880 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21881 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21882 $cat Cppsym.know > Cppsym.c
21883 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21884 $rm -f Cppsym.a Cppsym.b Cppsym.c
21885 cat <<EOSH > Cppsym
21887 if $test \$# -gt 0; then
21888 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21889 if $test -s Cppsym.got; then
21896 $tr " " "$trnl" | ./Cppsym.try
21902 cat <<EOSH > Cppsym.try
21904 cat <<'EOCP' > try.c
21907 #define STRINGIFY(a) "a"
21909 #if cpp_stuff == 42
21910 #define StGiFy(a) #a
21911 #define STRINGIFY(a) StGiFy(a)
21913 #if $cpp_stuff != 1 && $cpp_stuff != 42
21914 # include "Bletch: How does this C preprocessor stringify macros?"
21920 cat <<'EOSH' >> Cppsym.try
21922 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21923 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21924 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21925 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21927 echo 'return 0;}' >> try.c
21929 cat <<EOSH >> Cppsym.try
21931 case "$osname-$gccversion" in
21932 irix-) ccflags="\$ccflags -woff 1178" ;;
21933 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21935 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21937 chmod +x Cppsym.try
21938 $eunicefix Cppsym.try
21939 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21940 : Add in any linux cpp "predefined macros":
21941 case "$osname::$gccversion" in
21942 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21944 rm -f $tHdrH'.h' $tHdrH
21946 # Filter out macro arguments, such as Linux's __INT8_C(c)
21947 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21948 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21949 if [ -s $tHdrH'_cppsym.real' ]; then
21950 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21953 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21956 : now check the C compiler for additional symbols
21957 postprocess_cc_v=''
21959 aix) postprocess_cc_v="|$tr , ' '" ;;
21966 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21969 -D*) echo "\$i" | $sed 's/^-D//';;
21970 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21975 postprocess_cc_v=''
21978 ./ccsym > ccsym1.raw
21979 if $test -s ccsym1.raw; then
21980 $sort ccsym1.raw | $uniq >ccsym.raw
21982 mv ccsym1.raw ccsym.raw
21985 $awk '/\=/ { print $0; next }
21986 { print $0"=1" }' ccsym.raw >ccsym.list
21987 $comm -13 Cppsym.true ccsym.list >ccsym.own
21988 $comm -12 Cppsym.true ccsym.list >ccsym.com
21989 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21991 if $test -z ccsym.raw; then
21992 echo "Your C compiler doesn't seem to define any symbols!" >&4
21994 echo "However, your C preprocessor defines the following symbols:"
21997 cppsymbols=`$cat Cppsym.true`
21998 cppsymbols=`echo $cppsymbols`
21999 cppccsymbols="$cppsymbols"
22001 if $test -s ccsym.com; then
22002 echo "Your C compiler and pre-processor define these symbols:"
22003 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22006 cppccsymbols=`$cat ccsym.com`
22007 cppccsymbols=`echo $cppccsymbols`
22008 $test "$silent" || sleep 1
22010 if $test -s ccsym.cpp; then
22011 $test "$also" && echo " "
22012 echo "Your C pre-processor ${also}defines the following symbols:"
22013 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22015 cppsymbols=`$cat ccsym.cpp`
22016 cppsymbols=`echo $cppsymbols`
22017 $test "$silent" || sleep 1
22019 if $test -s ccsym.own; then
22020 $test "$also" && echo " "
22021 echo "Your C compiler ${also}defines the following cpp symbols:"
22022 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22023 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22024 ccsymbols=`$cat ccsym.own`
22025 ccsymbols=`echo $ccsymbols`
22026 $test "$silent" || sleep 1
22030 : see if this is a termio system
22034 if $test `./findhdr termios.h`; then
22035 set tcsetattr i_termios
22041 "$define") echo "You have POSIX termios.h... good!" >&4;;
22042 *) if ./Cppsym pyr; then
22043 case "`/bin/universe`" in
22044 ucb) if $test `./findhdr sgtty.h`; then
22046 echo "<sgtty.h> found." >&4
22048 echo "System is pyramid with BSD universe."
22049 ./warn "<sgtty.h> not found--you could have problems."
22051 *) if $test `./findhdr termio.h`; then
22053 echo "<termio.h> found." >&4
22055 echo "System is pyramid with USG universe."
22056 ./warn "<termio.h> not found--you could have problems."
22060 if $test `./findhdr termio.h`; then
22061 echo "<termio.h> found." >&4
22063 elif $test `./findhdr sgtty.h`; then
22064 echo "<sgtty.h> found." >&4
22067 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22070 if $test `./findhdr sgtty.h`; then
22071 echo "<sgtty.h> found." >&4
22073 elif $test `./findhdr termio.h`; then
22074 echo "<termio.h> found." >&4
22077 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22081 set i_termio; eval $setvar
22082 val=$val2; set i_sgtty; eval $setvar
22083 val=$val3; set i_termios; eval $setvar
22085 : see if stdbool is available
22086 : we want a real compile instead of Inhdr because some Solaris systems
22087 : have stdbool.h, but it can only be used if the compiler indicates it
22088 : is sufficiently c99-compliant.
22092 #include <stdbool.h>
22097 int main(int argc, char **argv)
22103 if eval $compile; then
22104 echo "<stdbool.h> found." >&4
22107 echo "<stdbool.h> NOT found." >&4
22114 : see if stddef is available
22115 set stddef.h i_stddef
22118 : see if sys/access.h is available
22119 set sys/access.h i_sysaccess
22122 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22123 set sys/filio.h i_sysfilio
22126 if $test `./findhdr sys/ioctl.h`; then
22128 echo '<sys/ioctl.h> found.' >&4
22131 if $test $i_sysfilio = "$define"; then
22132 echo '<sys/ioctl.h> NOT found.' >&4
22134 $test $i_sgtty = "$define" && xxx="sgtty.h"
22135 $test $i_termio = "$define" && xxx="termio.h"
22136 $test $i_termios = "$define" && xxx="termios.h"
22137 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22143 : see if socket ioctl defs are in sys/sockio.h
22145 xxx=`./findhdr sys/sockio.h`
22146 if $test "$xxx"; then
22147 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22149 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22152 echo "No socket ioctls found in <sys/sockio.h>." >&4
22157 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22163 : see if this is a syslog.h system
22164 set syslog.h i_syslog
22167 : see if this is a sys/mode.h system
22168 set sys/mode.h i_sysmode
22171 : see if there is a sys/poll.h file
22172 set sys/poll.h i_syspoll
22175 : see if sys/resource.h has to be included
22176 set sys/resource.h i_sysresrc
22179 : see if sys/security.h is available
22180 set sys/security.h i_syssecrt
22183 : see if this is a sys/statvfs.h system
22184 set sys/statvfs.h i_sysstatvfs
22187 : see if this is a sys/un.h system
22188 set sys/un.h i_sysun
22191 : see if this is a sys/utsname.h system
22192 set sys/utsname.h i_sysutsname
22195 : see if this is a syswait system
22196 set sys/wait.h i_syswait
22199 : see if this is a ustat.h system
22200 set ustat.h i_ustat
22203 : see if this is an utime system
22204 set utime.h i_utime
22207 : see if this is a vfork system
22210 set vfork.h i_vfork
22220 echo "Looking for extensions..." >&4
22221 : If we are using the old config.sh, known_extensions may contain
22222 : old or inaccurate or duplicate values.
22223 known_extensions=''
22224 nonxs_extensions=''
22225 : We do not use find because it might not be available.
22226 : We do not just use MANIFEST because the user may have dropped
22227 : some additional extensions into the source tree and expect them
22230 : Function to recursively find available extensions, ignoring DynaLoader
22231 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22232 : In 5.10.1 and later, extensions are stored in directories
22233 : like File-Glob instead of the older File/Glob/.
22237 DynaLoader|dynaload) ;;
22239 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22240 leaf=`echo $xxx | $sed -e s/.*-//`;
22241 if $test -d File; then
22242 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22243 known_extensions="$known_extensions $1$this_ext";
22244 elif $test -f $xxx/Makefile.PL; then
22245 nonxs_extensions="$nonxs_extensions $1$this_ext";
22247 if $test -d $xxx -a $# -lt 10; then
22250 eval $find_extensions;
22256 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22257 if $contains " $this_ext " $$.tmp; then
22259 echo "Duplicate directories detected for extension $xxx" >&4;
22260 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22261 case "$knowitall" in
22269 echo "Ok. Stopping Configure." >&4;
22270 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22273 echo "Ok. You will need to correct config.sh before running make." >&4;
22275 $ls -1 $xxx > $$.tmp;
22276 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22277 known_extensions="$known_extensions $this_ext";
22278 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22279 known_extensions="$known_extensions $this_ext";
22280 elif $test -d $xxx; then
22281 nonxs_extensions="$nonxs_extensions $this_ext";
22292 eval $find_extensions
22296 eval $find_extensions
22300 eval $find_extensions
22301 if $test -d File-Glob; then
22302 : All ext/ flattened
22304 # Special case: Add in modules that nest beyond the first level.
22305 # Currently threads/shared and Hash/Util/FieldHash, since they are
22306 # not picked up by the recursive find above (and adding in general
22307 # recursive finding breaks SDBM_File/sdbm).
22308 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22309 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22311 set X $known_extensions
22313 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22314 set X $nonxs_extensions
22316 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22319 : Now see which are supported on this system.
22321 for xxx in $known_extensions ; do
22325 $define) avail_ext="$avail_ext $xxx" ;;
22328 GDBM_File|gdbm_fil)
22330 $define) avail_ext="$avail_ext $xxx" ;;
22333 I18N/Langinfo|i18n_lan)
22334 case "$i_langinfo$d_nl_langinfo" in
22335 $define$define) avail_ext="$avail_ext $xxx" ;;
22339 : XXX Do we need a useipcsysv variable here
22340 case "${d_msg}${d_sem}${d_shm}" in
22341 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22344 NDBM_File|ndbm_fil)
22347 case "$osname-$use64bitint" in
22350 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22353 *) avail_ext="$avail_ext $xxx" ;;
22358 ODBM_File|odbm_fil)
22359 case "${i_dbm}${i_rpcsvcdbm}" in
22361 case "$d_cplusplus" in
22362 define) ;; # delete as a function name will not work
22363 *) case "$osname-$use64bitint" in
22366 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22369 *) avail_ext="$avail_ext $xxx" ;;
22377 case "$useopcode" in
22378 true|define|y) avail_ext="$avail_ext $xxx" ;;
22382 case "$useposix" in
22383 true|define|y) avail_ext="$avail_ext $xxx" ;;
22387 case "$d_socket" in
22390 beos) ;; # not unless BONE
22391 *) avail_ext="$avail_ext $xxx" ;;
22396 Sys/Syslog|sys/syslog)
22397 : XXX syslog requires socket
22398 case "$d_socket" in
22399 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22403 case "$usethreads" in
22405 case "$use5005threads" in
22406 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22410 threads|threads/shared)
22411 # threads and threads::shared are special cases.
22412 # To stop people from asking "Perl 5.8.0 was supposed
22413 # to have this new fancy threads implementation but my
22414 # perl doesn't have it" and from people trying to
22415 # (re)install the threads module using CPAN.pm and
22416 # CPAN.pm then offering to reinstall Perl 5.8.0,
22417 # the threads.pm and threads/shared.pm will always be
22418 # there, croaking informatively ("you need to rebuild
22419 # all of Perl with threads, sorry") when threads haven't
22420 # been compiled in.
22422 avail_ext="$avail_ext $xxx"
22428 cygwin) avail_ext="$avail_ext $xxx" ;;
22431 XS/APItest|xs/apitest)
22432 # This is just for testing. Skip it unless we have dynamic loading.
22435 $define) avail_ext="$avail_ext $xxx" ;;
22438 XS/Typemap|xs/typemap)
22439 # This is just for testing. Skip it unless we have dynamic loading.
22441 $define) avail_ext="$avail_ext $xxx" ;;
22444 *) avail_ext="$avail_ext $xxx"
22453 case "$onlyextensions" in
22455 *) keepextensions=''
22456 echo "You have requested that only certain extensions be included..." >&4
22457 for i in $onlyextensions; do
22458 case " $avail_ext " in
22460 echo "Keeping extension $i."
22461 keepextensions="$keepextensions $i"
22463 *) echo "Ignoring extension $i." ;;
22466 avail_ext="$keepextensions"
22470 case "$noextensions" in
22472 *) keepextensions=''
22473 echo "You have requested that certain extensions be ignored..." >&4
22474 for i in $avail_ext; do
22475 case " $noextensions " in
22476 *" $i "*) echo "Ignoring extension $i." ;;
22477 *) echo "Keeping extension $i.";
22478 keepextensions="$keepextensions $i"
22482 avail_ext="$keepextensions"
22486 : Now see which nonxs extensions are supported on this system.
22487 : For now assume all are.
22489 for xxx in $nonxs_extensions ; do
22491 *) nonxs_ext="$nonxs_ext $xxx"
22503 A number of extensions are supplied with $package. You may choose to
22504 compile these extensions for dynamic loading (the default), compile
22505 them into the $package executable (static loading), or not include
22506 them at all. Answer "none" to include no extensions.
22507 Note that DynaLoader is always built and need not be mentioned here.
22510 case "$dynamic_ext" in
22512 : Exclude those listed in static_ext
22514 for xxx in $avail_ext; do
22515 case " $static_ext " in
22517 *) dflt="$dflt $xxx" ;;
22524 *) dflt="$dynamic_ext"
22525 # Perhaps we are reusing an old out-of-date config.sh.
22528 if test X"$dynamic_ext" != X"$avail_ext"; then
22530 NOTICE: Your previous config.sh list may be incorrect.
22531 The extensions now available to you are
22533 but the default list from your previous config.sh is
22545 rp="What extensions do you wish to load dynamically?"
22548 none) dynamic_ext=' ' ;;
22549 *) dynamic_ext="$ans" ;;
22552 case "$static_ext" in
22554 : Exclude those already listed in dynamic linking
22556 for xxx in $avail_ext; do
22557 case " $dynamic_ext " in
22559 *) dflt="$dflt $xxx" ;;
22566 *) dflt="$static_ext"
22573 rp="What extensions do you wish to load statically?"
22576 none) static_ext=' ' ;;
22577 *) static_ext="$ans" ;;
22582 A number of extensions are supplied with $package. Answer "none"
22583 to include no extensions.
22584 Note that DynaLoader is always built and need not be mentioned here.
22587 case "$static_ext" in
22588 '') dflt="$avail_ext" ;;
22589 *) dflt="$static_ext"
22590 # Perhaps we are reusing an old out-of-date config.sh.
22593 if test X"$static_ext" != X"$avail_ext"; then
22595 NOTICE: Your previous config.sh list may be incorrect.
22596 The extensions now available to you are
22598 but the default list from your previous config.sh is
22607 : Exclude those that are not xs extensions
22611 rp="What extensions do you wish to include?"
22614 none) static_ext=' ' ;;
22615 *) static_ext="$ans" ;;
22620 # Encode is a special case. If we are building Encode as a static
22621 # extension, we need to explicitly list its subextensions as well.
22622 # For other nested extensions, this is handled automatically by
22623 # the appropriate Makefile.PL.
22624 case " $static_ext " in
22625 *" Encode "*) # Add the subextensions of Encode
22627 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22628 static_ext="$static_ext Encode/$xxx"
22634 set X $dynamic_ext $static_ext $nonxs_ext
22638 # Sanity check: We require an extension suitable for use with
22639 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22640 # should show up as failures in the test suite, but it's helpful to
22641 # catch them now.) The 'extensions' list is normally sorted
22642 # alphabetically, so we need to accept either
22643 # DB_File ... Fcntl ... IO ....
22644 # or something like
22645 # Fcntl ... NDBM_File ... IO ....
22646 case " $extensions" in
22647 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22648 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22649 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22650 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22651 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22655 : Remove libraries needed only for extensions
22656 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22657 : The exception is SunOS 4.x, which needs them.
22658 case "${osname}X${osvers}" in
22662 *) case "$usedl" in
22663 $define|true|[yY]*)
22664 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22668 *) perllibs="$libs"
22674 : Remove build directory name from cppstdin so it can be used from
22675 : either the present location or the final installed location.
22677 : Get out of the UU directory to get correct path name.
22679 case "$cppstdin" in
22681 echo "Stripping down cppstdin path name"
22687 : end of configuration questions
22689 echo "End of configuration questions."
22692 : back to where it started
22693 if test -d ../UU; then
22697 : configuration may be unconditionally patched via a 'config.arch' file
22698 if $test -f config.arch; then
22699 echo "I see a config.arch file, loading it." >&4
22703 : configuration may be patched via a 'config.over' file
22704 if $test -f config.over; then
22707 rp='I see a config.over file. Do you wish to load it?'
22710 n*) echo "OK, I'll ignore it.";;
22712 echo "Configuration override changes have been loaded."
22717 : in case they want portability, strip down executable paths
22718 case "$d_portable" in
22721 echo "Stripping down executable paths..." >&4
22722 for file in $loclist $trylist; do
22724 eval $file=`basename $temp`
22729 : create config.sh file
22731 echo "Creating config.sh..." >&4
22732 $spitshell <<EOT >config.sh
22735 # This file was produced by running the Configure script. It holds all the
22736 # definitions figured out by Configure. Should you modify one of these values,
22737 # do not forget to propagate your changes by running "Configure -der". You may
22738 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22741 # Package name : $package
22742 # Source directory : $src
22743 # Configuration time: $cf_time
22744 # Configured by : $cf_by
22745 # Target system : $myuname
22748 : Add in command line options if available
22749 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22751 $spitshell <<EOT >>config.sh
22760 Revision='$Revision'
22768 alignbytes='$alignbytes'
22769 ansi2knr='$ansi2knr'
22770 aphostname='$aphostname'
22771 api_revision='$api_revision'
22772 api_subversion='$api_subversion'
22773 api_version='$api_version'
22774 api_versionstring='$api_versionstring'
22777 archlibexp='$archlibexp'
22778 archname64='$archname64'
22779 archname='$archname'
22780 archobjs='$archobjs'
22781 asctime_r_proto='$asctime_r_proto'
22790 byteorder='$byteorder'
22792 castflags='$castflags'
22795 cccdlflags='$cccdlflags'
22796 ccdlflags='$ccdlflags'
22798 ccflags_uselargefiles='$ccflags_uselargefiles'
22800 ccsymbols='$ccsymbols'
22801 ccversion='$ccversion'
22803 cf_email='$cf_email'
22805 charbits='$charbits'
22806 charsize='$charsize'
22810 clocktype='$clocktype'
22812 compress='$compress'
22813 contains='$contains'
22817 cpp_stuff='$cpp_stuff'
22818 cppccsymbols='$cppccsymbols'
22819 cppflags='$cppflags'
22821 cppminus='$cppminus'
22823 cppstdin='$cppstdin'
22824 cppsymbols='$cppsymbols'
22825 crypt_r_proto='$crypt_r_proto'
22826 cryptlib='$cryptlib'
22828 ctermid_r_proto='$ctermid_r_proto'
22829 ctime_r_proto='$ctime_r_proto'
22830 d_Gconvert='$d_Gconvert'
22831 d_PRIEUldbl='$d_PRIEUldbl'
22832 d_PRIFUldbl='$d_PRIFUldbl'
22833 d_PRIGUldbl='$d_PRIGUldbl'
22834 d_PRIXU64='$d_PRIXU64'
22835 d_PRId64='$d_PRId64'
22836 d_PRIeldbl='$d_PRIeldbl'
22837 d_PRIfldbl='$d_PRIfldbl'
22838 d_PRIgldbl='$d_PRIgldbl'
22839 d_PRIi64='$d_PRIi64'
22840 d_PRIo64='$d_PRIo64'
22841 d_PRIu64='$d_PRIu64'
22842 d_PRIx64='$d_PRIx64'
22843 d_SCNfldbl='$d_SCNfldbl'
22844 d__fwalk='$d__fwalk'
22845 d_access='$d_access'
22846 d_accessx='$d_accessx'
22849 d_archlib='$d_archlib'
22850 d_asctime64='$d_asctime64'
22851 d_asctime_r='$d_asctime_r'
22854 d_attribute_deprecated='$d_attribute_deprecated'
22855 d_attribute_format='$d_attribute_format'
22856 d_attribute_malloc='$d_attribute_malloc'
22857 d_attribute_nonnull='$d_attribute_nonnull'
22858 d_attribute_noreturn='$d_attribute_noreturn'
22859 d_attribute_pure='$d_attribute_pure'
22860 d_attribute_unused='$d_attribute_unused'
22861 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22865 d_bsdgetpgrp='$d_bsdgetpgrp'
22866 d_bsdsetpgrp='$d_bsdsetpgrp'
22867 d_builtin_choose_expr='$d_builtin_choose_expr'
22868 d_builtin_expect='$d_builtin_expect'
22870 d_c99_variadic_macros='$d_c99_variadic_macros'
22871 d_casti32='$d_casti32'
22872 d_castneg='$d_castneg'
22873 d_charvspr='$d_charvspr'
22875 d_chroot='$d_chroot'
22876 d_chsize='$d_chsize'
22878 d_clearenv='$d_clearenv'
22879 d_closedir='$d_closedir'
22880 d_cmsghdr_s='$d_cmsghdr_s'
22882 d_copysignl='$d_copysignl'
22883 d_cplusplus='$d_cplusplus'
22885 d_crypt_r='$d_crypt_r'
22887 d_ctermid='$d_ctermid'
22888 d_ctermid_r='$d_ctermid_r'
22889 d_ctime64='$d_ctime64'
22890 d_ctime_r='$d_ctime_r'
22891 d_cuserid='$d_cuserid'
22892 d_dbl_dig='$d_dbl_dig'
22893 d_dbminitproto='$d_dbminitproto'
22894 d_difftime64='$d_difftime64'
22895 d_difftime='$d_difftime'
22896 d_dir_dd_fd='$d_dir_dd_fd'
22898 d_dirnamlen='$d_dirnamlen'
22899 d_dlerror='$d_dlerror'
22900 d_dlopen='$d_dlopen'
22901 d_dlsymun='$d_dlsymun'
22902 d_dosuid='$d_dosuid'
22903 d_drand48_r='$d_drand48_r'
22904 d_drand48proto='$d_drand48proto'
22906 d_eaccess='$d_eaccess'
22907 d_endgrent='$d_endgrent'
22908 d_endgrent_r='$d_endgrent_r'
22909 d_endhent='$d_endhent'
22910 d_endhostent_r='$d_endhostent_r'
22911 d_endnent='$d_endnent'
22912 d_endnetent_r='$d_endnetent_r'
22913 d_endpent='$d_endpent'
22914 d_endprotoent_r='$d_endprotoent_r'
22915 d_endpwent='$d_endpwent'
22916 d_endpwent_r='$d_endpwent_r'
22917 d_endsent='$d_endsent'
22918 d_endservent_r='$d_endservent_r'
22919 d_eofnblk='$d_eofnblk'
22920 d_eunice='$d_eunice'
22921 d_faststdio='$d_faststdio'
22922 d_fchdir='$d_fchdir'
22923 d_fchmod='$d_fchmod'
22924 d_fchown='$d_fchown'
22926 d_fcntl_can_lock='$d_fcntl_can_lock'
22927 d_fd_macros='$d_fd_macros'
22928 d_fd_set='$d_fd_set'
22929 d_fds_bits='$d_fds_bits'
22930 d_fgetpos='$d_fgetpos'
22931 d_finite='$d_finite'
22932 d_finitel='$d_finitel'
22933 d_flexfnam='$d_flexfnam'
22935 d_flockproto='$d_flockproto'
22937 d_fp_class='$d_fp_class'
22938 d_fpathconf='$d_fpathconf'
22939 d_fpclass='$d_fpclass'
22940 d_fpclassify='$d_fpclassify'
22941 d_fpclassl='$d_fpclassl'
22942 d_fpos64_t='$d_fpos64_t'
22943 d_frexpl='$d_frexpl'
22944 d_fs_data_s='$d_fs_data_s'
22945 d_fseeko='$d_fseeko'
22946 d_fsetpos='$d_fsetpos'
22947 d_fstatfs='$d_fstatfs'
22948 d_fstatvfs='$d_fstatvfs'
22950 d_ftello='$d_ftello'
22952 d_futimes='$d_futimes'
22953 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22954 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22955 d_getaddrinfo='$d_getaddrinfo'
22956 d_getcwd='$d_getcwd'
22957 d_getespwnam='$d_getespwnam'
22958 d_getfsstat='$d_getfsstat'
22959 d_getgrent='$d_getgrent'
22960 d_getgrent_r='$d_getgrent_r'
22961 d_getgrgid_r='$d_getgrgid_r'
22962 d_getgrnam_r='$d_getgrnam_r'
22963 d_getgrps='$d_getgrps'
22964 d_gethbyaddr='$d_gethbyaddr'
22965 d_gethbyname='$d_gethbyname'
22966 d_gethent='$d_gethent'
22967 d_gethname='$d_gethname'
22968 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22969 d_gethostbyname_r='$d_gethostbyname_r'
22970 d_gethostent_r='$d_gethostent_r'
22971 d_gethostprotos='$d_gethostprotos'
22972 d_getitimer='$d_getitimer'
22973 d_getlogin='$d_getlogin'
22974 d_getlogin_r='$d_getlogin_r'
22975 d_getmnt='$d_getmnt'
22976 d_getmntent='$d_getmntent'
22977 d_getnameinfo='$d_getnameinfo'
22978 d_getnbyaddr='$d_getnbyaddr'
22979 d_getnbyname='$d_getnbyname'
22980 d_getnent='$d_getnent'
22981 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22982 d_getnetbyname_r='$d_getnetbyname_r'
22983 d_getnetent_r='$d_getnetent_r'
22984 d_getnetprotos='$d_getnetprotos'
22985 d_getpagsz='$d_getpagsz'
22986 d_getpbyname='$d_getpbyname'
22987 d_getpbynumber='$d_getpbynumber'
22988 d_getpent='$d_getpent'
22989 d_getpgid='$d_getpgid'
22990 d_getpgrp2='$d_getpgrp2'
22991 d_getpgrp='$d_getpgrp'
22992 d_getppid='$d_getppid'
22993 d_getprior='$d_getprior'
22994 d_getprotobyname_r='$d_getprotobyname_r'
22995 d_getprotobynumber_r='$d_getprotobynumber_r'
22996 d_getprotoent_r='$d_getprotoent_r'
22997 d_getprotoprotos='$d_getprotoprotos'
22998 d_getprpwnam='$d_getprpwnam'
22999 d_getpwent='$d_getpwent'
23000 d_getpwent_r='$d_getpwent_r'
23001 d_getpwnam_r='$d_getpwnam_r'
23002 d_getpwuid_r='$d_getpwuid_r'
23003 d_getsbyname='$d_getsbyname'
23004 d_getsbyport='$d_getsbyport'
23005 d_getsent='$d_getsent'
23006 d_getservbyname_r='$d_getservbyname_r'
23007 d_getservbyport_r='$d_getservbyport_r'
23008 d_getservent_r='$d_getservent_r'
23009 d_getservprotos='$d_getservprotos'
23010 d_getspnam='$d_getspnam'
23011 d_getspnam_r='$d_getspnam_r'
23012 d_gettimeod='$d_gettimeod'
23013 d_gmtime64='$d_gmtime64'
23014 d_gmtime_r='$d_gmtime_r'
23015 d_gnulibc='$d_gnulibc'
23016 d_grpasswd='$d_grpasswd'
23017 d_hasmntopt='$d_hasmntopt'
23019 d_ilogbl='$d_ilogbl'
23020 d_inc_version_list='$d_inc_version_list'
23022 d_inetaton='$d_inetaton'
23023 d_inetntop='$d_inetntop'
23024 d_inetpton='$d_inetpton'
23025 d_int64_t='$d_int64_t'
23026 d_ipv6_mreq='$d_ipv6_mreq'
23027 d_isascii='$d_isascii'
23028 d_isblank='$d_isblank'
23029 d_isfinite='$d_isfinite'
23032 d_isnanl='$d_isnanl'
23033 d_killpg='$d_killpg'
23034 d_lchown='$d_lchown'
23035 d_ldbl_dig='$d_ldbl_dig'
23036 d_libm_lib_version='$d_libm_lib_version'
23038 d_localtime64='$d_localtime64'
23039 d_localtime_r='$d_localtime_r'
23040 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23041 d_locconv='$d_locconv'
23043 d_longdbl='$d_longdbl'
23044 d_longlong='$d_longlong'
23045 d_lseekproto='$d_lseekproto'
23047 d_madvise='$d_madvise'
23048 d_malloc_good_size='$d_malloc_good_size'
23049 d_malloc_size='$d_malloc_size'
23051 d_mbstowcs='$d_mbstowcs'
23052 d_mbtowc='$d_mbtowc'
23053 d_memchr='$d_memchr'
23054 d_memcmp='$d_memcmp'
23055 d_memcpy='$d_memcpy'
23056 d_memmove='$d_memmove'
23057 d_memset='$d_memset'
23059 d_mkdtemp='$d_mkdtemp'
23060 d_mkfifo='$d_mkfifo'
23061 d_mkstemp='$d_mkstemp'
23062 d_mkstemps='$d_mkstemps'
23063 d_mktime64='$d_mktime64'
23064 d_mktime='$d_mktime'
23067 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23068 d_modflproto='$d_modflproto'
23069 d_mprotect='$d_mprotect'
23071 d_msg_ctrunc='$d_msg_ctrunc'
23072 d_msg_dontroute='$d_msg_dontroute'
23073 d_msg_oob='$d_msg_oob'
23074 d_msg_peek='$d_msg_peek'
23075 d_msg_proxy='$d_msg_proxy'
23076 d_msgctl='$d_msgctl'
23077 d_msgget='$d_msgget'
23078 d_msghdr_s='$d_msghdr_s'
23079 d_msgrcv='$d_msgrcv'
23080 d_msgsnd='$d_msgsnd'
23082 d_munmap='$d_munmap'
23083 d_mymalloc='$d_mymalloc'
23085 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23087 d_nl_langinfo='$d_nl_langinfo'
23088 d_nv_preserves_uv='$d_nv_preserves_uv'
23089 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23090 d_off64_t='$d_off64_t'
23091 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23092 d_oldpthreads='$d_oldpthreads'
23093 d_oldsock='$d_oldsock'
23095 d_pathconf='$d_pathconf'
23097 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23098 d_phostname='$d_phostname'
23101 d_portable='$d_portable'
23103 d_prctl_set_name='$d_prctl_set_name'
23104 d_printf_format_null='$d_printf_format_null'
23105 d_procselfexe='$d_procselfexe'
23106 d_pseudofork='$d_pseudofork'
23107 d_pthread_atfork='$d_pthread_atfork'
23108 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23109 d_pthread_yield='$d_pthread_yield'
23111 d_pwchange='$d_pwchange'
23112 d_pwclass='$d_pwclass'
23113 d_pwcomment='$d_pwcomment'
23114 d_pwexpire='$d_pwexpire'
23115 d_pwgecos='$d_pwgecos'
23116 d_pwpasswd='$d_pwpasswd'
23117 d_pwquota='$d_pwquota'
23120 d_random_r='$d_random_r'
23121 d_readdir64_r='$d_readdir64_r'
23122 d_readdir='$d_readdir'
23123 d_readdir_r='$d_readdir_r'
23124 d_readlink='$d_readlink'
23126 d_recvmsg='$d_recvmsg'
23127 d_rename='$d_rename'
23128 d_rewinddir='$d_rewinddir'
23130 d_safebcpy='$d_safebcpy'
23131 d_safemcpy='$d_safemcpy'
23132 d_sanemcmp='$d_sanemcmp'
23133 d_sbrkproto='$d_sbrkproto'
23134 d_scalbnl='$d_scalbnl'
23135 d_sched_yield='$d_sched_yield'
23136 d_scm_rights='$d_scm_rights'
23137 d_seekdir='$d_seekdir'
23138 d_select='$d_select'
23140 d_semctl='$d_semctl'
23141 d_semctl_semid_ds='$d_semctl_semid_ds'
23142 d_semctl_semun='$d_semctl_semun'
23143 d_semget='$d_semget'
23145 d_sendmsg='$d_sendmsg'
23146 d_setegid='$d_setegid'
23147 d_seteuid='$d_seteuid'
23148 d_setgrent='$d_setgrent'
23149 d_setgrent_r='$d_setgrent_r'
23150 d_setgrps='$d_setgrps'
23151 d_sethent='$d_sethent'
23152 d_sethostent_r='$d_sethostent_r'
23153 d_setitimer='$d_setitimer'
23154 d_setlinebuf='$d_setlinebuf'
23155 d_setlocale='$d_setlocale'
23156 d_setlocale_r='$d_setlocale_r'
23157 d_setnent='$d_setnent'
23158 d_setnetent_r='$d_setnetent_r'
23159 d_setpent='$d_setpent'
23160 d_setpgid='$d_setpgid'
23161 d_setpgrp2='$d_setpgrp2'
23162 d_setpgrp='$d_setpgrp'
23163 d_setprior='$d_setprior'
23164 d_setproctitle='$d_setproctitle'
23165 d_setprotoent_r='$d_setprotoent_r'
23166 d_setpwent='$d_setpwent'
23167 d_setpwent_r='$d_setpwent_r'
23168 d_setregid='$d_setregid'
23169 d_setresgid='$d_setresgid'
23170 d_setresuid='$d_setresuid'
23171 d_setreuid='$d_setreuid'
23172 d_setrgid='$d_setrgid'
23173 d_setruid='$d_setruid'
23174 d_setsent='$d_setsent'
23175 d_setservent_r='$d_setservent_r'
23176 d_setsid='$d_setsid'
23177 d_setvbuf='$d_setvbuf'
23181 d_shmatprototype='$d_shmatprototype'
23182 d_shmctl='$d_shmctl'
23184 d_shmget='$d_shmget'
23185 d_sigaction='$d_sigaction'
23186 d_signbit='$d_signbit'
23187 d_sigprocmask='$d_sigprocmask'
23188 d_sigsetjmp='$d_sigsetjmp'
23189 d_sin6_scope_id='$d_sin6_scope_id'
23190 d_sitearch='$d_sitearch'
23191 d_snprintf='$d_snprintf'
23192 d_sockaddr_in6='$d_sockaddr_in6'
23193 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23194 d_sockatmark='$d_sockatmark'
23195 d_sockatmarkproto='$d_sockatmarkproto'
23196 d_socket='$d_socket'
23197 d_socklen_t='$d_socklen_t'
23198 d_sockpair='$d_sockpair'
23199 d_socks5_init='$d_socks5_init'
23200 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23202 d_srand48_r='$d_srand48_r'
23203 d_srandom_r='$d_srandom_r'
23204 d_sresgproto='$d_sresgproto'
23205 d_sresuproto='$d_sresuproto'
23206 d_statblks='$d_statblks'
23207 d_statfs_f_flags='$d_statfs_f_flags'
23208 d_statfs_s='$d_statfs_s'
23209 d_static_inline='$d_static_inline'
23210 d_statvfs='$d_statvfs'
23211 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23212 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23213 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23214 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23215 d_stdio_stream_array='$d_stdio_stream_array'
23216 d_stdiobase='$d_stdiobase'
23217 d_stdstdio='$d_stdstdio'
23218 d_strchr='$d_strchr'
23219 d_strcoll='$d_strcoll'
23220 d_strctcpy='$d_strctcpy'
23221 d_strerrm='$d_strerrm'
23222 d_strerror='$d_strerror'
23223 d_strerror_r='$d_strerror_r'
23224 d_strftime='$d_strftime'
23225 d_strlcat='$d_strlcat'
23226 d_strlcpy='$d_strlcpy'
23227 d_strtod='$d_strtod'
23228 d_strtol='$d_strtol'
23229 d_strtold='$d_strtold'
23230 d_strtoll='$d_strtoll'
23231 d_strtoq='$d_strtoq'
23232 d_strtoul='$d_strtoul'
23233 d_strtoull='$d_strtoull'
23234 d_strtouq='$d_strtouq'
23235 d_strxfrm='$d_strxfrm'
23236 d_suidsafe='$d_suidsafe'
23237 d_symlink='$d_symlink'
23238 d_syscall='$d_syscall'
23239 d_syscallproto='$d_syscallproto'
23240 d_sysconf='$d_sysconf'
23241 d_sysernlst='$d_sysernlst'
23242 d_syserrlst='$d_syserrlst'
23243 d_system='$d_system'
23244 d_tcgetpgrp='$d_tcgetpgrp'
23245 d_tcsetpgrp='$d_tcsetpgrp'
23246 d_telldir='$d_telldir'
23247 d_telldirproto='$d_telldirproto'
23249 d_timegm='$d_timegm'
23251 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23252 d_tm_tm_zone='$d_tm_tm_zone'
23253 d_tmpnam_r='$d_tmpnam_r'
23254 d_truncate='$d_truncate'
23255 d_ttyname_r='$d_ttyname_r'
23256 d_tzname='$d_tzname'
23257 d_u32align='$d_u32align'
23258 d_ualarm='$d_ualarm'
23261 d_union_semun='$d_union_semun'
23262 d_unordered='$d_unordered'
23263 d_unsetenv='$d_unsetenv'
23264 d_usleep='$d_usleep'
23265 d_usleepproto='$d_usleepproto'
23267 d_vendorarch='$d_vendorarch'
23268 d_vendorbin='$d_vendorbin'
23269 d_vendorlib='$d_vendorlib'
23270 d_vendorscript='$d_vendorscript'
23272 d_void_closedir='$d_void_closedir'
23273 d_voidsig='$d_voidsig'
23274 d_voidtty='$d_voidtty'
23275 d_volatile='$d_volatile'
23276 d_vprintf='$d_vprintf'
23277 d_vsnprintf='$d_vsnprintf'
23279 d_waitpid='$d_waitpid'
23280 d_wcstombs='$d_wcstombs'
23281 d_wctomb='$d_wctomb'
23282 d_writev='$d_writev'
23285 db_hashtype='$db_hashtype'
23286 db_prefixtype='$db_prefixtype'
23287 db_version_major='$db_version_major'
23288 db_version_minor='$db_version_minor'
23289 db_version_patch='$db_version_patch'
23290 defvoidused='$defvoidused'
23291 direntrytype='$direntrytype'
23294 doublesize='$doublesize'
23296 drand48_r_proto='$drand48_r_proto'
23298 dynamic_ext='$dynamic_ext'
23304 endgrent_r_proto='$endgrent_r_proto'
23305 endhostent_r_proto='$endhostent_r_proto'
23306 endnetent_r_proto='$endnetent_r_proto'
23307 endprotoent_r_proto='$endprotoent_r_proto'
23308 endpwent_r_proto='$endpwent_r_proto'
23309 endservent_r_proto='$endservent_r_proto'
23310 eunicefix='$eunicefix'
23313 extensions='$extensions'
23314 extern_C='$extern_C'
23316 fflushNULL='$fflushNULL'
23317 fflushall='$fflushall'
23319 firstmakefile='$firstmakefile'
23321 fpossize='$fpossize'
23322 fpostype='$fpostype'
23323 freetype='$freetype'
23326 full_csh='$full_csh'
23327 full_sed='$full_sed'
23328 gccansipedantic='$gccansipedantic'
23329 gccosandvers='$gccosandvers'
23330 gccversion='$gccversion'
23331 getgrent_r_proto='$getgrent_r_proto'
23332 getgrgid_r_proto='$getgrgid_r_proto'
23333 getgrnam_r_proto='$getgrnam_r_proto'
23334 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23335 gethostbyname_r_proto='$gethostbyname_r_proto'
23336 gethostent_r_proto='$gethostent_r_proto'
23337 getlogin_r_proto='$getlogin_r_proto'
23338 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23339 getnetbyname_r_proto='$getnetbyname_r_proto'
23340 getnetent_r_proto='$getnetent_r_proto'
23341 getprotobyname_r_proto='$getprotobyname_r_proto'
23342 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23343 getprotoent_r_proto='$getprotoent_r_proto'
23344 getpwent_r_proto='$getpwent_r_proto'
23345 getpwnam_r_proto='$getpwnam_r_proto'
23346 getpwuid_r_proto='$getpwuid_r_proto'
23347 getservbyname_r_proto='$getservbyname_r_proto'
23348 getservbyport_r_proto='$getservbyport_r_proto'
23349 getservent_r_proto='$getservent_r_proto'
23350 getspnam_r_proto='$getspnam_r_proto'
23351 gidformat='$gidformat'
23357 gmtime_r_proto='$gmtime_r_proto'
23358 gnulibc_version='$gnulibc_version'
23360 groupcat='$groupcat'
23361 groupstype='$groupstype'
23364 h_sysfile='$h_sysfile'
23367 html1dir='$html1dir'
23368 html1direxp='$html1direxp'
23369 html3dir='$html3dir'
23370 html3direxp='$html3direxp'
23379 i_arpainet='$i_arpainet'
23380 i_assert='$i_assert'
23381 i_bsdioctl='$i_bsdioctl'
23385 i_dirent='$i_dirent'
23391 i_fp_class='$i_fp_class'
23393 i_gdbm_ndbm='$i_gdbm_ndbm'
23394 i_gdbmndbm='$i_gdbmndbm'
23396 i_ieeefp='$i_ieeefp'
23397 i_inttypes='$i_inttypes'
23398 i_langinfo='$i_langinfo'
23399 i_libutil='$i_libutil'
23400 i_limits='$i_limits'
23401 i_locale='$i_locale'
23402 i_machcthr='$i_machcthr'
23403 i_malloc='$i_malloc'
23404 i_mallocmalloc='$i_mallocmalloc'
23406 i_memory='$i_memory'
23407 i_mntent='$i_mntent'
23410 i_neterrno='$i_neterrno'
23411 i_netinettcp='$i_netinettcp'
23415 i_pthread='$i_pthread'
23417 i_rpcsvcdbm='$i_rpcsvcdbm'
23420 i_shadow='$i_shadow'
23422 i_stdarg='$i_stdarg'
23423 i_stdbool='$i_stdbool'
23424 i_stddef='$i_stddef'
23425 i_stdlib='$i_stdlib'
23426 i_string='$i_string'
23427 i_sunmath='$i_sunmath'
23428 i_sysaccess='$i_sysaccess'
23429 i_sysdir='$i_sysdir'
23430 i_sysfile='$i_sysfile'
23431 i_sysfilio='$i_sysfilio'
23433 i_sysioctl='$i_sysioctl'
23434 i_syslog='$i_syslog'
23435 i_sysmman='$i_sysmman'
23436 i_sysmode='$i_sysmode'
23437 i_sysmount='$i_sysmount'
23438 i_sysndir='$i_sysndir'
23439 i_sysparam='$i_sysparam'
23440 i_syspoll='$i_syspoll'
23441 i_sysresrc='$i_sysresrc'
23442 i_syssecrt='$i_syssecrt'
23443 i_sysselct='$i_sysselct'
23444 i_syssockio='$i_syssockio'
23445 i_sysstat='$i_sysstat'
23446 i_sysstatfs='$i_sysstatfs'
23447 i_sysstatvfs='$i_sysstatvfs'
23448 i_systime='$i_systime'
23449 i_systimek='$i_systimek'
23450 i_systimes='$i_systimes'
23451 i_systypes='$i_systypes'
23452 i_sysuio='$i_sysuio'
23454 i_sysutsname='$i_sysutsname'
23455 i_sysvfs='$i_sysvfs'
23456 i_syswait='$i_syswait'
23457 i_termio='$i_termio'
23458 i_termios='$i_termios'
23460 i_unistd='$i_unistd'
23463 i_values='$i_values'
23464 i_varargs='$i_varargs'
23465 i_varhdr='$i_varhdr'
23467 ignore_versioned_solibs='$ignore_versioned_solibs'
23468 inc_version_list='$inc_version_list'
23469 inc_version_list_init='$inc_version_list_init'
23472 initialinstalllocation='$initialinstalllocation'
23473 installarchlib='$installarchlib'
23474 installbin='$installbin'
23475 installhtml1dir='$installhtml1dir'
23476 installhtml3dir='$installhtml3dir'
23477 installman1dir='$installman1dir'
23478 installman3dir='$installman3dir'
23479 installprefix='$installprefix'
23480 installprefixexp='$installprefixexp'
23481 installprivlib='$installprivlib'
23482 installscript='$installscript'
23483 installsitearch='$installsitearch'
23484 installsitebin='$installsitebin'
23485 installsitehtml1dir='$installsitehtml1dir'
23486 installsitehtml3dir='$installsitehtml3dir'
23487 installsitelib='$installsitelib'
23488 installsiteman1dir='$installsiteman1dir'
23489 installsiteman3dir='$installsiteman3dir'
23490 installsitescript='$installsitescript'
23491 installstyle='$installstyle'
23492 installusrbinperl='$installusrbinperl'
23493 installvendorarch='$installvendorarch'
23494 installvendorbin='$installvendorbin'
23495 installvendorhtml1dir='$installvendorhtml1dir'
23496 installvendorhtml3dir='$installvendorhtml3dir'
23497 installvendorlib='$installvendorlib'
23498 installvendorman1dir='$installvendorman1dir'
23499 installvendorman3dir='$installvendorman3dir'
23500 installvendorscript='$installvendorscript'
23502 issymlink='$issymlink'
23503 ivdformat='$ivdformat'
23506 known_extensions='$known_extensions'
23509 ld_can_script='$ld_can_script'
23510 lddlflags='$lddlflags'
23512 ldflags_uselargefiles='$ldflags_uselargefiles'
23513 ldlibpthname='$ldlibpthname'
23520 libsdirs='$libsdirs'
23521 libsfiles='$libsfiles'
23522 libsfound='$libsfound'
23523 libspath='$libspath'
23524 libswanted='$libswanted'
23525 libswanted_uselargefiles='$libswanted_uselargefiles'
23531 localtime_r_proto='$localtime_r_proto'
23532 locincpth='$locincpth'
23533 loclibpth='$loclibpth'
23534 longdblsize='$longdblsize'
23535 longlongsize='$longlongsize'
23536 longsize='$longsize'
23540 lseeksize='$lseeksize'
23541 lseektype='$lseektype'
23544 madlyobj='$madlyobj'
23545 madlysrc='$madlysrc'
23549 make_set_make='$make_set_make'
23550 mallocobj='$mallocobj'
23551 mallocsrc='$mallocsrc'
23552 malloctype='$malloctype'
23554 man1direxp='$man1direxp'
23557 man3direxp='$man3direxp'
23559 mips_type='$mips_type'
23560 mistrustnm='$mistrustnm'
23562 mmaptype='$mmaptype'
23563 modetype='$modetype'
23565 multiarch='$multiarch'
23567 myarchname='$myarchname'
23568 mydomain='$mydomain'
23569 myhostname='$myhostname'
23572 need_va_copy='$need_va_copy'
23573 netdb_hlen_type='$netdb_hlen_type'
23574 netdb_host_type='$netdb_host_type'
23575 netdb_name_type='$netdb_name_type'
23576 netdb_net_type='$netdb_net_type'
23579 nm_so_opt='$nm_so_opt'
23580 nonxs_ext='$nonxs_ext'
23582 nvEUformat='$nvEUformat'
23583 nvFUformat='$nvFUformat'
23584 nvGUformat='$nvGUformat'
23585 nv_overflows_integers_at='$nv_overflows_integers_at'
23586 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23587 nveformat='$nveformat'
23588 nvfformat='$nvfformat'
23589 nvgformat='$nvgformat'
23592 o_nonblock='$o_nonblock'
23594 old_pthread_create_joinable='$old_pthread_create_joinable'
23595 optimize='$optimize'
23596 orderlib='$orderlib'
23599 otherlibdirs='$otherlibdirs'
23603 patchlevel='$patchlevel'
23604 path_sep='$path_sep'
23607 perl_patchlevel='$perl_patchlevel'
23608 perl_static_inline='$perl_static_inline'
23609 perladmin='$perladmin'
23610 perllibs='$perllibs'
23611 perlpath='$perlpath'
23613 phostname='$phostname'
23619 prefixexp='$prefixexp'
23621 privlibexp='$privlibexp'
23622 procselfexe='$procselfexe'
23623 prototype='$prototype'
23625 quadkind='$quadkind'
23626 quadtype='$quadtype'
23627 randbits='$randbits'
23628 randfunc='$randfunc'
23629 random_r_proto='$random_r_proto'
23630 randseedtype='$randseedtype'
23632 rd_nodata='$rd_nodata'
23633 readdir64_r_proto='$readdir64_r_proto'
23634 readdir_r_proto='$readdir_r_proto'
23635 revision='$revision'
23641 sGMTIME_max='$sGMTIME_max'
23642 sGMTIME_min='$sGMTIME_min'
23643 sLOCALTIME_max='$sLOCALTIME_max'
23644 sLOCALTIME_min='$sLOCALTIME_min'
23645 sPRIEUldbl='$sPRIEUldbl'
23646 sPRIFUldbl='$sPRIFUldbl'
23647 sPRIGUldbl='$sPRIGUldbl'
23648 sPRIXU64='$sPRIXU64'
23650 sPRIeldbl='$sPRIeldbl'
23651 sPRIfldbl='$sPRIfldbl'
23652 sPRIgldbl='$sPRIgldbl'
23657 sSCNfldbl='$sSCNfldbl'
23658 sched_yield='$sched_yield'
23659 scriptdir='$scriptdir'
23660 scriptdirexp='$scriptdirexp'
23662 seedfunc='$seedfunc'
23663 selectminbits='$selectminbits'
23664 selecttype='$selecttype'
23665 sendmail='$sendmail'
23666 setgrent_r_proto='$setgrent_r_proto'
23667 sethostent_r_proto='$sethostent_r_proto'
23668 setlocale_r_proto='$setlocale_r_proto'
23669 setnetent_r_proto='$setnetent_r_proto'
23670 setprotoent_r_proto='$setprotoent_r_proto'
23671 setpwent_r_proto='$setpwent_r_proto'
23672 setservent_r_proto='$setservent_r_proto'
23675 sharpbang='$sharpbang'
23676 shmattype='$shmattype'
23677 shortsize='$shortsize'
23680 sig_count='$sig_count'
23681 sig_name='$sig_name'
23682 sig_name_init='$sig_name_init'
23684 sig_num_init='$sig_num_init'
23685 sig_size='$sig_size'
23686 signal_t='$signal_t'
23687 sitearch='$sitearch'
23688 sitearchexp='$sitearchexp'
23690 sitebinexp='$sitebinexp'
23691 sitehtml1dir='$sitehtml1dir'
23692 sitehtml1direxp='$sitehtml1direxp'
23693 sitehtml3dir='$sitehtml3dir'
23694 sitehtml3direxp='$sitehtml3direxp'
23696 sitelib_stem='$sitelib_stem'
23697 sitelibexp='$sitelibexp'
23698 siteman1dir='$siteman1dir'
23699 siteman1direxp='$siteman1direxp'
23700 siteman3dir='$siteman3dir'
23701 siteman3direxp='$siteman3direxp'
23702 siteprefix='$siteprefix'
23703 siteprefixexp='$siteprefixexp'
23704 sitescript='$sitescript'
23705 sitescriptexp='$sitescriptexp'
23706 sizesize='$sizesize'
23707 sizetype='$sizetype'
23711 sockethdr='$sockethdr'
23712 socketlib='$socketlib'
23713 socksizetype='$socksizetype'
23715 spackage='$spackage'
23716 spitshell='$spitshell'
23717 srand48_r_proto='$srand48_r_proto'
23718 srandom_r_proto='$srandom_r_proto'
23720 ssizetype='$ssizetype'
23721 st_ino_sign='$st_ino_sign'
23722 st_ino_size='$st_ino_size'
23723 startperl='$startperl'
23725 static_ext='$static_ext'
23727 stdio_base='$stdio_base'
23728 stdio_bufsiz='$stdio_bufsiz'
23729 stdio_cnt='$stdio_cnt'
23730 stdio_filbuf='$stdio_filbuf'
23731 stdio_ptr='$stdio_ptr'
23732 stdio_stream_array='$stdio_stream_array'
23733 strerror_r_proto='$strerror_r_proto'
23736 subversion='$subversion'
23740 targetarch='$targetarch'
23744 timeincl='$timeincl'
23745 timetype='$timetype'
23746 tmpnam_r_proto='$tmpnam_r_proto'
23752 ttyname_r_proto='$ttyname_r_proto'
23761 uidformat='$uidformat'
23767 uquadtype='$uquadtype'
23768 use5005threads='$use5005threads'
23769 use64bitall='$use64bitall'
23770 use64bitint='$use64bitint'
23771 usecrosscompile='$usecrosscompile'
23772 usedevel='$usedevel'
23774 usedtrace='$usedtrace'
23775 usefaststdio='$usefaststdio'
23776 useithreads='$useithreads'
23777 usekernprocpathname='$usekernprocpathname'
23778 uselargefiles='$uselargefiles'
23779 uselongdouble='$uselongdouble'
23780 usemallocwrap='$usemallocwrap'
23781 usemorebits='$usemorebits'
23782 usemultiplicity='$usemultiplicity'
23783 usemymalloc='$usemymalloc'
23785 usensgetexecutablepath='$usensgetexecutablepath'
23786 useopcode='$useopcode'
23787 useperlio='$useperlio'
23788 useposix='$useposix'
23789 usereentrant='$usereentrant'
23790 userelocatableinc='$userelocatableinc'
23792 useshrplib='$useshrplib'
23793 usesitecustomize='$usesitecustomize'
23794 usesocks='$usesocks'
23795 usethreads='$usethreads'
23796 usevendorprefix='$usevendorprefix'
23797 usevfork='$usevfork'
23800 uvXUformat='$uvXUformat'
23801 uvoformat='$uvoformat'
23804 uvuformat='$uvuformat'
23805 uvxformat='$uvxformat'
23807 vendorarch='$vendorarch'
23808 vendorarchexp='$vendorarchexp'
23809 vendorbin='$vendorbin'
23810 vendorbinexp='$vendorbinexp'
23811 vendorhtml1dir='$vendorhtml1dir'
23812 vendorhtml1direxp='$vendorhtml1direxp'
23813 vendorhtml3dir='$vendorhtml3dir'
23814 vendorhtml3direxp='$vendorhtml3direxp'
23815 vendorlib='$vendorlib'
23816 vendorlib_stem='$vendorlib_stem'
23817 vendorlibexp='$vendorlibexp'
23818 vendorman1dir='$vendorman1dir'
23819 vendorman1direxp='$vendorman1direxp'
23820 vendorman3dir='$vendorman3dir'
23821 vendorman3direxp='$vendorman3direxp'
23822 vendorprefix='$vendorprefix'
23823 vendorprefixexp='$vendorprefixexp'
23824 vendorscript='$vendorscript'
23825 vendorscriptexp='$vendorscriptexp'
23827 version_patchlevel_string='$version_patchlevel_string'
23828 versiononly='$versiononly'
23830 voidflags='$voidflags'
23833 yaccflags='$yaccflags'
23838 : add special variables
23839 $test -f $src/patchlevel.h && \
23840 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23841 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23842 echo "PERL_CONFIG_SH=true" >>config.sh
23844 : propagate old symbols
23845 if $test -f UU/config.sh; then
23846 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23847 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23848 config.sh config.sh UU/oldconfig.sh |\
23849 $sort | $uniq -u >UU/oldsyms
23850 set X `$cat UU/oldsyms`
23856 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23858 echo ": Variables propagated from previous config.sh file." >>config.sh
23859 for sym in `$cat UU/oldsyms`; do
23860 echo " Propagating $hint variable "'$'"$sym..."
23861 eval 'tmp="$'"${sym}"'"'
23863 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23869 : Finish up by extracting the .SH files
23873 echo "Extraction done."
23883 If you'd like to make any changes to the config.sh file before I begin
23884 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23887 rp="Press return or use a shell escape to edit config.sh:"
23892 *) : in case they cannot read
23893 sh 1>&4 -c "$ans";;
23898 : if this fails, just run all the .SH files by hand
23907 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23914 Now you need to generate make dependencies by running "$make depend".
23915 You might prefer to run it in background: "$make depend > makedepend.out &"
23916 It can take a while, so you might not want to run it right now.
23921 rp="Run $make depend now?"
23925 $make depend && echo "Now you must run '$make'."
23928 echo "You must run '$make depend' then '$make'."
23931 elif test -f [Mm]akefile; then
23933 echo "Now you must run a $make."
23935 echo "Configure done."
23938 if $test -f Policy.sh; then
23941 If you compile $package on a different machine or from a different object
23942 directory, copy the Policy.sh file from this object directory to the
23943 new one before you run Configure -- this will help you with most of
23944 the policy defaults.
23948 if $test -f config.msg; then
23949 echo "Hmm. I also noted the following information while running:"
23951 $cat config.msg >&4
23954 $rm -f kit*isdone ark*isdone