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.code.sf.net/p/dist/code/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 using [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 ) 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
344 useversionedarchname=''
350 initialinstalllocation=''
379 d_attribute_deprecated=''
380 d_attribute_format=''
381 d_attribute_malloc=''
382 d_attribute_nonnull=''
383 d_attribute_noreturn=''
385 d_attribute_unused=''
386 d_attribute_warn_unused_result=''
387 d_printf_format_null=''
391 d_builtin_choose_expr=''
394 d_c99_variadic_macros=''
442 endhostent_r_proto=''
448 endprotoent_r_proto=''
454 endservent_r_proto=''
507 gethostbyaddr_r_proto=''
509 gethostbyname_r_proto=''
511 gethostent_r_proto=''
524 getnetbyaddr_r_proto=''
526 getnetbyname_r_proto=''
540 d_getprotobyname_r=''
541 getprotobyname_r_proto=''
542 d_getprotobynumber_r=''
543 getprotobynumber_r_proto=''
545 getprotoent_r_proto=''
557 getservbyname_r_proto=''
559 getservbyport_r_proto=''
561 getservent_r_proto=''
588 d_libm_lib_version=''
591 d_localtime_r_needs_tzset=''
602 d_malloc_good_size=''
646 d_old_pthread_create_joinable=''
647 old_pthread_create_joinable=''
649 d_pthread_attr_setscope=''
688 sethostent_r_proto=''
705 setprotoent_r_proto=''
717 setservent_r_proto=''
739 d_ipv6_mreq_source=''
756 d_sprintf_returns_strlen=''
768 perl_static_inline=''
773 d_stdio_ptr_lval_nochange_cnt=''
774 d_stdio_ptr_lval_sets_cnt=''
922 d_gdbm_ndbm_h_uses_prototypes=''
923 d_gdbmndbm_h_uses_prototypes=''
925 d_ndbm_h_uses_prototypes=''
1000 d_inc_version_list=''
1002 inc_version_list_init=''
1006 installusrbinperl=''
1022 ignore_versioned_solibs=''
1082 d_perl_otherlibdirs=''
1090 api_versionstring=''
1096 version_patchlevel_string=''
1100 d_nv_preserves_uv=''
1101 d_nv_zero_is_allbits_zero=''
1112 nv_overflows_integers_at=''
1113 nv_preserves_uv_bits=''
1186 installsitehtml1dir=''
1189 installsitehtml3dir=''
1196 installsiteman1dir=''
1199 installsiteman3dir=''
1204 installsitescript=''
1222 d_stdio_stream_array=''
1223 stdio_stream_array=''
1241 usekernprocpathname=''
1242 ccflags_uselargefiles=''
1243 ldflags_uselargefiles=''
1244 libswanted_uselargefiles=''
1253 usensgetexecutablepath=''
1266 installvendorarch=''
1273 installvendorhtml1dir=''
1275 vendorhtml1direxp=''
1276 installvendorhtml3dir=''
1278 vendorhtml3direxp=''
1284 installvendorman1dir=''
1287 installvendorman3dir=''
1294 installvendorscript=''
1305 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1308 : We must find out about Eunice early
1310 if test -f /etc/unixtovms; then
1311 eunicefix=/etc/unixtovms
1313 if test -f /etc/unixtovms.exe; then
1314 eunicefix=/etc/unixtovms.exe
1317 : Set executable suffix now -- needed before hints available
1318 if test -f "/libs/version.library"; then
1321 elif test -f "/system/gnu_library/bin/ar.pm"; then
1324 elif test -n "$DJGPP"; then
1327 elif test -f /kern/cookiejar; then
1330 elif test -d c:/. -o -n "$is_os2" ; then
1337 : Trailing extension. Override this in a hint file, if needed.
1338 : Extra object files, if any, needed on this platform.
1341 : Possible local include directories to search.
1342 : Set locincpth to "" in a hint file to defeat local include searches.
1343 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1344 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1346 : no include file wanted by default
1349 : Enable -DEBUGGING and -DDEBUGGING from the command line
1354 : change the next line if compiling for Xenix/286 on Xenix/386
1355 xlibpth='/usr/lib/386 /lib/386'
1356 : Possible local library directories to search.
1357 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1358 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1360 : general looking path for locating libraries
1361 glibpth="/lib /usr/lib $xlibpth"
1362 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1363 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1364 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1365 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1367 : Private path used by Configure to find libraries. Its value
1368 : is prepended to libpth. This variable takes care of special
1369 : machines, like the mips. Usually, it should be empty.
1372 : default library list
1374 : some systems want to use only the non-versioned libso:s
1375 ignore_versioned_solibs=''
1376 : set usethreads on the Configure command line to enable threads.
1377 usereentrant='undef'
1381 : set useposix=false in your hint file to disable the POSIX extension.
1383 : set useopcode=false in your hint file to disable the Opcode extension.
1386 ccflags_uselargefiles=''
1387 ldflags_uselargefiles=''
1388 libswanted_uselargefiles=''
1389 : set usemultiplicity on the Configure command line to enable multiplicity.
1390 : set usesocks on the Configure command line to enable socks.
1391 : List of libraries we want.
1392 : If anyone needs extra -lxxx, put those in a hint file.
1393 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1394 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1395 : We probably want to search /usr/shlib before most other libraries.
1396 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1397 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1398 glibpth="/usr/shlib $glibpth"
1399 : Do not use vfork unless overridden by a hint file.
1402 : Find the basic shell for Bourne shell scripts
1406 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1409 if test -f "$xxx"; then
1412 : Build up a list and do a single loop so we can 'break' out.
1413 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1414 for xxx in sh bash ksh pdksh ash; do
1416 try="$try ${p}/${xxx}"
1420 if test -f "$xxx"; then
1423 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1426 elif test -f "$xxx.exe"; then
1437 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1439 Usually it's in /bin/sh. How did you even get this far?
1440 Please contact me (Perl Maintainers) at perlbug@perl.org and
1441 we'll try to straighten this all out.
1447 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1448 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1451 : see if sh knows # comments
1452 if `$sh -c '#' >/dev/null 2>&1`; then
1456 test -f $xcat$_exe || xcat=/usr/bin/cat
1457 if test ! -f $xcat$_exe; then
1458 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1459 if test -f $p/cat$_exe; then
1464 if test ! -f $xcat$_exe; then
1465 echo "Can't find cat anywhere!"
1469 echo "#!$xcat" >sharp
1472 ./sharp > today 2>/dev/null
1473 if test -s today; then
1476 echo "#! $xcat" > sharp
1479 ./sharp > today 2>/dev/null
1480 if test -s today; then
1488 echo "Your $sh doesn't grok # comments--I will strip them later on."
1491 echo "exec grep -v '^[ ]*#'" >spitshell
1493 $eunicefix spitshell
1494 spitshell=`pwd`/spitshell
1496 echo "I presume that if # doesn't work, #! won't work either!"
1501 : figure out how to guarantee sh startup
1503 '') startsh=${sharpbang}${sh} ;;
1515 : echo "Yup, it does."
1517 echo "Hmm... '$startsh' does not guarantee sh startup..."
1518 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1522 : Save command line options in file UU/cmdline.opt for later use in
1523 : generating config.sh.
1524 cat > cmdline.opt <<EOSH
1525 : Configure command line arguments.
1534 cat >>cmdline.opt <<EOSH
1535 config_arg$argn='$arg'
1537 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1540 arg_exp=`cat cmdl.opt`
1541 args_exp="$args_exp$args_sep'$arg_exp'"
1542 argn=`expr $argn + 1`
1547 : produce awk script to parse command line options
1548 cat >options.awk <<'EOF'
1550 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1552 len = length(optstr);
1553 for (i = 1; i <= len; i++) {
1554 c = substr(optstr, i, 1);
1555 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1566 if (substr(str, 1, 1) != "-") {
1567 printf("'%s'\n", str);
1571 for (i = 2; i <= len; i++) {
1572 c = substr(str, i, 1);
1574 printf("-%s\n", substr(str, i));
1580 printf("'%s'\n", substr(str, i + 1));
1593 : process the command line options
1594 set X `for arg in "$@"; do echo "X$arg"; done |
1595 sed -e s/X// | awk -f options.awk`
1600 : set up default values
1610 rm -f optdef.sh posthint.sh
1611 cat >optdef.sh <<EOS
1617 while test $# -gt 0; do
1619 -d) shift; fastread=yes;;
1620 -e) shift; alldone=cont;;
1624 if test -r "$1"; then
1627 echo "$me: cannot read config file $1." >&2
1633 -h) shift; error=true;;
1634 -r) shift; reuseval=true;;
1635 -s) shift; silent=true; realsilent=true;;
1636 -E) shift; alldone=exit;;
1637 -K) shift; knowitall=true;;
1638 -O) shift; override=true;;
1639 -S) shift; silent=true; extractsh=true;;
1644 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1645 echo "$me: ignoring -D $1" >&2
1648 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1649 *) echo "$1='define'" >> optdef.sh;;
1656 *=) echo "$1" >> optdef.sh;;
1658 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1659 echo "$me: ignoring -U $1" >&2
1661 *) echo "$1='undef'" >> optdef.sh;;
1672 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1676 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1677 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1683 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1684 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1685 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1686 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1687 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1688 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1694 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1696 echo "$yyy=''" >> posthint.sh ;;
1701 echo "$yyy='$zzz'" >> posthint.sh ;;
1703 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1705 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1710 echo "$yyy=$zzz" >> posthint.sh ;;
1711 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1715 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1718 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1726 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1727 [-U symbol] [-U symbol=] [-A command:symbol...]
1728 -d : use defaults for all answers.
1729 -e : go on without questioning past the production of config.sh.
1730 -f : specify an alternate default configuration file.
1731 -h : print this help message and exit (with an error status).
1732 -r : reuse C symbols value if possible (skips costly nm extraction).
1733 -s : silent mode, only echoes questions and essential information.
1734 -D : define symbol to have some value:
1735 -D symbol symbol gets the value 'define'
1736 -D symbol=value symbol gets the value 'value'
1737 common used examples (see INSTALL for more info):
1738 -Duse64bitint use 64bit integers
1739 -Duse64bitall use 64bit integers and pointers
1740 -Dusethreads use thread support
1741 -Dinc_version_list=none do not include older perl trees in @INC
1742 -DEBUGGING=none DEBUGGING options
1743 -Dcc=gcc choose your compiler
1744 -Dprefix=/opt/perl5 choose your destination
1745 -E : stop at the end of questions, after having produced config.sh.
1746 -K : do not use unless you know what you are doing.
1747 -O : let -D and -U override definitions from loaded configuration file.
1748 -S : perform variable substitutions on all .SH files (can mix with -f)
1749 -U : undefine symbol:
1750 -U symbol symbol gets the value 'undef'
1751 -U symbol= symbol gets completely empty
1753 -A : manipulate symbol after the platform specific hints have been applied:
1754 -A append:symbol=value append value to symbol
1755 -A symbol=value like append:, but with a separating space
1756 -A define:symbol=value define symbol to have value
1757 -A clear:symbol define symbol to be ''
1758 -A define:symbol define symbol to be 'define'
1759 -A eval:symbol=value define symbol to be eval of value
1760 -A prepend:symbol=value prepend value to symbol
1761 -A undef:symbol define symbol to be 'undef'
1762 -A undef:symbol= define symbol to be ''
1763 e.g.: -A prepend:libswanted='cl pthread '
1764 -A ccflags=-DSOME_MACRO
1765 -V : print version number and exit (with a zero status).
1772 case "$fastread$alldone" in
1775 case "$extractsh" in
1778 if test ! -t 0; then
1779 echo "Say 'sh Configure', not 'sh <Configure'"
1789 true) exec 1>/dev/null;;
1792 : run the defines and the undefines, if any, but leave the file out there...
1795 : create the posthint manipulation script and leave the file out there...
1800 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1801 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1802 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1803 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1804 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1807 : Some greps do not return status, grrr.
1808 echo "grimblepritz" >grimble
1809 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1811 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1817 : the following should work in any shell
1821 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1822 cat >contains <<'EOSS'
1823 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1828 : Find the path to the source tree
1831 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1835 *) src=`cd ../$src && pwd` ;;
1848 if test -f $rsrc/Configure && \
1849 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1851 : found it, so we are ok.
1854 for src in . .. ../.. ../../.. ../../../..; do
1855 if test -f ../$src/Configure && \
1856 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1867 Sorry, I can't seem to locate the source dir for $package. Please start
1868 Configure with an explicit path -- i.e. /some/path/Configure.
1876 echo "Sources for $package found in \"$src\"." >&4
1880 : script used to extract .SH files with variable substitutions
1881 cat >extract <<'EOS'
1883 echo "Doing variable substitutions on .SH files..."
1884 if test -f MANIFEST; then
1885 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1887 echo "(Looking for .SH files under the source directory.)"
1888 set x `(cd "$src"; find . -name "*.SH" -print)`
1892 0) set x `(cd "$src"; echo *.SH)`; shift;;
1894 if test ! -f "$src/$1"; then
1900 while test $name; do
1901 if test ! -d "$name"; then
1902 create="$name $create";
1903 name=`echo $name | sed -e "s|^[^/]*$||"`;
1904 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1909 for file in $create; do
1918 dir=`expr X$file : 'X\(.*\)/'`
1919 file=`expr X$file : 'X.*/\(.*\)'`
1920 (cd "$dir" && . ./$file)
1930 dir=`expr X$file : 'X\(.*\)/'`
1931 file=`expr X$file : 'X.*/\(.*\)'`
1932 (set x $dir; shift; eval $mkdir_p)
1933 sh <"$src/$dir/$file"
1942 if test -f "$src/config_h.SH"; then
1943 if test ! -f config.h; then
1944 : oops, they left it out of MANIFEST, probably, so do it anyway.
1945 . "$src/config_h.SH"
1950 : extract files and exit if asked to do so
1951 case "$extractsh" in
1953 case "$realsilent" in
1957 case "$config_sh" in
1958 '') config_sh='config.sh';;
1961 echo "Fetching answers from $config_sh..."
1964 test "$override" && . ./optdef.sh
1968 echo "Extraction done."
1973 : Eunice requires " " instead of "", can you believe it
1976 echo "Beginning of configuration questions for $package."
1978 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1980 : first determine how to suppress newline on echo command
1982 echo "Checking echo to see how to suppress newlines..."
1983 (echo "hi there\c" ; echo " ") >.echotmp
1984 if $contains c .echotmp >/dev/null 2>&1 ; then
1995 echo $n "The star should be here-->$c"
1999 : Now test for existence of everything in MANIFEST
2001 if test -f "$rsrc/MANIFEST"; then
2002 echo "First let's make sure your kit is complete. Checking..." >&4
2003 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2004 (split -l 50 2>/dev/null || split -50)
2007 for filelist in x??; do
2008 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2009 >/dev/null 2>>"$tmppwd/missing")
2011 if test -s missing; then
2015 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2017 You have the option of continuing the configuration process, despite the
2018 distinct possibility that your kit is damaged, by typing 'y'es. If you
2019 do, don't blame me if something goes wrong. I advise you to type 'n'o
2020 and contact the author (perlbug@perl.org).
2023 echo $n "Continue? [n] $c" >&4
2027 echo "Continuing..." >&4
2031 echo "ABORTING..." >&4
2036 echo "Looks good..."
2039 echo "There is no MANIFEST file. I hope your kit is complete !"
2043 : Find the appropriate value for a newline for tr
2045 if test -n "$DJGPP"; then
2048 if test X"$trnl" = X; then
2049 case "`echo foo|tr '\n' x 2>/dev/null`" in
2053 if test X"$trnl" = X; then
2054 case "`echo foo|tr '\012' x 2>/dev/null`" in
2055 foox) trnl='\012' ;;
2058 if test X"$trnl" = X; then
2059 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2060 fooxy) trnl='\n\r' ;;
2063 if test X"$trnl" = X; then
2066 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2072 : compute the number of columns on the terminal for proper question formatting
2077 : set up the echo used in my read
2078 myecho="case \"\$xxxm\" in
2079 '') echo $n \"\$rp $c\" >&4;;
2081 '') echo $n \"[\$xxxm] $c\";;
2083 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2085 echo $n \"[\$xxxm] $c\" >&4
2087 echo $n \"\$rp [\$xxxm] $c\" >&4
2093 : now set up to do reads with possible shell escape and default assignment
2099 case "\$fastread" in
2100 yes) case "\$dflt" in
2103 case "\$silent-\$rp" in
2108 *) case "\$silent" in
2109 true) case "\$rp" in
2114 while expr "X\$ans" : "X!" >/dev/null; do
2118 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2126 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2135 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2140 echo "(OK, I'll run with -d after this question.)" >&4
2143 echo "*** Sorry, \$1 not supported yet." >&4
2153 echo "*** Substitution done -- please confirm."
2155 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2160 echo "*** Error -- try again."
2167 case "\$ans\$xxxm\$nostick" in
2179 : create .config dir to save info across Configure sessions
2180 test -d ../.config || mkdir ../.config
2181 cat >../.config/README <<EOF
2182 This directory created by Configure to save information that should
2183 persist across sessions for $package.
2185 You may safely delete it if you wish.
2188 : See if we are using a devel version and want that
2189 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2192 usedevel="$define" ;;
2193 *) case "$xversion" in
2196 *** WHOA THERE!!! ***
2198 This is an UNSTABLE DEVELOPMENT release.
2199 The version of this $package distribution is $xversion, that is, odd,
2200 (as opposed to even) and that signifies a development release.
2201 If you want a maintenance release, you want an even-numbered version.
2203 Do ***NOT*** install this into production use.
2204 Data corruption and crashes are possible.
2206 It is most seriously suggested that you do not continue any further
2207 unless you want to help in developing and debugging Perl.
2209 If you *still* want to build perl, you can answer 'y' now,
2210 or pass -Dusedevel to Configure.
2213 rp='Do you really want to continue?'
2217 [yY]) echo >&4 "Okay, continuing."
2218 usedevel="$define" ;;
2219 *) echo >&4 "Okay, bye."
2230 case "$versiononly" in
2231 '') versiononly="$define" ;;
2233 case "$installusrbinperl" in
2234 '') installusrbinperl="$undef" ;;
2239 : general instructions
2242 user=`(logname) 2>/dev/null`
2244 '') user=`whoami 2>&1`;;
2246 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2249 rp='Would you like to see the instructions?'
2260 This installation shell script will examine your system and ask you questions
2261 to determine how the perl5 package should be installed. If you get
2262 stuck on a question, you may use a ! shell escape to start a subshell or
2263 execute a command. Many of the questions will have default answers in square
2264 brackets; typing carriage return will give you the default.
2266 On some of the questions which ask for file or directory names you are allowed
2267 to use the ~name construct to specify the login directory belonging to "name",
2268 even if you don't have a shell which knows about that. Questions where this is
2269 allowed will be marked "(~name ok)".
2273 dflt='Type carriage return to continue'
2277 The prompter used in this script allows you to use shell variables and
2278 backticks in your answers. You may use $1, $2, etc... to refer to the words
2279 in the default answer, as if the default line was a set of arguments given to a
2280 script shell. This means you may also use $* to repeat the whole default line,
2281 so you do not have to re-type everything to add something to the default.
2283 Every time there is a substitution, you will have to confirm. If there is an
2284 error (e.g. an unmatched backtick), the default answer will remain unchanged
2285 and you will be prompted again.
2287 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2288 the questions and use the computed defaults (or the previous answers if there
2289 was already a config.sh file). Type 'Configure -h' for a list of options.
2290 You may also start interactively and then answer '& -d' at any prompt to turn
2291 on the non-interactive behaviour for the remainder of the execution.
2297 Much effort has been expended to ensure that this shell script will run on any
2298 Unix system. If despite that it blows up on yours, your best bet is to edit
2299 Configure and run it again. If you can't run Configure for some reason,
2300 you'll have to generate a config.sh file by hand. Whatever problems you
2301 have, let me (perlbug@perl.org) know how I blew it.
2303 This installation script affects things in two ways:
2305 1) it may do direct variable substitutions on some of the files included
2307 2) it builds a config.h file for inclusion in C programs. You may edit
2308 any of these files as the need arises after running this script.
2310 If you make a mistake on a question, there is no easy way to back up to it
2311 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2312 files. Configure will offer to let you do this before it runs the SH files.
2315 dflt='Type carriage return to continue'
2317 case "$firsttime" in
2318 true) echo $user >>../.config/instruct;;
2322 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2323 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2324 if test "X$sysroot" = X; then
2329 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2330 # _sysroot is used in places where we need --sysroot=foo
2331 # but using the rest of the flags could cause issues.
2332 _sysroot="--sysroot=$sysroot";
2336 ccflags="$ccflags $_sysroot"
2341 ldflags="$ldflags $_sysroot"
2346 cppflags="$cppflags $_sysroot"
2348 # lddlflags updated below in lddlflags section;
2349 # same with cccdlflags
2353 # Adjust some defaults to also use $sysroot
2354 for var in xlibpth loclibpth locincpth glibpth; do
2357 for path in $xxx; do
2358 eval $var=\"\$$var $sysroot$path\"
2364 : find out where common programs are
2366 echo "Locating common programs..." >&4
2379 if test -d \$dir/\$thing; then
2385 for thisthing in \$dir/\$thing; do
2386 : just loop through to pick last item
2388 if test -f \$thisthing; then
2391 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2394 elif test -f \$dir/\$thing.exe; then
2395 if test -n "$DJGPP"; then
2396 echo \$dir/\$thing.exe
2397 elif test "$eunicefix" != ":"; then
2398 : on Eunice apparently
2451 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2452 pth="$pth $sysroot/lib $sysroot/usr/lib"
2453 for file in $loclist; do
2457 if test -f "$xxx"; then
2460 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2461 xxx=`./loc $file $file $pth`
2464 '') xxx=`./loc $file $file $pth`;;
2465 *) xxx=`./loc $xxx $xxx $pth`;;
2467 eval $file=$xxx$_exe
2471 echo $file is in $xxx.
2474 echo $file is in $xxx.
2477 echo "I don't know where '$file' is, and my life depends on it." >&4
2478 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2484 echo "Don't worry if any of the following aren't found..."
2486 for file in $trylist; do
2490 if test -f "$xxx"; then
2493 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2494 xxx=`./loc $file $file $pth`
2497 '') xxx=`./loc $file $file $pth`;;
2498 *) xxx=`./loc $xxx $xxx $pth`;;
2500 eval $file=$xxx$_exe
2504 echo $file is in $xxx.
2507 echo $file is in $xxx.
2510 echo "I don't see $file out there, $say."
2517 echo "Substituting grep for egrep."
2524 *) if $less -R </dev/null >/dev/null; then
2525 echo "Substituting less -R for less."
2533 echo "Substituting cp for ln."
2542 echo "I can't find make or gmake, and my life depends on it." >&4
2543 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2551 *) # We can't have osname yet.
2552 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2553 # Assume that gmake, if found, is definitely GNU make
2554 # and prefer it over the system make.
2555 echo "Substituting gmake for make."
2563 echo "Hopefully test is built into your sh."
2566 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2567 echo "Using the test built into your sh."
2575 echo "Hopefully echo is built into your sh."
2580 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2581 $echo $n "hi there$c" >foo1
2582 echo $n "hi there$c" >foo2
2583 if cmp foo1 foo2 >/dev/null 2>&1; then
2584 echo "They are compatible. In fact, they may be identical."
2591 They are not compatible! You are probably running ksh on a non-USG system.
2592 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2593 have echo built in and we may have to run some Bourne shell scripts. That
2594 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2597 $echo $n "The star should be here-->$c"
2604 # This question was auctioned at YAPC::Europe-2007 in Vienna
2605 # I never promised you could answer it. I only auctioned the question.
2607 The following message is sponsored by
2609 Dresden.pm<--The stars should be here.
2611 Dear Perl user, system administrator or package
2612 maintainer, the Perl community sends greetings to
2613 you. Do you (emblematical) greet back [Y/n]? n
2617 : Check what type of C compiler we use
2621 cat <<'EOSC' >>trygcc
2626 int main(int argc, char *argv[]) {
2630 if $cc -o try $ccflags $ldflags try.c; then
2633 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2639 # Skip this test because it gives a false match on output like:
2640 # ./trygcc: line 23: cc: command not found
2641 # case "`$cc -v -c try.c 2>&1`" in
2642 # *gcc*) trygcc=no ;;
2644 if $test X"$trygcc" = Xyes; then
2645 if gcc -o try -c try.c; then
2647 echo "You seem to have a working gcc, though." >&4
2648 # Switching compilers may undo the work of hints files.
2649 # The most common problem is -D_REENTRANT for threads.
2650 # This heuristic catches that case, but gets false positives
2651 # if -Dusethreads was not actually specified. Better to
2652 # bail out here with a useful message than fail
2653 # mysteriously later. Should we perhaps just try to
2654 # re-invoke Configure -Dcc=gcc config_args ?
2655 if $test -f usethreads.cbu; then
2658 *** However, any setting of the C compiler flags (e.g. for thread support)
2659 *** will be lost. It may be necessary for you to restart Configure and
2660 *** add -Dcc=gcc to your Configure command line.
2663 rp="Would you like to go ahead and try gcc anyway?"
2666 rp="Would you like to use it?"
2669 if $test -f myread; then
2672 if $test -f UU/myread; then
2675 echo "Cannot find myread, sorry. Aborting." >&2
2680 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2693 cat <<'EOSC' >>checkcc
2698 int main(int argc, char *argv[]) {
2702 if $cc -o try $ccflags $ldflags try.c; then
2705 if $test X"$despair" = Xyes; then
2706 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2709 You need to find a working C compiler.
2710 Either (purchase and) install the C compiler supplied by your OS vendor,
2711 or for a free C compiler try http://gcc.gnu.org/
2712 I cannot continue any further, aborting.
2721 : determine whether symbolic links are supported
2724 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2725 echo "Symbolic links are supported." >&4
2728 echo "Symbolic links are NOT supported." >&4
2733 : determine whether symbolic links are supported
2737 echo "Checking how to test for symbolic links..." >&4
2739 if $test "X$issymlink" = X; then
2741 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2742 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2744 if test $? = 0; then
2747 echo "Your builtin 'test -h' may be broken." >&4
2750 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2753 if test -f "$p/$test"; then
2762 echo "Trying external '$test -h'." >&4
2763 issymlink="$test -h"
2764 if $test ! -h sym >/dev/null 2>&1; then
2765 echo "External '$test -h' is broken, too." >&4
2773 if $test "X$issymlink" = X; then
2774 if $test -L sym 2>/dev/null; then
2775 issymlink="$test -L"
2776 echo "The builtin '$test -L' worked." >&4
2779 if $test "X$issymlink" != X; then
2780 echo "You can test for symbolic links with '$issymlink'." >&4
2782 echo "I do not know how you can test for symbolic links." >&4
2786 *) echo "No symbolic links, so not testing for their testing..." >&4
2791 : Make symlinks util
2792 case "$mksymlinks" in
2795 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2798 *) case "$lns:$issymlink" in
2799 *"ln"*" -s:"*"test -"?)
2800 echo "Creating the symbolic links..." >&4
2801 echo "(First creating the subdirectories...)" >&4
2803 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2805 test -z "$directory" && break
2809 if test ! -d t/base; then
2810 echo "Failed to create the subdirectories. Aborting." >&4
2813 echo "(Then creating the symlinks...)" >&4
2814 awk '{print $1}' $src/MANIFEST | while true; do
2816 test -z "$filename" && break
2817 if test -f $filename; then
2818 if $issymlink $filename; then
2822 if test -f $filename; then
2823 echo "$filename already exists, not symlinking."
2825 ln -s $src/$filename $filename
2829 if test ! -f t/base/lex.t; then
2830 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2835 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2843 : Check for Cross-Compilation
2844 if $test "X$targethost" = "X"; then
2847 if $test "X$targetenv" = "X"; then
2850 case "$usecrosscompile" in
2852 $echo "Cross-compiling..."
2855 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2856 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2857 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2858 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2859 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2860 # leave out ld, choosing it is more complex
2861 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2862 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2863 # We are in a weird spot. Just before us, some values
2864 # were 'saved', to be restored after the hints are
2865 # run. This means that the changes we made to ar,
2866 # nm and ranlib will get reverted.
2867 # To avoid that, we hijack the saving mechanism and
2868 # have it save our new values.
2869 for file in ar nm ranlib; do
2871 eval $file=$xxx$_exe
2876 case "$targetarch" in
2877 '') echo "Targetarch not defined." >&4; croak=y ;;
2878 *) echo "Using targetarch $targetarch." >&4 ;;
2880 case "$targethost" in
2881 '') echo "Targethost not defined." >&4; croak=y ;;
2882 *) echo "Using targethost $targethost." >&4
2887 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2889 : compile a host miniperl and generate_uudmap, unless we got passed them
2890 if $test "X$hostperl" = X; then
2891 echo "Building host miniperl and generate_uudmap binaries" >&4
2899 $src/Configure -des -Dusedevel -Dmksymlinks
2901 case "$hostgenerate" in
2902 '') $make generate_uudmap
2903 hostgenerate=$src/host/generate_uudmap
2905 "$undef") hostgenerate=''
2908 hostperl=$src/host/miniperl
2911 hostosname=`$hostperl -le 'print $^O'`
2914 usecrosscompile="$undef"
2918 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2919 case "$targethost" in
2920 '') echo "Checking for cross-compile" >&4
2921 case "$usecrosscompile$multiarch" in
2922 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2923 if [ -f Makefile ]; then
2925 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2927 echo "Configure done."
2931 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2938 *) echo "Using targethost $targethost." >&4
2940 /*) run=$src/Cross/run
2941 targetmkdir=$src/Cross/mkdir
2943 from=$src/Cross/from
2945 *) pwd=`$test -f ../Configure & cd ..; pwd`
2947 targetmkdir=$pwd/Cross/mkdir
2949 from=$pwd/Cross/from
2952 case "$targetrun" in
2953 '') targetrun=ssh ;;
2958 case "$targetfrom" in
2959 '') targetfrom=scp ;;
2963 from=$from-$targetfrom
2964 case "$targetdir" in
2966 echo "Guessing targetdir $targetdir." >&4
2969 case "$targetuser" in
2971 echo "Guessing targetuser $targetuser." >&4
2974 case "$targetport" in
2976 echo "Guessing targetport $targetport." >&4
2979 case "$targetfrom" in
2983 case "$targetrun" in
3003 '') cwd=$targetdir ;;
3008 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3014 *) echo "Unknown targetrun '$targetrun'" >&4
3018 case "$targetmkdir" in
3020 cat >$targetmkdir <<EOF
3022 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3024 $chmod a+rx $targetmkdir
3026 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3038 $targetmkdir \`dirname \$f\`
3039 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3042 $targetmkdir $targetdir/\`dirname \$f\`
3043 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3056 $mkdir -p $targetdir/\`dirname \$f\`
3057 $cp \$f $targetdir/\$f || exit 1
3060 $targetmkdir $targetdir/\`dirname \$f\`
3061 $cp \$f $targetdir/\$f || exit 1
3068 *) echo "Unknown targetto '$targetto'" >&4
3072 case "$targetfrom" in
3079 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3084 cp) cat >$from <<EOF
3089 cp $targetdir/\$f . || exit 1
3094 *) echo "Unknown targetfrom '$targetfrom'" >&4
3098 if $test ! -f $run; then
3099 echo "Target 'run' script '$run' not found." >&4
3103 if $test ! -f $to; then
3104 echo "Target 'to' script '$to' not found." >&4
3108 if $test ! -f $from; then
3109 echo "Target 'from' script '$from' not found." >&4
3113 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3117 Using '$run' for remote execution,
3118 and '$from' and '$to'
3119 for remote file transfer.
3125 usecrosscompile="$undef"
3130 : see whether [:lower:] and [:upper:] are supported character classes
3132 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3134 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3138 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3139 # (0xd9 and 0xe2), therefore that is a nice testing point.
3140 if test "X$up" = X -o "X$low" = X; then
3141 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3147 if test "X$up" = X -o "X$low" = X; then
3148 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3154 if test "X$up" = X -o "X$low" = X; then
3155 case "`echo RS | od -x 2>/dev/null`" in
3157 echo "Hey, this might be EBCDIC." >&4
3158 if test "X$up" = X -o "X$low" = X; then
3159 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3160 rs) up='[A-IJ-RS-Z]'
3165 if test "X$up" = X -o "X$low" = X; then
3166 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3176 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3178 echo "Using $up and $low to convert case." >&4
3181 echo "I don't know how to translate letters from upper to lower case." >&4
3182 echo "Your tr is not acting any way I know of." >&4
3186 : set up the translation script tr, must be called with ./tr of course
3190 '[A-Z][a-z]') exec $tr '$up' '$low';;
3191 '[a-z][A-Z]') exec $tr '$low' '$up';;
3198 : Try to determine whether config.sh was made on this system
3199 case "$config_sh" in
3201 myuname=`$uname -a 2>/dev/null`
3202 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3203 # Downcase everything to avoid ambiguity.
3204 # Remove slashes and single quotes so we can use parts of this in
3205 # directory and file names.
3206 # Remove newlines so myuname is sane to use elsewhere.
3207 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3208 # because the A-Z/a-z are not consecutive.
3209 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3210 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3211 newmyuname="$myuname"
3213 case "$knowitall" in
3215 if test -f ../config.sh; then
3216 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3217 eval "`grep myuname= ../config.sh`"
3219 if test "X$myuname" = "X$newmyuname"; then
3227 : Get old answers from old config file if Configure was run on the
3228 : same system, otherwise use the hints.
3231 if test -f config.sh; then
3233 rp="I see a config.sh file. Shall I use it to set the defaults?"
3236 n*|N*) echo "OK, I'll ignore it."
3237 mv config.sh config.sh.old
3238 myuname="$newmyuname"
3240 *) echo "Fetching default answers from your old config.sh file..." >&4
3248 : Older versions did not always set $sh. Catch re-use of such
3258 if test ! -f config.sh; then
3261 First time through, eh? I have some defaults handy for some systems
3262 that need some extra help getting the Configure answers right:
3265 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3267 : Half the following guesses are probably wrong... If you have better
3268 : tests or hints, please send them to perlbug@perl.org
3269 : The metaconfig authors would also appreciate a copy...
3270 $test -f /irix && osname=irix
3271 $test -f /xenix && osname=sco_xenix
3272 $test -f /dynix && osname=dynix
3273 $test -f /dnix && osname=dnix
3274 $test -f /lynx.os && osname=lynxos
3275 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3276 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3277 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3278 $test -f /bin/mips && /bin/mips && osname=mips
3279 $test -d /usr/apollo/bin && osname=apollo
3280 $test -f /etc/saf/_sactab && osname=svr4
3281 $test -d /usr/include/minix && osname=minix
3282 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3283 if $test -d /MachTen -o -d /MachTen_Folder; then
3285 if $test -x /sbin/version; then
3286 osvers=`/sbin/version | $awk '{print $2}' |
3287 $sed -e 's/[A-Za-z]$//'`
3288 elif $test -x /usr/etc/version; then
3289 osvers=`/usr/etc/version | $awk '{print $2}' |
3290 $sed -e 's/[A-Za-z]$//'`
3296 $test -f /sys/posix.dll &&
3297 $test -f /usr/bin/what &&
3298 set X `/usr/bin/what /sys/posix.dll` &&
3299 $test "$3" = UWIN &&
3303 if $test -f $uname; then
3311 umips) osname=umips ;;
3314 [23]100) osname=mips ;;
3316 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3317 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3320 elif $test -f /etc/kconfig; then
3322 if test "$lns" = "$ln -s"; then
3324 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3326 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3333 if test -n "$DJGPP"; then
3342 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3344 # oslevel can fail with:
3345 # oslevel: Unable to acquire lock.
3346 *not\ found) osvers="$4"."$3" ;;
3347 '<3240'|'<>3240') osvers=3.2.0 ;;
3348 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3349 '=3250'|'>3250') osvers=3.2.5 ;;
3353 bitrig) osname=bitrig
3356 bsd386) osname=bsd386
3359 cygwin*) osname=cygwin
3362 *dc.osx) osname=dcosx
3368 domainos) osname=apollo
3374 dragonfly) osname=dragonfly
3377 dynixptx*) osname=dynixptx
3378 osvers=`echo "$4"|sed 's/^v//'`
3380 freebsd) osname=freebsd
3382 genix) osname=genix ;;
3386 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3399 $test -f /system/lib/libandroid.so && osname=linux-android
3403 netbsd*) osname=netbsd
3406 news-os) osvers="$3"
3408 4*) osname=newsos4 ;;
3412 nonstop-ux) osname=nonstopux ;;
3413 openbsd) osname=openbsd
3419 POSIX-BC | posix-bc ) osname=posix-bc
3422 powerux | power_ux | powermax_os | powermaxos | \
3423 powerunix | power_unix) osname=powerux
3429 solaris) osname=solaris
3431 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3438 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3442 titanos) osname=titanos
3451 ultrix) osname=ultrix
3454 osf1|mls+) case "$5" in
3457 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3460 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3463 hp*) osname=hp_osf1 ;;
3464 mips) osname=mips_osf1 ;;
3467 # UnixWare 7.1.2 is known as Open UNIX 8
3468 openunix|unixware) osname=svr5
3476 $2) case "$osname" in
3480 : svr4.x or possibly later
3490 if test -f /stand/boot ; then
3491 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3492 if test -n "$INITPROG" -a -f "$INITPROG"; then
3493 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3494 if test -n "$isesix"; then
3502 *) if test -f /etc/systemid; then
3504 set `echo $3 | $sed 's/\./ /g'` $4
3505 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3507 elif $test -f $src/hints/sco_$1_$2.sh; then
3509 elif $test -f $src/hints/sco_$1.sh; then
3514 '') : Still unknown. Probably a generic Sys V.
3523 *) case "$osname" in
3524 '') : Still unknown. Probably a generic BSD.
3532 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3533 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3534 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3537 $rm -f UU/kernel.what
3538 elif test -d c:/. -o -n "$is_os2" ; then
3545 case "$targetarch" in
3548 case "$targetarch" in
3550 # Will load qnx.sh, which should change osname to nto
3555 # Catch arm-linux-androideabi, mipsel-linux-android,
3556 # and i686-linux-android
3557 osname=linux-android
3561 # Something like arm-linux-gnueabihf is really just
3568 # XXX perhaps we should just assume
3569 # osvers to be 2, or maybe take the value
3570 # from targetarch. Using $run before the
3571 # hints are run is somewhat icky.
3572 set X `$run $uname -a 2>/dev/null`
3575 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3580 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3587 : Now look for a hint file osname_osvers, unless one has been
3588 : specified already.
3591 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3592 : Also try without trailing minor version numbers.
3593 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3594 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3595 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3596 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3599 *) case "$osvers" in
3602 *) if $test -f $src/hints/$file.sh ; then
3604 elif $test -f $src/hints/$xfile.sh ; then
3606 elif $test -f $src/hints/$xxfile.sh ; then
3608 elif $test -f $src/hints/$xxxfile.sh ; then
3610 elif $test -f $src/hints/$xxxxfile.sh ; then
3612 elif $test -f "$src/hints/${osname}.sh" ; then
3621 if $test -f Policy.sh ; then
3624 none) dflt="Policy" ;;
3625 *) dflt="Policy $dflt" ;;
3630 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3634 if $test -f Policy.sh ; then
3637 There's also a Policy hint file available, which should make the
3638 site-specific (policy) questions easier to answer.
3645 You may give one or more space-separated answers, or "none" if appropriate.
3646 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3647 previous run of Configure, you may specify it as well as or instead of
3648 OS-specific hints. If hints are provided for your OS, you should use them:
3649 although Perl can probably be built without hints on many platforms, using
3650 hints often improve performance and may enable features that Configure can't
3651 set up on its own. If there are no hints that match your OS, specify "none";
3652 DO NOT give a wrong version or a wrong OS.
3656 rp="Which of these apply, if any?"
3659 for file in $tans; do
3660 if $test X$file = XPolicy -a -f Policy.sh; then
3662 $cat Policy.sh >> UU/config.sh
3663 elif $test -f $src/hints/$file.sh; then
3664 . $src/hints/$file.sh
3665 $cat $src/hints/$file.sh >> UU/config.sh
3666 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3669 : Give one chance to correct a possible typo.
3670 echo "$file.sh does not exist"
3672 rp="hint to use instead?"
3674 for file in $ans; do
3675 if $test -f "$src/hints/$file.sh"; then
3676 . $src/hints/$file.sh
3677 $cat $src/hints/$file.sh >> UU/config.sh
3678 elif $test X$ans = X -o X$ans = Xnone ; then
3681 echo "$file.sh does not exist -- ignored."
3688 : Remember our hint file for later.
3689 if $test -f "$src/hints/$file.sh" ; then
3699 echo "Fetching default answers from $config_sh..." >&4
3703 cp $config_sh config.sh 2>/dev/null
3713 test "$override" && . ./optdef.sh
3715 : Restore computed paths
3716 for file in $loclist $trylist; do
3717 eval $file="\$_$file"
3722 Configure uses the operating system name and version to set some defaults.
3723 The default value is probably right if the name rings a bell. Otherwise,
3724 since spelling matters for me, either accept the default or answer "none"
3731 ''|' '|none) dflt=none ;;
3732 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3735 *) dflt="$osname" ;;
3737 rp="Operating system name?"
3741 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3747 ''|' '|none) dflt=none ;;
3748 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3749 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3751 ''|' ') dflt=none ;;
3756 *) dflt="$osvers" ;;
3758 rp="Operating system version?"
3768 : who configured the system
3769 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3772 cf_by=`(logname) 2>/dev/null`
3775 cf_by=`(whoami) 2>/dev/null`
3777 "") cf_by=unknown ;;
3782 : decide how portable to be. Allow command line overrides.
3783 case "$d_portable" in
3785 *) d_portable="$define" ;;
3788 : set up shell script to do ~ expansion
3794 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3797 if $test -f /bin/csh; then
3798 /bin/csh -f -c "glob \$1"
3803 name=\`$expr x\$1 : '..\([^/]*\)'\`
3804 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3805 if $test ! -d "\$dir"; then
3807 echo "\$me: can't locate home directory for: \$name" >&2
3812 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3828 : now set up to get a file name
3832 cat <<'EOSC' >>getfile
3848 : getfile will accept an answer from the comma-separated list
3849 : enclosed in parentheses even if it does not meet other criteria.
3850 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3851 fn=`echo $fn | sed 's/(.*)//'`
3857 loc_file=`expr $fn : '.*:\(.*\)'`
3858 fn=`expr $fn : '\(.*\):.*'`
3866 */*) fullpath=true;;
3875 *e*) exp_file=true;;
3878 *p*) nopath_ok=true;;
3883 *d*) type='Directory';;
3884 *l*) type='Locate';;
3889 Locate) what='File';;
3894 case "$d_portable" in
3902 while test "$type"; do
3907 true) rp="$rp (~name ok)";;
3910 if test -f UU/getfile.ok && \
3911 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3930 value=`UU/filexp $ans`
3933 if test "$ans" != "$value"; then
3934 echo "(That expands to $value on this system.)"
3948 /*) value="$ansexp" ;;
3949 [a-zA-Z]:/*) value="$ansexp" ;;
3954 echo "I shall only accept a full path name, as in /bin/ls." >&4
3955 echo "Use a ! shell escape if you wish to check pathnames." >&4
3958 echo "Please give a full path name, starting with slash." >&4
3961 echo "Note that using ~name is ok provided it expands well." >&4
3974 for fp in $gfpth; do
3975 if test "X$fp" = X.; then
3980 if test -f "$pf"; then
3982 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3984 echo "($value is not a plain file, but that's ok.)"
3987 if test X"$type" = X; then
3994 for fp in $gfpth; do
3995 if test "X$fp" = X.; then
4000 direxp="$fp/$ansexp"
4002 if test -d "$direxp"; then
4010 if test -d "$ansexp"; then
4011 echo "(Looking for $loc_file in directory $value.)"
4012 value="$value/$loc_file"
4013 ansexp="$ansexp/$loc_file"
4015 if test -f "$ansexp"; then
4018 case "$nopath_ok" in
4019 true) case "$value" in
4021 *) echo "Assuming $value will be in people's path."
4037 if test "$fastread" = yes; then
4042 rp="$what $value doesn't exist. Use that name anyway?"
4061 test "X$gfpthkeep" != Xy && gfpth=""
4064 : determine root of directory hierarchy where package will be installed.
4067 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4070 dflt=`echo "$prefix" | sed 's/.$//'`
4078 By default, $package will be installed in $dflt/bin, manual pages
4079 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4080 installation directories. Typically this is something like /usr/local.
4081 If you wish to have binaries under /usr/bin but other parts of the
4082 installation under /usr/local, that's ok: you will be prompted
4083 separately for each of the installation directories, the prefix being
4084 only used to set the defaults.
4088 rp='Installation prefix to use?'
4096 *) oldprefix="$prefix";;
4103 : allow them to override the AFS root
4106 *) afsroot=$afsroot ;;
4112 $define|true) afs=true ;;
4113 $undef|false) afs=false ;;
4114 *) if $test -d $afsroot; then
4122 echo "AFS may be running... I'll be extra cautious then..." >&4
4124 echo "AFS does not seem to be running..." >&4
4127 : determine installation prefix for where package is to be installed.
4131 Since you are running AFS, I need to distinguish the directory in which
4132 files will reside from the directory in which they are installed (and from
4133 which they are presumably copied to the former directory by occult means).
4136 case "$installprefix" in
4137 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4138 *) dflt="$installprefix";;
4143 In some special cases, particularly when building $package for distribution,
4144 it is convenient to distinguish the directory in which files should be
4145 installed from the directory ($prefix) in which they will
4146 eventually reside. For most users, these two directories are the same.
4149 case "$installprefix" in
4151 *) dflt=$installprefix;;
4155 rp='What installation prefix should I use for installing files?'
4157 installprefix="$ans"
4158 installprefixexp="$ansexp"
4160 : Perform the prefixexp/installprefixexp correction if necessary
4161 cat <<EOS >installprefix
4164 cat <<'EOSC' >>installprefix
4165 : Change installation prefix, if necessary.
4166 if $test X"$prefix" != X"$installprefix"; then
4167 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4169 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4172 chmod +x installprefix
4173 $eunicefix installprefix
4175 : Set variables such as privlib and privlibexp from the output of ./getfile
4176 : performing the prefixexp/installprefixexp correction if necessary.
4177 cat <<EOS >setprefixvar
4180 cat <<'EOSC' >>setprefixvar
4181 eval "${prefixvar}=\"\$ans\""
4182 eval "${prefixvar}exp=\"\$ansexp\""
4185 chmod +x setprefixvar
4186 $eunicefix setprefixvar
4188 : set up the script used to warn in case of inconsistency
4197 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4199 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4200 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4205 echo "*** WHOA THERE!!! ***" >&4
4206 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4209 rp=" Keep the $hint value?"
4212 y) td=$was; tu=$was;;
4216 : function used to set '$1' to '$val'
4217 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4219 $define$undef) . ./whoa; eval "$var=\$td";;
4220 $undef$define) . ./whoa; eval "$var=\$tu";;
4221 *) eval "$var=$val";;
4224 : get the patchlevel
4226 echo "Getting the current patchlevel..." >&4
4227 if $test -r $rsrc/patchlevel.h;then
4228 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4229 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4230 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4231 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4232 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4233 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4234 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4243 $echo "(You do not have patchlevel.h. Eek.)"
4245 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4246 version_patchlevel_string="version $patchlevel subversion $subversion"
4247 case "$perl_patchlevel" in
4249 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4250 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4254 $echo "(You have $package $version_patchlevel_string.)"
4258 : XXX Should be a Configure test for double-dots in filenames.
4259 version=`echo $revision $patchlevel $subversion | \
4260 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4261 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4262 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4265 version=`echo $revision $patchlevel $subversion | \
4266 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4267 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4268 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4271 : Special case the 5.005_xx maintenance series, which used 5.005
4272 : without any subversion label as a subdirectory in $sitelib
4273 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4274 api_versionstring='5.005'
4277 : Do we want threads support and if so, what type
4278 case "$usethreads" in
4279 $define|true|[yY]*) dflt='y';;
4280 *) # Catch case where user specified ithreads or 5005threads but
4281 # forgot -Dusethreads (A.D. 4/2002)
4282 case "$useithreads$use5005threads" in
4283 *$define*) dflt='y';;
4290 Perl can be built to offer a form of threading support on some systems
4291 To do so, Configure can be run with -Dusethreads.
4293 Note that Perl built with threading support runs slightly slower
4294 and uses slightly more memory than plain Perl.
4296 If this doesn't make any sense to you, just accept the default '$dflt'.
4298 rp='Build a threading Perl?'
4301 y|Y) val="$define" ;;
4307 if $test $patchlevel -lt 9; then
4308 case "$usethreads" in
4310 : Default to ithreads unless overridden on command line or with
4313 case "$use5005threads" in
4315 echo "5.005 threads are no longer supported"
4319 case "$useithreads" in
4320 $undef|false|[nN]*) dflt='n';;
4322 rp='Use the newer interpreter-based ithreads?'
4325 y|Y) val="$define" ;;
4330 : Now set use5005threads to the opposite value.
4331 case "$useithreads" in
4332 $define) val="$undef" ;;
4339 useithreads="$undef"
4340 use5005threads="$undef"
4344 case "$useithreads$use5005threads" in
4348 You cannot have both the ithreads and the 5.005 threads enabled
4349 at the same time. Disabling the 5.005 threads since they are
4350 much less stable than the ithreads.
4353 use5005threads="$undef"
4358 : perl-5.9.x and later
4360 if test X"$usethreads" = "X$define"; then
4361 case "$use5005threads" in
4365 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4372 use5005threads="$undef"
4373 useithreads="$usethreads"
4376 case "$d_oldpthreads" in
4377 '') : Configure tests would be welcome here. For now, assume undef.
4379 *) val="$d_oldpthreads" ;;
4385 : Look for a hint-file generated 'call-back-unit'. If the
4386 : user has specified that a threading perl is to be built,
4387 : we may need to set or change some other defaults.
4388 if $test -f usethreads.cbu; then
4389 echo "Your platform has some specific hints regarding threaded builds, using them..."
4392 case "$usethreads" in
4393 "$define"|true|[yY]*)
4395 (Your platform does not have any specific hints for threaded builds.
4396 Assuming POSIX threads, then.)
4402 : Check if multiplicity is required
4405 Perl can be built so that multiple Perl interpreters can coexist
4406 within the same Perl executable.
4409 case "$useithreads" in
4412 This multiple interpreter support is required for interpreter-based threads.
4416 *) case "$usemultiplicity" in
4417 $define|true|[yY]*) dflt='y';;
4421 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4422 rp='Build Perl for multiplicity?'
4425 y|Y) val="$define" ;;
4433 : Check if morebits is requested
4434 case "$usemorebits" in
4435 "$define"|true|[yY]*)
4436 use64bitint="$define"
4437 uselongdouble="$define"
4438 usemorebits="$define"
4440 *) usemorebits="$undef"
4444 : Determine the C compiler to be used
4450 rp="Use which C compiler?"
4454 : See whether they have no cc but they do have gcc
4456 if $test -f cc.cbu; then
4461 : make some quick guesses about what we are up against
4463 $echo $n "Hmm... $c"
4473 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4474 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4476 echo "Looks kind of like an OSF/1 system, but we'll see..."
4478 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4479 xxx=`./loc addbib blurfl $pth`
4480 if $test -f $xxx; then
4481 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4485 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4486 echo "Looks kind of like an extended USG system, but we'll see..."
4488 echo "Looks kind of like a USG system, but we'll see..."
4492 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4493 echo "Looks kind of like a BSD system, but we'll see..."
4497 echo "Looks kind of like a Version 7 system, but we'll see..."
4500 case "$eunicefix" in
4503 There is, however, a strange, musty smell in the air that reminds me of
4504 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4508 : it so happens the Eunice I know will not run shell scripts in Unix format
4512 echo "Congratulations. You aren't running Eunice."
4516 : Detect OS2. The p_ variable is set above in the Head.U unit.
4517 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4518 : semicolon as a patch separator
4523 I have the feeling something is not exactly right, however...don't tell me...
4524 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4525 (Or you may be running DOS with DJGPP.)
4530 if test -f /xenix; then
4531 echo "Actually, this looks more like a XENIX system..."
4536 echo "It's not Xenix..."
4541 if test -f /venix; then
4542 echo "Actually, this looks more like a VENIX system..."
4549 echo "Nor is it Venix..."
4552 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4553 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4556 : Check if we are using GNU gcc and what its version is
4558 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4562 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4564 printf("%s\n", __VERSION__);
4566 printf("%s\n", "1");
4572 if $cc -o try $ccflags $ldflags try.c; then
4573 gccversion=`$run ./try`
4574 case "$gccversion" in
4575 '') echo "You are not using GNU cc." ;;
4576 *) echo "You are using GNU cc $gccversion."
4582 echo "*** WHOA THERE!!! ***" >&4
4583 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4584 case "$knowitall" in
4586 echo " You'd better start hunting for one and let me know about it." >&4
4592 case "$gccversion" in
4593 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4595 case "$gccversion" in
4596 '') gccosandvers='' ;;
4597 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4598 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4600 case "$gccosandvers" in
4601 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4602 $osname$osvers) ;; # looking good
4603 $osname*) cat <<EOM >&4
4605 *** WHOA THERE!!! ***
4607 Your gcc has not been compiled for the exact release of
4608 your operating system ($gccosandvers versus $osname$osvers).
4610 In general it is a good idea to keep gcc synchronized with
4611 the operating system because otherwise serious problems
4612 may ensue when trying to compile software, like Perl.
4614 I'm trying to be optimistic here, though, and will continue.
4615 If later during the configuration and build icky compilation
4616 problems appear (headerfile conflicts being the most common
4617 manifestation), I suggest reinstalling the gcc to match
4618 your operating system release.
4622 *) gccosandvers='' ;; # failed to parse, better be silent
4630 # gcc 3.* complain about adding -Idirectories that they already know about,
4631 # so we will take those off from locincpth.
4632 case "$gccversion" in
4634 echo "main(){}">try.c
4635 for incdir in $locincpth; do
4636 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4637 grep '^c[cp]p*[01]: warning: changing search order '`
4638 if test "X$warn" != X; then
4639 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4645 # gcc 4.9 by default does some optimizations that break perl.
4646 # see ticket 121505.
4648 # The -fwrapv disables those optimizations (and probably others,) so
4649 # for gcc 4.9 (and later, since the optimizations probably won't go
4650 # away), add -fwrapv unless the user requests -fno-wrapv, which
4651 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4652 # which turns the overflows -fwrapv ignores into runtime errors.
4653 case "$gccversion" in
4654 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4656 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4657 *) ccflags="$ccflags -fwrapv" ;;
4661 : What should the include directory be ?
4662 : Use sysroot if set, so findhdr looks in the right place.
4664 $echo $n "Hmm... $c"
4665 dflt="$sysroot/usr/include"
4668 if $test -f /bin/mips && /bin/mips; then
4669 echo "Looks like a MIPS system..."
4670 $cat >usr.c <<'EOCP'
4671 #ifdef SYSTYPE_BSD43
4675 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4676 dflt='/bsd43/usr/include'
4680 mips_type='System V'
4682 $rm -f usr.c usr.out
4683 echo "and you're compiling with the $mips_type compiler and libraries."
4687 echo "Doesn't look like a MIPS system."
4697 case "$xxx_prompt" in
4700 rp='Where are the include files you want to use?'
4708 : see how we invoke the C preprocessor
4710 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4711 cat <<'EOT' >testcpp.c
4717 if test ! -f cppstdin; then
4718 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4719 # AIX cc -E doesn't show the absolute headerfile
4720 # locations but we'll cheat by using the -M flag.
4721 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
4723 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4726 echo "Keeping your $hint cppstdin wrapper."
4729 wrapper=`pwd`/cppstdin
4733 if $test "X$cppstdin" != "X" && \
4734 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4735 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4737 echo "You used to use $cppstdin $cppminus so we'll use that again."
4739 '') echo "But let's see if we can live without a wrapper..." ;;
4741 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4742 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4744 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4747 echo "(However, $cpprun $cpplast does not work, let's see...)"
4755 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4762 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4763 $cc -E <testcpp.c >testcpp.out 2>&1; \
4764 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4765 echo "Yup, it does."
4766 x_cpp="$cc $cppflags -E"
4768 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4769 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4770 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4771 echo "Yup, it does."
4772 x_cpp="$cc $cppflags -E"
4774 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4775 $cc -P <testcpp.c >testcpp.out 2>&1; \
4776 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4777 echo "Yipee, that works!"
4778 x_cpp="$cc $cppflags -P"
4780 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4781 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4782 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4783 echo "At long last!"
4784 x_cpp="$cc $cppflags -P"
4786 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4787 $cpp <testcpp.c >testcpp.out 2>&1; \
4788 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4790 x_cpp="$cpp $cppflags"
4792 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4793 $cpp - <testcpp.c >testcpp.out 2>&1; \
4794 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4795 echo "Hooray, it works! I was beginning to wonder."
4796 x_cpp="$cpp $cppflags"
4798 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4799 $wrapper <testcpp.c >testcpp.out 2>&1; \
4800 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4806 rp="No dice. I can't find a C preprocessor. Name one:"
4810 $x_cpp <testcpp.c >testcpp.out 2>&1
4811 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4812 echo "OK, that will do." >&4
4814 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4829 echo "Perhaps can we force $cc -E using a wrapper..."
4830 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4837 echo "Nope, we'll have to live without it..."
4851 "$wrapper"|'cppstdin') ;;
4852 *) $rm -f $wrapper;;
4854 $rm -f testcpp.c testcpp.out
4856 : Adjust cppfilter for path component separator
4858 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4859 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4863 : Use gcc to determine libpth and incpth
4864 # If using gcc or clang, we can get better values for libpth, incpth
4865 # and usrinc directly from the compiler.
4866 # Note that ccname for clang is also gcc.
4869 $echo 'extern int foo;' > try.c
4870 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4872 if $test $# -gt 0; then
4874 incpth="`$echo $incpth|$sed 's/^ //'`"
4876 j="`$echo $i|$sed 's,/include$,/lib,'`"
4877 if $test -d $j; then
4881 libpth="`$echo $libpth|$sed 's/^ //'`"
4882 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4883 if $test -d $xxx; then
4886 *) libpth="$libpth $xxx";;
4893 '') for i in $incpth; do
4894 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4902 case "$usecrosscompile" in
4905 '') echo "Incpth not defined." >&4; croak=y ;;
4906 *) echo "Using incpth '$incpth'." >&4 ;;
4909 '') echo "Libpth not defined." >&4; croak=y ;;
4910 *) echo "Using libpth '$libpth'." >&4 ;;
4913 '') echo "Usrinc not defined." >&4; croak=y ;;
4914 *) echo "Using usrinc $usrinc." >&4 ;;
4918 if test "X$sysroot" = X; then
4919 echo "Cannot continue, aborting." >&4; exit 1
4921 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4930 : Default value for incpth is just usrinc
4932 '') incpth="$usrinc";;
4935 : Set private lib path
4938 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4943 '') dlist="$loclibpth $plibpth $glibpth";;
4944 *) dlist="$libpth";;
4947 : Now check and see which directories actually exist, avoiding duplicates
4950 if $test -d $xxx; then
4953 *) libpth="$libpth $xxx";;
4959 Some systems have incompatible or broken versions of libraries. Among
4960 the directories listed in the question below, please remove any you
4961 know not to be holding relevant libraries, and add any that are needed.
4962 Say "none" for none.
4966 if test "X$sysroot" != X; then
4968 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4981 rp="Directories to use for library searches?"
4988 : compute shared library extension
4991 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5001 On some systems, shared libraries may be available. Answer 'none' if
5002 you want to suppress searching of shared libraries for the remainder
5003 of this configuration.
5006 rp='What is the file extension used for shared libraries?'
5010 : Does target system insist that shared library basenames are unique
5013 Some dynamic loaders assume that the *basename* of shared library filenames
5014 are globally unique. We'll default this to undef as we assume your system
5015 is not this weird. Set to defined if you're on one of them.
5020 rp='Make shared library basenames unique?'
5023 y|Y) val="$define" ;;
5026 set d_libname_unique
5029 : Define several unixisms.
5030 : Hints files or command line option can be used to override them.
5031 : The convoluted testing is in case hints files set either the old
5034 '') case "$exe_ext" in
5036 *) _exe="$exe_ext" ;;
5041 '') case "$lib_ext" in
5048 '') case "$obj_ext" in
5055 '') case "$path_sep" in
5066 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5068 : Which makefile gets called first. This is used by make depend.
5069 case "$firstmakefile" in
5070 '') firstmakefile='makefile';;
5073 : Check is we will use socks
5075 $define|true|[yY]*) dflt='y';;
5080 Perl can be built to use the SOCKS proxy protocol library. To do so,
5081 Configure must be run with -Dusesocks. If you use SOCKS you also need
5082 to use the PerlIO abstraction layer, this will be implicitly selected.
5084 If this doesn't make any sense to you, just accept the default '$dflt'.
5086 rp='Build Perl for SOCKS?'
5089 y|Y) val="$define" ;;
5095 : Check for uselongdouble support
5097 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5100 case "$uselongdouble" in
5101 $define|true|[yY]*) dflt='y';;
5106 Perl can be built to take advantage of long doubles which
5107 (if available) may give more accuracy and range for floating point numbers.
5109 If this doesn't make any sense to you, just accept the default '$dflt'.
5111 rp='Try to use long doubles if available?'
5114 y|Y) val="$define" ;;
5120 case "$uselongdouble" in
5121 true|[yY]*) uselongdouble="$define" ;;
5124 : Look for a hint-file generated 'call-back-unit'. If the
5125 : user has specified that long doubles should be used,
5126 : we may need to set or change some other defaults.
5127 if $test -f uselongdouble.cbu; then
5128 echo "Your platform has some specific hints regarding long doubles, using them..."
5129 . ./uselongdouble.cbu
5131 case "$uselongdouble" in
5134 (Your platform does not have any specific hints for long doubles.)
5140 : Looking for optional libraries
5142 echo "Checking for optional libraries..." >&4
5147 case "$libswanted" in
5148 '') libswanted='c_s';;
5151 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5153 case "$usecbacktrace" in
5154 "$define") libswanted="$libswanted bfd" ;;
5160 for thisdir in $libpth $xlibpth; do
5161 test -d $thisdir && libspath="$libspath $thisdir"
5163 for thislib in $libswanted; do
5164 for thisdir in $libspath; do
5166 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5167 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5168 $test -f "$xxx" && eval $libscheck
5169 $test -f "$xxx" && libstyle=shared
5171 if test ! -f "$xxx"; then
5172 xxx=$thisdir/lib$thislib.$so
5173 $test -f "$xxx" && eval $libscheck
5174 $test -f "$xxx" && libstyle=shared
5176 if test ! -f "$xxx"; then
5177 xxx=$thisdir/lib$thislib$_a
5178 $test -f "$xxx" && eval $libscheck
5179 $test -f "$xxx" && libstyle=static
5181 if test ! -f "$xxx"; then
5182 xxx=$thisdir/$thislib$_a
5183 $test -f "$xxx" && eval $libscheck
5184 $test -f "$xxx" && libstyle=static
5186 if test ! -f "$xxx"; then
5187 xxx=$thisdir/lib${thislib}_s$_a
5188 $test -f "$xxx" && eval $libscheck
5189 $test -f "$xxx" && libstyle=static
5190 $test -f "$xxx" && thislib=${thislib}_s
5192 if test ! -f "$xxx"; then
5193 xxx=$thisdir/Slib$thislib$_a
5194 $test -f "$xxx" && eval $libscheck
5195 $test -f "$xxx" && libstyle=static
5197 if $test -f "$xxx"; then
5199 shared) echo "Found -l$thislib (shared)." ;;
5200 static) echo "Found -l$thislib." ;;
5201 *) echo "Found -l$thislib ($libstyle)." ;;
5205 *) dflt="$dflt -l$thislib"
5206 libsfound="$libsfound $xxx"
5208 libsfiles="$libsfiles $yyy"
5209 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5210 case " $libsdirs " in
5212 *) libsdirs="$libsdirs $yyy" ;;
5219 if $test ! -f "$xxx"; then
5220 echo "No -l$thislib."
5231 ' '|'') dflt='none';;
5236 In order to compile $package on your machine, a number of libraries
5237 are usually needed. Include any other special libraries here as well.
5238 Say "none" for none. The default list is almost always right.
5242 rp="What libraries to use?"
5249 : determine optimization, if desired, or use for debug flag also
5251 ' '|$undef) dflt='none';;
5253 *) dflt="$optimize";;
5257 By default, $package compiles with the -O flag to use the optimizer.
5258 Alternately, you might want to use the symbolic debugger, which uses
5259 the -g flag (on traditional Unix systems). Either flag can be
5260 specified here. To use neither flag, specify the word "none".
5263 rp="What optimizer/debugger flag should be used?"
5267 'none') optimize=" ";;
5270 : Check what DEBUGGING is required from the command line
5271 : -DEBUGGING or -DDEBUGGING or
5272 : -DEBUGGING=both = -g + -DDEBUGGING
5273 : -DEBUGGING=-g or -Doptimize=-g = -g
5274 : -DEBUGGING=none or -UDEBUGGING =
5275 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5278 *) DEBUGGING=$EBUGGING ;;
5281 case "$DEBUGGING" in
5285 *) optimize="$optimize -g" ;;
5289 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5297 case "$DEBUGGING" in
5298 both|$define) dflt='-DDEBUGGING'
5301 : argument order is deliberate, as the flag will start with - which set could
5302 : think is an option
5303 checkccflag='check=$1; flag=$2; callback=$3;
5305 echo "Checking if your compiler accepts $flag" 2>&1;
5306 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5307 echo "int main(void) { return 0; }" > gcctest.c;
5308 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5309 echo "Yes, it does." 2>&1;
5310 if $test -s gcctest.out ; then
5311 echo "But your platform does not like it:";
5316 echo "Leaving current flags $ccflags alone." 2>&1
5318 *) dflt="$dflt $flag";
5324 echo "Nope, it does not, but that is ok." 2>&1;
5328 : We will not override a previous value, but we might want to
5329 : augment a hint file
5331 default|recommended)
5332 case "$gccversion" in
5333 1*) dflt="$dflt -fpcc-struct-return" ;;
5335 case "$optimize:$DEBUGGING" in
5336 *-g*:old) dflt="$dflt -DDEBUGGING";;
5338 case "$gccversion" in
5339 2*) if $test -d /etc/conf/kconfig.d &&
5340 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5342 # Interactive Systems (ISC) POSIX mode.
5347 case "$gccversion" in
5350 ?*) set strict-aliasing -fno-strict-aliasing
5354 # For gcc, adding -pipe speeds up compilations for some, but apparently
5355 # some assemblers can't read from stdin. (It also slows down compilations
5356 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5357 case "$gccversion" in
5363 # on x86_64 (at least) we require an extra library (libssp) in the
5364 # link command line. This library is not named, so I infer that it is
5365 # an implementation detail that may change. Hence the safest approach
5366 # is to add the flag to the flags passed to the compiler at link time,
5367 # as that way the compiler can do the right implementation dependant
5369 case "$gccversion" in
5370 ?*) set stack-protector -fstack-protector
5377 case "$mips_type" in
5378 *BSD*|'') inclwanted="$locincpth $usrinc";;
5379 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5381 for thisincl in $inclwanted; do
5382 if $test -d $thisincl; then
5383 if $test x$thisincl != x$usrinc; then
5385 *" -I$thisincl "*);;
5386 *) dflt="$dflt -I$thisincl ";;
5392 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5394 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5402 *) dflt="$dflt -D$2";;
5406 set signal.h LANGUAGE_C; eval $inctest
5410 ccflags="$ccflags -DSOCKS"
5415 default|recommended) dflt="$ccflags $dflt" ;;
5416 *) dflt="$ccflags";;
5425 Your C compiler may want other flags. For this question you should include
5426 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5427 but you should NOT include libraries or ld flags like -lwhatever. If you
5428 want $package to honor its debug switch, you should include -DDEBUGGING here.
5429 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5431 To use no flags, specify the word "none".
5437 rp="Any additional cc flags?"
5444 : the following weeds options from ccflags that are of no interest to cpp
5446 '') cppflags="$ccflags" ;;
5447 *) cppflags="$cppflags $ccflags" ;;
5449 case "$gccversion" in
5450 1*) cppflags="$cppflags -D__GNUC__"
5452 case "$mips_type" in
5454 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5460 echo "Let me guess what the preprocessor flags are..." >&4
5474 *) ftry="$previous $flag";;
5476 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5477 >cpp1.out 2>/dev/null && \
5478 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5479 >cpp2.out 2>/dev/null && \
5480 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5481 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5483 cppflags="$cppflags $ftry"
5493 *-*) echo "They appear to be: $cppflags";;
5495 $rm -f cpp.c cpp?.out
5499 : flags used in final linking phase
5501 '') if ./venix; then
5507 *-posix*) dflt="$dflt -posix" ;;
5510 *) dflt="$ldflags";;
5512 # See note above about -fstack-protector
5514 *-fstack-protector*)
5516 *-fstack-protector*) ;; # Don't add it again
5517 *) dflt="$dflt -fstack-protector" ;;
5522 : Try to guess additional flags to pick up local libraries.
5523 for thislibdir in $libpth; do
5524 case " $loclibpth " in
5527 *"-L$thislibdir "*) ;;
5528 *) dflt="$dflt -L$thislibdir" ;;
5540 Your C linker may need flags. For this question you should
5541 include -L/whatever and any other flags used by the C linker, but you
5542 should NOT include libraries like -lwhatever.
5544 Make sure you include the appropriate -L/path flags if your C linker
5545 does not normally search all of the directories you specified above,
5548 To use no flags, specify the word "none".
5552 rp="Any additional ld flags (NOT including libraries)?"
5558 rmlist="$rmlist pdp11"
5562 echo "Checking your choice of C compiler and flags for coherency..." >&4
5563 $cat > try.c <<'EOF'
5565 int main() { printf("Ok\n"); return(0); }
5567 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5569 $cat >try.msg <<'EOM'
5570 I've tried to compile and run the following simple program:
5573 $cat try.c >> try.msg
5575 $cat >> try.msg <<EOM
5582 and I got the following output:
5586 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5587 if $sh -c "$run ./try " >>try.msg 2>&1; then
5591 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5594 echo "The program compiled OK, but exited with status $?." >>try.msg
5595 rp="You have a problem. Shall I abort Configure"
5599 echo "I can't compile the test program." >>try.msg
5600 rp="You have a BIG problem. Shall I abort Configure"
5606 case "$knowitall" in
5608 echo "(The supplied flags or libraries might be incorrect.)"
5616 *) echo "Ok. Stopping Configure." >&4
5621 n) echo "OK, that should do.";;
5623 $rm_try gcctest gcctest.out
5625 : define a shorthand compile call
5629 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5630 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5634 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5635 : define a shorthand compile call for compilations that should be ok.
5639 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5641 : determine filename position in cpp output
5643 echo "Computing filename position in cpp output for #include directives..." >&4
5645 vos) testaccess=-e ;;
5648 echo '#include <stdio.h>' > foo.c
5651 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5652 $grep '^[ ]*#.*stdio\.h' | \
5653 while read cline; do
5656 while $test \$# -gt 0; do
5657 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5662 pos=\`expr \$pos + 1\`
5674 *) pos="${fieldn}th";;
5676 echo "Your cpp writes the filename in the $pos field of the line."
5678 : locate header file
5683 for usrincdir in $incpth
5685 if test -f \$usrincdir/\$wanted; then
5686 echo "\$usrincdir/\$wanted"
5690 awkprg='{ print \$$fieldn }'
5691 echo "#include <\$wanted>" > foo\$\$.c
5692 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5693 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5694 while read cline; do
5695 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5697 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5698 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5703 # status = 0: grep returned 0 lines, case statement not executed
5704 # status = 1: headerfile found
5705 # status = 2: while loop executed, no headerfile found
5709 if test \$status -eq 1; then
5716 : define an alternate in-header-list? function
5717 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5718 cont=true; xxf="echo \"<\$1> found.\" >&4";
5719 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5720 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5722 case $# in 4) instead=instead;; *) instead="at last";; esac;
5723 while $test "$cont"; do
5725 var=$2; eval "was=\$$2";
5726 if $test "$xxx" && $test -r "$xxx";
5728 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5731 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5732 set $yyy; shift; shift; yyy=$@;
5733 case $# in 0) cont="";;
5734 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5735 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5736 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5737 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5741 do set $yyy; var=$2; eval "was=\$$2";
5742 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5743 set $yyy; shift; shift; yyy=$@;
5746 : see if stdlib is available
5747 set stdlib.h i_stdlib
5750 : check for lengths of integral types
5754 echo "Checking to see how big your integers are..." >&4
5763 printf("intsize=%d;\n", (int)sizeof(int));
5764 printf("longsize=%d;\n", (int)sizeof(long));
5765 printf("shortsize=%d;\n", (int)sizeof(short));
5770 if eval $compile_ok && $run ./try > /dev/null; then
5772 echo "Your integers are $intsize bytes long."
5773 echo "Your long integers are $longsize bytes long."
5774 echo "Your short integers are $shortsize bytes long."
5778 Help! I can't compile and run the intsize test program: please enlighten me!
5779 (This is probably a misconfiguration in your system or libraries, and
5780 you really ought to fix it. Still, I'll try anyway.)
5784 rp="What is the size of an integer (in bytes)?"
5788 rp="What is the size of a long integer (in bytes)?"
5792 rp="What is the size of a short integer (in bytes)?"
5800 : check for long long
5802 echo "Checking to see if you have long long..." >&4
5803 echo 'int main() { long long x = 7; return 0; }' > try.c
5805 if eval $compile; then
5807 echo "You have long long."
5810 echo "You do not have long long."
5816 : check for length of long long
5817 case "${d_longlong}${longlongsize}" in
5820 echo "Checking to see how big your long longs are..." >&4
5821 $cat >try.c <<'EOCP'
5825 printf("%d\n", (int)sizeof(long long));
5830 if eval $compile_ok; then
5831 longlongsize=`$run ./try`
5832 echo "Your long longs are $longlongsize bytes long."
5836 echo "(I can't seem to compile the test program. Guessing...)"
5837 rp="What is the size of a long long (in bytes)?"
5841 if $test "X$longsize" = "X$longlongsize"; then
5842 echo "(That isn't any different from an ordinary long.)"
5848 : see if inttypes.h is available
5849 : we want a real compile instead of Inhdr because some systems
5850 : have an inttypes.h which includes non-existent headers
5853 #include <inttypes.h>
5855 static int32_t foo32 = 0x12345678;
5859 if eval $compile; then
5860 echo "<inttypes.h> found." >&4
5863 echo "<inttypes.h> NOT found." >&4
5872 echo "Checking to see if you have int64_t..." >&4
5874 #include <sys/types.h>
5875 #$i_inttypes I_INTTYPES
5877 #include <inttypes.h>
5879 int main() { int64_t x = 7; }
5882 if eval $compile; then
5884 echo "You have int64_t."
5887 echo "You do not have int64_t."
5893 : Check if 64bit ints have a quad type
5895 echo "Checking which 64-bit integer type we could use..." >&4
5901 val='"unsigned int"'
5906 *) case "$longsize" in
5910 val='"unsigned long"'
5915 *) case "$d_longlong:$longlongsize" in
5920 val='"unsigned long long"'
5925 *) case "$d_int64_t" in
5944 '') echo "Alas, no 64-bit integer types in sight." >&4
5947 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5952 : Do we want 64bit support
5953 case "$uselonglong" in
5954 "$define"|true|[yY]*)
5957 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5959 use64bitint="$define"
5962 case "$use64bits" in
5963 "$define"|true|[yY]*)
5966 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5968 use64bitint="$define"
5971 case "$use64bitints" in
5972 "$define"|true|[yY]*)
5975 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5977 use64bitint="$define"
5980 case "$use64bitsint" in
5981 "$define"|true|[yY]*)
5984 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5986 use64bitint="$define"
5989 case "$uselonglongs" in
5990 "$define"|true|[yY]*)
5993 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5995 use64bitint="$define"
5998 case "$use64bitsall" in
5999 "$define"|true|[yY]*)
6002 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6004 use64bitall="$define"
6009 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6011 case "$use64bitall" in
6012 "$define"|true|[yY]*) use64bitint="$define" ;;
6018 You have natively 64-bit long integers.
6022 *) case "$use64bitint" in
6023 "$define"|true|[yY]*) dflt='y';;
6032 Perl can be built to take advantage of 64-bit integer types
6033 on some systems. To do so, Configure can be run with -Duse64bitint.
6034 Choosing this option will most probably introduce binary incompatibilities.
6036 If this doesn't make any sense to you, just accept the default '$dflt'.
6037 (The default has been chosen based on your configuration.)
6039 rp='Try to use 64-bit integers, if available?'
6042 [yY]*) val="$define" ;;
6050 case "$use64bitall" in
6051 "$define"|true|[yY]*) dflt='y' ;;
6052 *) case "$longsize" in
6060 You may also choose to try maximal 64-bitness. It means using as much
6061 64-bitness as possible on the platform. This in turn means even more
6062 binary incompatibilities. On the other hand, your platform may not
6063 have any more 64-bitness available than what you already have chosen.
6065 If this doesn't make any sense to you, just accept the default '$dflt'.
6066 (The default has been chosen based on your configuration.)
6068 rp='Try to use maximal 64-bit support, if available?'
6071 [yY]*) val="$define" ;;
6076 case "$use64bitall" in
6078 case "$use64bitint" in
6082 Since you have chosen a maximally 64-bit build, I'm also turning on
6083 the use of 64-bit integers.
6085 use64bitint="$define" ;;
6090 : Look for a hint-file generated 'call-back-unit'. If the
6091 : user has specified that a 64-bit perl is to be built,
6092 : we may need to set or change some other defaults.
6093 if $test -f use64bitint.cbu; then
6094 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6097 case "$use64bitint" in
6098 "$define"|true|[yY]*)
6099 : This test was common to all the OpenBSD forks, and seems harmless for
6102 echo "Checking if your C library has broken 64-bit functions..." >&4
6105 typedef $uquadtype myULL;
6112 {4294967303.15, 4294967303ULL},
6113 {4294967294.2, 4294967294ULL},
6114 {4294967295.7, 4294967295ULL},
6117 for (p = test; p->u; p++) {
6118 myULL x = (myULL)p->d;
6129 if eval $compile_ok; then
6130 libcquad=`$run ./try`
6131 echo "Your C library's 64-bit functions are $libcquad."
6133 echo "(I can't seem to compile the test program.)"
6134 echo "Assuming that your C library's 64-bit functions are ok."
6143 *** You have a C library with broken 64-bit functions.
6144 *** 64-bit support does not work reliably in this configuration.
6145 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6146 *** Cannot continue, aborting.
6153 4) case "$archname64" in
6154 '') archname64=64int ;;
6161 : Look for a hint-file generated 'call-back-unit'. If the
6162 : user has specified that a maximally 64-bit perl is to be built,
6163 : we may need to set or change some other defaults.
6164 if $test -f use64bitall.cbu; then
6165 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6168 case "$use64bitall" in
6169 "$define"|true|[yY]*)
6171 4) case "$archname64" in
6172 ''|64int) archname64=64all ;;
6179 case "$d_quad:$use64bitint" in
6183 *** You have chosen to use 64-bit integers,
6184 *** but none can be found.
6185 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6186 *** Cannot continue, aborting.
6193 : check for length of double
6195 case "$doublesize" in
6197 echo "Checking to see how big your double precision numbers are..." >&4
6206 printf("%d\n", (int)sizeof(double));
6211 if eval $compile_ok; then
6212 doublesize=`$run ./try`
6213 echo "Your double is $doublesize bytes long."
6216 echo "(I can't seem to compile the test program. Guessing...)"
6217 rp="What is the size of a double precision number (in bytes)?"
6225 : check for long doubles
6227 echo "Checking to see if you have long double..." >&4
6228 echo 'int main() { long double x = 7.0; }' > try.c
6230 if eval $compile; then
6232 echo "You have long double."
6235 echo "You do not have long double."
6241 : check for length of long double
6242 case "${d_longdbl}${longdblsize}" in
6245 echo "Checking to see how big your long doubles are..." >&4
6246 $cat >try.c <<'EOCP'
6250 printf("%d\n", sizeof(long double));
6255 if eval $compile; then
6256 longdblsize=`$run ./try`
6257 echo "Your long doubles are $longdblsize bytes long."
6261 echo "(I can't seem to compile the test program. Guessing...)" >&4
6262 rp="What is the size of a long double (in bytes)?"
6266 if $test "X$doublesize" = "X$longdblsize"; then
6267 echo "That isn't any different from an ordinary double."
6268 echo "I'll keep your setting anyway, but you may see some"
6269 echo "harmless compilation warnings."
6275 : determine the architecture name
6277 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6278 tarch=`arch`"-$osname"
6279 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6280 if uname -m > tmparch 2>&1 ; then
6281 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6282 -e 's/$/'"-$osname/" tmparch`
6290 case "$myarchname" in
6293 echo "(Your architecture name used to be $myarchname.)"
6297 case "$targetarch" in
6299 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6304 *) dflt="$archname";;
6306 rp='What is your architecture name'
6310 : optionally add API version to the architecture for versioned archlibs
6311 case "$useversionedarchname" in
6312 $define|true|[yY]*) dflt='y';;
6315 rp='Add the Perl API version to your archname?'
6318 y|Y) useversionedarchname="$define" ;;
6319 *) useversionedarchname="$undef" ;;
6321 case "$useversionedarchname" in
6324 *-$api_versionstring)
6325 echo "...and architecture name already has -$api_versionstring" >&4
6328 archname="$archname-$api_versionstring"
6329 echo "...setting architecture name to $archname." >&4
6335 case "$usethreads" in
6337 echo "Threads selected." >&4
6339 *-thread*) echo "...and architecture name already has -thread." >&4
6341 *) archname="$archname-thread"
6342 echo "...setting architecture name to $archname." >&4
6347 case "$usemultiplicity" in
6349 echo "Multiplicity selected." >&4
6351 *-multi*) echo "...and architecture name already has -multi." >&4
6353 *) archname="$archname-multi"
6354 echo "...setting architecture name to $archname." >&4
6359 case "$use64bitint$use64bitall" in
6361 case "$archname64" in
6363 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6366 case "$use64bitint" in
6367 "$define") echo "64 bit integers selected." >&4 ;;
6369 case "$use64bitall" in
6370 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6373 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6375 *) archname="$archname-$archname64"
6376 echo "...setting architecture name to $archname." >&4
6382 case "$uselongdouble" in
6384 echo "Long doubles selected." >&4
6385 case "$longdblsize" in
6387 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6391 *-ld*) echo "...and architecture name already has -ld." >&4
6393 *) archname="$archname-ld"
6394 echo "...setting architecture name to $archname." >&4
6401 if $test -f archname.cbu; then
6402 echo "Your platform has some specific hints for architecture name, using them..."
6406 : set the prefixit variable, to compute a suitable default value
6407 prefixit='case "$3" in
6409 case "$oldprefix" in
6410 "") eval "$1=\"\$$2\"";;
6417 ""|" ") eval "$1=\"\$$2\"";;
6423 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6425 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6426 /*-$oldprefix/*|\~*-$oldprefix/*)
6427 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6428 *) eval "$1=\"\$$2\"";;
6432 : determine installation style
6433 : For now, try to deduce it from prefix unless it is already set.
6434 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6435 case "$installstyle" in
6436 '') case "$prefix" in
6437 *perl*) dflt='lib';;
6438 *) dflt='lib/perl5' ;;
6441 *) dflt="$installstyle" ;;
6443 : Probably not worth prompting for this since we prompt for all
6444 : the directories individually, and the prompt would be too long and
6448 : determine where public executables go
6453 rp='Pathname where the public executables will reside?'
6455 if $test "X$ansexp" != "X$binexp"; then
6459 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6460 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6461 : this via initialinstalllocation
6464 case "$userelocatableinc" in
6465 $define|true|[yY]*) dflt='y' ;;
6470 Would you like to build Perl so that the installation is relocatable, so that
6471 library paths in @INC are determined relative to the path of the perl binary?
6472 This is not advised for system Perl installs, or if you need to run setid
6473 scripts or scripts under taint mode.
6475 If this doesn't make any sense to you, just accept the default '$dflt'.
6477 rp='Use relocatable @INC?'
6480 y|Y) val="$define" ;;
6483 set userelocatableinc
6486 initialinstalllocation="$binexp"
6487 : Default prefix is now "up one level from where the binaries are"
6488 case "$userelocatableinc" in
6494 installprefixexp=".../.."
6498 : determine where private library files go
6499 : Usual default is /usr/local/lib/perl5/$version.
6500 : Also allow things like /opt/perl/lib/$version, since
6501 : /opt/perl/lib/perl5... would be redundant.
6502 : The default "style" setting is made in installstyle.U
6503 case "$installstyle" in
6504 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6505 *) set dflt privlib lib/$version ;;
6510 There are some auxiliary files for $package that need to be put into a
6511 private library directory that is accessible by everyone.
6516 rp='Pathname where the private library files will reside?'
6521 : set the prefixup variable, to restore leading tilda escape
6522 prefixup='case "$prefixexp" in
6524 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6527 : determine where public architecture dependent libraries go
6530 : privlib default is /usr/local/lib/$package/$version
6531 : archlib default is /usr/local/lib/$package/$version/$archname
6532 : privlib may have an optional trailing /share.
6533 tdflt=`echo $privlib | $sed 's,/share$,,'`
6534 tdflt=$tdflt/$archname
6543 $spackage contains architecture-dependent library files. If you are
6544 sharing libraries in a heterogeneous environment, you might store
6545 these files in a separate location. Otherwise, you can just include
6546 them with the rest of the public library files.
6551 rp='Where do you want to put the public architecture-dependent libraries?'
6555 if $test X"$archlib" = X"$privlib"; then
6561 : see if setuid scripts can be secure
6564 Some kernels have a bug that prevents setuid #! scripts from being
6565 secure. Some sites have disabled setuid #! scripts because of this.
6567 First let's decide if your kernel supports secure setuid #! scripts.
6568 (If setuid #! scripts would be secure but have been disabled anyway,
6569 don't say that they are secure if asked.)
6574 if $test -d /dev/fd; then
6575 echo "#!$ls" >reflect
6576 chmod +x,u+s reflect
6577 ./reflect >flect 2>&1
6578 if $contains "/dev/fd" flect >/dev/null; then
6579 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6583 If you are not sure if they are secure, I can check but I'll need a
6584 username and password different from the one you are using right now.
6585 If you don't have such a username or don't want me to test, simply
6589 rp='Other username to test security of setuid scripts with?'
6594 case "$d_suidsafe" in
6595 '') echo "I'll assume setuid scripts are *not* secure." >&4
6598 echo "Well, the $hint value is *not* secure." >&4
6600 *) echo "Well, the $hint value *is* secure." >&4
6605 $rm -f reflect flect
6606 echo "#!$ls" >reflect
6607 chmod +x,u+s reflect
6610 echo '"su" will (probably) prompt you for '"$ans's password."
6611 su $ans -c './reflect >flect'
6612 if $contains "/dev/fd" flect >/dev/null; then
6613 echo "Okay, it looks like setuid scripts are secure." >&4
6616 echo "I don't think setuid scripts are secure." >&4
6621 rp='Does your kernel have *secure* setuid scripts?'
6624 [yY]*) val="$define";;
6629 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6630 echo "(That's for file descriptors, not floppy disks.)"
6636 $rm -f reflect flect
6638 : now see if they want to do setuid emulation
6639 if $test $patchlevel -lt 11; then
6642 case "$d_suidsafe" in
6645 echo "No need to emulate SUID scripts since they are secure here." >&4
6649 Some systems have disabled setuid scripts, especially systems where
6650 setuid scripts cannot be secure. On systems where setuid scripts have
6651 been disabled, the setuid/setgid bits on scripts are currently
6652 useless. It is possible for $package to detect those bits and emulate
6653 setuid/setgid in a secure fashion. This emulation will only work if
6654 setuid scripts have been disabled in your kernel.
6658 "$define") dflt=y ;;
6661 rp="Do you want to do setuid/setgid emulation?"
6664 [yY]*) val="$define";;
6676 SUID emulation has been removed for 5.12
6677 Please re-run Configure without -Dd_dosuid
6686 : Find perl5.005 or later.
6687 echo "Looking for a previously installed perl5.005 or later... "
6689 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6690 : Check if this perl is recent and can load a simple module
6691 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6694 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6704 '') echo "None found. That's ok.";;
6705 *) echo "Using $perl5." ;;
6708 : Set the siteprefix variables
6711 After $package is installed, you may wish to install various
6712 add-on modules and utilities. Typically, these add-ons will
6713 be installed under $prefix with the rest
6714 of this package. However, you may wish to install such add-ons
6715 elsewhere under a different prefix.
6717 If you do not wish to put everything under a single prefix, that's
6718 ok. You will be prompted for the individual locations; this siteprefix
6719 is only used to suggest the defaults.
6721 The default should be fine for most people.
6725 rp='Installation prefix to use for add-on modules and utilities?'
6726 : XXX Here might be another good place for an installstyle setting.
6727 case "$siteprefix" in
6729 *) dflt=$siteprefix ;;
6732 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6734 case "$siteprefix" in
6738 *) oldsiteprefix="$prefix";;
6743 siteprefixexp="$ansexp"
6745 : determine where site specific libraries go.
6746 : Usual default is /usr/local/lib/perl5/site_perl/$version
6747 : The default "style" setting is made in installstyle.U
6748 : XXX No longer works with Prefixit stuff.
6749 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6751 '') case "$installstyle" in
6752 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6753 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6761 The installation process will create a directory for
6762 site-specific extensions and modules. Most users find it convenient
6763 to place all site-specific files in this directory rather than in the
6764 main distribution directory.
6768 rp='Pathname for the site-specific library files?'
6772 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6774 : Determine list of previous versions to include in @INC
6775 $cat > getverlist <<EOPL
6778 \$api_versionstring = "$api_versionstring";
6779 \$version = "$version";
6780 \$stem = "$sitelib_stem";
6781 \$archname = "$archname";
6783 $cat >> getverlist <<'EOPL'
6784 # The list found is store twice for each entry: the original name, and
6785 # the binary broken down version as pack "sss", so sorting is easy and
6786 # unambiguous. This will work for all versions that have a maximum of
6787 # three digit groups, separate by '.'s or '_'s. Names are extended with
6788 # ".0.0" to ensure at least three elements for the pack.
6789 # -- H.Merijn Brand (m)'06 23-10-2006
6791 # Can't have leading @ because metaconfig interprets it as a command!
6792 ;@inc_version_list=();
6793 # XXX Redo to do opendir/readdir?
6796 ;@candidates = map {
6797 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6798 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6804 ($pversion, $aversion, $vsn5005) = map {
6805 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6806 foreach $d (@candidates) {
6807 if ($d->[1] lt $pversion) {
6808 if ($d->[1] ge $aversion) {
6809 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6811 elsif ($d->[1] ge $vsn5005) {
6812 unshift(@inc_version_list, grep { -d } $d->[0]);
6816 # Skip newer version. I.e. don't look in
6817 # 5.7.0 if we're installing 5.6.1.
6821 if (@inc_version_list) {
6822 print join(' ', @inc_version_list);
6825 # Blank space to preserve value for next Configure run.
6830 case "$inc_version_list" in
6831 '') if test -x "$perl5$exe_ext"; then
6832 dflt=`$perl5 getverlist`
6837 $undef) dflt='none' ;;
6838 *) eval dflt=\"$inc_version_list\" ;;
6841 ''|' ') dflt=none ;;
6848 In order to ease the process of upgrading, this version of perl
6849 can be configured to use modules built and installed with earlier
6850 versions of perl that were installed under $prefix. Specify here
6851 the list of earlier versions that this version of perl should check.
6852 If Configure detected no earlier versions of perl installed under
6853 $prefix, then the list will be empty. Answer 'none' to tell perl
6854 to not search earlier versions.
6856 The default should almost always be sensible, so if you're not sure,
6857 just accept the default.
6860 rp='List of earlier versions to include in @INC?'
6863 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6864 *) inc_version_list="$ans" ;;
6866 case "$inc_version_list" in
6868 inc_version_list_init='0'
6869 d_inc_version_list="$undef"
6871 *) inc_version_list_init=`echo $inc_version_list |
6872 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6873 d_inc_version_list="$define"
6878 : see if malloc/malloc.h has to be included
6879 set malloc/malloc.h i_mallocmalloc
6882 : see if this is a malloc.h system
6883 : we want a real compile instead of Inhdr because some systems have a
6884 : malloc.h that just gives a compile error saying to use stdlib.h instead
6889 #$i_mallocmalloc I_MALLOCMALLOC
6890 #ifdef I_MALLOCMALLOC
6891 # include <malloc/malloc.h>
6894 int main () { return 0; }
6897 if eval $compile; then
6898 echo "<malloc.h> found." >&4
6901 echo "<malloc.h> NOT found." >&4
6908 : check for length of pointer
6912 echo "Checking to see how big your pointers are..." >&4
6921 printf("%d\n", (int)sizeof(void *));
6926 if eval $compile_ok; then
6927 ptrsize=`$run ./try`
6928 echo "Your pointers are $ptrsize bytes long."
6931 echo "(I can't seem to compile the test program. Guessing...)" >&4
6932 rp="What is the size of a pointer (in bytes)?"
6939 case "$use64bitall" in
6940 "$define"|true|[yY]*)
6944 *** You have chosen a maximally 64-bit build,
6945 *** but your pointers are only 4 bytes wide.
6946 *** Please rerun Configure without -Duse64bitall.
6951 *** Since you have quads, you could possibly try with -Duse64bitint.
6956 *** Cannot continue, aborting.
6967 : determine whether to use malloc wrapping
6969 case "$usemallocwrap" in
6970 [yY]*|true|$define) dflt='y' ;;
6971 [nN]*|false|$undef) dflt='n' ;;
6972 *) case "$usedevel" in
6973 [yY]*|true|$define) dflt='y' ;;
6978 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6980 usemallocwrap="$ans"
6983 usemallocwrap="$define" ;;
6985 usemallocwrap="$undef" ;;
6988 : determine which malloc to compile in
6990 case "$usemymalloc" in
6991 [yY]*|true|$define) dflt='y' ;;
6992 [nN]*|false|$undef) dflt='n' ;;
6993 *) case "$ptrsize" in
6997 if test "$useithreads" = "$define"; then dflt='n'; fi
7000 rp="Do you wish to attempt to use the malloc that comes with $package?"
7006 mallocsrc='malloc.c'
7007 mallocobj="malloc$_o"
7008 d_mymalloc="$define"
7011 : Remove malloc from list of libraries to use
7012 echo "Removing unneeded -lmalloc from library list" >&4
7013 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7016 echo "libs = $libs" >&4
7028 : compute the return types of malloc and free
7030 $cat >malloc.c <<END
7034 #include <sys/types.h>
7048 case "$malloctype" in
7050 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7057 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7061 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7068 echo "Your system uses $freetype free(), it would seem." >&4
7070 : determine where site specific architecture-dependent libraries go.
7071 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7072 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7073 : sitelib may have an optional trailing /share.
7075 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7076 dflt="$dflt/$archname"
7081 set sitearch sitearch none
7085 The installation process will also create a directory for
7086 architecture-dependent site-specific extensions and modules.
7090 rp='Pathname for the site-specific architecture-dependent library files?'
7094 if $test X"$sitearch" = X"$sitelib"; then
7097 d_sitearch="$define"
7100 : Set the vendorprefix variables
7103 The installation process will also create a directory for
7104 vendor-supplied add-ons. Vendors who supply perl with their system
7105 may find it convenient to place all vendor-supplied files in this
7106 directory rather than in the main distribution directory. This will
7107 ease upgrades between binary-compatible maintenance versions of perl.
7109 Of course you may also use these directories in whatever way you see
7110 fit. For example, you might use them to access modules shared over a
7111 company-wide network.
7113 The default answer should be fine for most people.
7114 This causes further questions about vendor add-ons to be skipped
7115 and no vendor-specific directories will be configured for perl.
7118 rp='Do you want to configure vendor-specific add-on directories?'
7119 case "$usevendorprefix" in
7120 define|true|[yY]*) dflt=y ;;
7121 *) : User may have set vendorprefix directly on Configure command line.
7122 case "$vendorprefix" in
7131 rp='Installation prefix to use for vendor-supplied add-ons?'
7132 case "$vendorprefix" in
7133 '') dflt="$prefix" ;;
7134 *) dflt=$vendorprefix ;;
7137 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7139 case "$vendorprefix" in
7143 *) oldvendorprefix="$prefix";;
7147 usevendorprefix="$define"
7149 vendorprefixexp="$ansexp"
7151 *) usevendorprefix="$undef"
7157 : Set the vendorlib variables
7158 case "$vendorprefix" in
7159 '') d_vendorlib="$undef"
7163 *) d_vendorlib="$define"
7164 : determine where vendor-supplied modules go.
7165 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7166 case "$vendorlib" in
7168 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7169 case "$installstyle" in
7170 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7171 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7174 *) dflt="$vendorlib"
7178 rp='Pathname for the vendor-supplied library files?'
7181 vendorlibexp="$ansexp"
7184 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7188 : Set the vendorarch variables
7189 case "$vendorprefix" in
7190 '') d_vendorarch="$undef"
7194 *) d_vendorarch="$define"
7195 : determine where vendor-supplied architecture-dependent libraries go.
7196 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7197 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7198 : vendorlib may have an optional trailing /share.
7199 case "$vendorarch" in
7200 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7201 dflt="$dflt/$archname"
7203 *) dflt="$vendorarch" ;;
7206 rp='Pathname for vendor-supplied architecture-dependent files?'
7209 vendorarchexp="$ansexp"
7212 prefixvar=vendorarch
7214 if $test X"$vendorarch" = X"$vendorlib"; then
7215 d_vendorarch="$undef"
7217 d_vendorarch="$define"
7220 : Final catch-all directories to search
7223 Lastly, you can have perl look in other directories for extensions and
7224 modules in addition to those already specified.
7225 These directories will be searched after
7229 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7230 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7232 case "$otherlibdirs" in
7233 ''|' ') dflt='none' ;;
7234 *) dflt="$otherlibdirs" ;;
7237 Enter a colon-separated set of extra paths to include in perl's @INC
7238 search path, or enter 'none' for no extra paths.
7242 rp='Colon-separated list of additional directories for perl to search?'
7245 ' '|''|none) otherlibdirs=' ' ;;
7246 *) otherlibdirs="$ans" ;;
7248 case "$otherlibdirs" in
7252 set d_perl_otherlibdirs
7255 : Cruising for prototypes
7257 echo "Checking out function prototypes..." >&4
7258 $cat >prototype.c <<EOCP
7263 int main(int argc, char *argv[]) {
7266 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7267 echo "Your C compiler appears to support function prototypes."
7270 echo "Your C compiler doesn't seem to understand function prototypes."
7277 : Check if ansi2knr is required
7278 case "$prototype" in
7280 *) ansi2knr='ansi2knr'
7285 This version of $package can only be compiled by a compiler that
7286 understands function prototypes. Unfortunately, your C compiler
7288 doesn't seem to understand them. Sorry about that.
7290 If GNU cc is available for your system, perhaps you could try that instead.
7292 Eventually, we hope to support building Perl with pre-ANSI compilers.
7293 If you would like to help in that effort, please contact <perlbug@perl.org>.
7295 Aborting Configure now.
7302 dflt_dtrace='/usr/sbin/dtrace'
7303 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7307 Perl can be built to support DTrace on platforms that support it.
7308 DTrace is a diagnosis and performance analysis tool from Sun.
7310 If this doesn't make any sense to you, just accept the default '$dflt'.
7314 case "$usedtrace" in
7320 dflt_dtrace=$usedtrace
7327 rp='Support DTrace if available?'
7330 y|Y) val="$define" ;;
7336 test "X$usedtrace" != "X$define" && break
7339 rp='Where is the dtrace executable?'
7348 if $dtrace -h -s ../perldtrace.d \
7349 -o perldtrace.tmp >/dev/null 2>&1 \
7350 && rm -f perldtrace.tmp
7353 echo "Good: your $dtrace knows about the -h flag."
7357 *** $me: Fatal Error: $dtrace doesn't support -h flag
7359 *** Your installed dtrace doesn't support the -h switch to compile a D
7360 *** program into a C header. Can't continue.
7372 *** $me: Fatal Error: $dtrace not found.
7379 echo "*** $dtrace was not found."
7385 : See if we want extra modules installed
7392 Perl can be built with extra modules or bundles of modules which
7393 will be fetched from the CPAN and installed alongside Perl.
7395 Notice that you will need access to the CPAN; either via the Internet,
7396 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7397 be asked later to configure the CPAN.pm module which will in turn do
7398 the installation of the rest of the extra modules or bundles.)
7400 Notice also that if the modules require any external software such as
7401 libraries and headers (the libz library and the zlib.h header for the
7402 Compress::Zlib module, for example) you MUST have any such software
7403 already installed, this configuration process will NOT install such
7406 If this doesn't make any sense to you, just accept the default '$dflt'.
7408 rp='Install any extra modules (y or n)?'
7414 Please list any extra modules or bundles to be installed from CPAN,
7415 with spaces between the names. The names can be in any format the
7416 'install' command of CPAN.pm will understand. (Answer 'none',
7417 without the quotes, to install no extra modules or bundles.)
7427 $rm -f ../extras.lst
7429 *) echo "(Saving the list of extras for later...)"
7430 echo "$extras" > ../extras.lst
7438 : determine where html pages for programs go
7439 set html1dir html1dir none
7443 If you wish to install html files for programs in $spackage, indicate
7444 the appropriate directory here. To skip installing html files,
7448 ''|none|$undef|' ') dflt=none ;;
7449 *) dflt=$html1dir ;;
7452 rp="Directory for the main $spackage html pages?"
7456 : Use ' ' for none so value is preserved next time through Configure
7457 $test X"$html1dir" = "X" && html1dir=' '
7459 : determine where html pages for libraries and modules go
7460 set html3dir html3dir none
7464 If you wish to install html files for modules associated with $spackage,
7465 indicate the appropriate directory here. To skip installing html files,
7468 : There is no obvious default. If they have specified html1dir, then
7469 : try to key off that, possibly changing .../html1 into .../html3.
7471 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7472 *) dflt=$html3dir ;;
7475 rp="Directory for the $spackage module html pages?"
7479 : Use ' ' for none so value is preserved next time through Configure
7480 $test X"$html3dir" = "X" && html3dir=' '
7482 : determine whether to install perl also as /usr/bin/perl
7485 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7487 Many scripts expect perl to be installed as /usr/bin/perl.
7489 If you want to, I can install the perl you are about to compile
7490 as /usr/bin/perl (in addition to $bin/perl).
7492 if test -f /usr/bin/perl; then
7495 However, please note that because you already have a /usr/bin/perl,
7496 overwriting that with a new Perl would very probably cause problems.
7497 Therefore I'm assuming you don't want to do that (unless you insist).
7500 case "$installusrbinperl" in
7501 "$define"|[yY]*) dflt='y';;
7507 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7510 case "$installusrbinperl" in
7511 "$undef"|[nN]*) dflt='n';;
7515 rp="Do you want to install perl as /usr/bin/perl?"
7518 [yY]*) val="$define";;
7524 set installusrbinperl
7527 : Check if we are using the GNU C library
7529 echo "Checking for GNU C Library..." >&4
7531 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7532 alone are insufficient to distinguish different versions, such as
7533 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7534 libc version 2.1.0. A. Dougherty, June 3, 2002.
7540 # ifdef __GLIBC_MINOR__
7541 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7542 # include <gnu/libc-version.h>
7543 printf("%s\n", gnu_get_libc_version());
7545 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7548 printf("%d\n", __GLIBC__);
7557 if eval $compile_ok && $run ./try > glibc.ver; then
7559 gnulibc_version=`$cat glibc.ver`
7560 echo "You are using the GNU C Library version $gnulibc_version"
7564 echo "You are not using the GNU C Library"
7570 : see if nm is to be used to determine whether a symbol is defined or not
7574 case "$d_gnulibc" in
7577 echo "nm probably won't work on the GNU C Library." >&4
7583 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7585 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7586 echo "'nm' won't be sufficient on this system." >&4
7592 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7593 if $test $dflt -gt 20; then
7603 true|$define) dflt=y;;
7610 I can use $nm to extract the symbols from your C libraries. This
7611 is a time consuming task which may generate huge output on the disk (up
7612 to 3 megabytes) but that should make the symbols extraction faster. The
7613 alternative is to skip the 'nm' extraction part and to compile a small
7614 test program instead to determine whether each symbol is present. If
7615 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7616 this may be the best solution.
7618 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7621 rp="Shall I use $nm to extract C symbols from the libraries?"
7624 [Nn]*) usenm=false;;
7633 : nm options which may be necessary
7635 '') if $test -f /mach_boot; then
7637 elif $test -d /usr/ccs/lib; then
7638 nm_opt='-p' # Solaris (and SunOS?)
7639 elif $test -f /dgux; then
7641 elif $test -f /lib64/rld; then
7642 nm_opt='-p' # 64-bit Irix
7648 : nm options which may be necessary for shared libraries but illegal
7649 : for archive libraries. Thank you, Linux.
7650 case "$nm_so_opt" in
7651 '') case "$myuname" in
7653 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7654 nm_so_opt='--dynamic'
7661 : Figure out where the libc is located
7664 : get list of predefined functions in a handy place
7669 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7675 *) for thislib in $libs; do
7678 : Handle C library specially below.
7681 thislib=`echo $thislib | $sed -e 's/^-l//'`
7682 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7684 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7686 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7688 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7690 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7692 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7694 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7699 libnames="$libnames $try"
7701 *) libnames="$libnames $thislib" ;;
7710 for xxx in $libpth; do
7711 $test -r $1 || set $xxx/libc.$so
7712 : The messy sed command sorts on library version numbers.
7714 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7715 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7717 s/[0-9][0-9]*/0000&/g
7718 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7721 $sort | $sed -e 's/^.* //'`
7724 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7725 $test -r $1 || set $sysroot/lib/libsys_s$_a
7731 if $test -r "$1"; then
7732 echo "Your (shared) C library seems to be in $1."
7734 elif $test -r /lib/libc && $test -r /lib/clib; then
7735 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7737 libc='/lib/clib /lib/libc'
7738 if $test -r /lib/syslib; then
7739 echo "(Your math library is in /lib/syslib.)"
7740 libc="$libc /lib/syslib"
7742 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7743 echo "Your C library seems to be in $libc, as you said before."
7744 elif $test -r $incpath/usr/lib/libc$_a; then
7745 libc=$incpath/usr/lib/libc$_a;
7746 echo "Your C library seems to be in $libc. That's fine."
7747 elif $test -r /lib/libc$_a; then
7749 echo "Your C library seems to be in $libc. You're normal."
7751 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7753 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7754 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7755 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7757 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7759 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7762 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7764 if $test -r "$tans"; then
7765 echo "Your C library seems to be in $tans, of all places."
7771 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7775 If the guess above is wrong (which it might be if you're using a strange
7776 compiler, or your machine supports multiple models), you can override it here.
7781 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7783 I can't seem to find your C library. I've looked in the following places:
7786 $sed 's/^/ /' libpath
7789 None of these seems to contain your C library. I need to get its name...
7794 rp='Where is your C library?'
7799 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7800 set X `cat libnames`
7803 case $# in 1) xxx=file; esac
7804 echo "Extracting names from the following $xxx for later perusal:" >&4
7806 $sed 's/^/ /' libnames >&4
7808 $echo $n "This may take a while...$c" >&4
7812 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7813 *) $nm $nm_opt $file 2>/dev/null;;
7818 $grep fprintf libc.tmp > libc.ptf
7819 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7820 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7822 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7824 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7826 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7828 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7830 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7832 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7834 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7836 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7838 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7840 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7842 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7844 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7846 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7847 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7849 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7851 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7853 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7855 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7857 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7859 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7861 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7863 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7865 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7867 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7869 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7871 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7873 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7875 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7877 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7880 $nm -p $* 2>/dev/null >libc.tmp
7881 $grep fprintf libc.tmp > libc.ptf
7882 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7883 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7889 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7891 if $ar t $libc > libc.tmp && \
7892 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7894 for thisname in $libnames $libc; do
7895 $ar t $thisname >>libc.tmp
7897 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7899 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7900 for thisname in $libnames $libc; do
7901 $ar tv $thisname >>libc.tmp
7902 emximp -o tmp.imp $thisname \
7904 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7905 < tmp.imp >>libc.tmp
7908 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7911 echo "$ar didn't seem to work right." >&4
7912 echo "Maybe this is a Cray...trying bld instead..." >&4
7914 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7917 for thisname in $libnames; do
7919 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7920 $ar t $thisname >>libc.tmp
7924 echo "That didn't work either. Giving up." >&4
7934 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7935 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7937 *) if $test -f /lib/syscalls.exp; then
7939 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7940 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7941 /lib/syscalls.exp >>libc.list
7947 $rm -f libnames libpath
7949 : Check if we are using C++
7951 echo "Checking for C++..." >&4
7952 $cat >try.c <<'EOCP'
7964 if eval $compile_ok && $run ./try; then
7966 echo "You are using a C++ compiler."
7969 echo "You are not using a C++ compiler."
7975 : is a C symbol defined?
7978 -v) tf=libc.tmp; tdc="";;
7979 -a) tf=libc.tmp; tdc="[]";;
7980 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7982 case "$d_cplusplus" in
7983 $define) extern_C="extern \"C\"" ;;
7984 *) extern_C="extern" ;;
7987 case "$reuseval-$4" in
7989 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7994 if $test "$runnm" = true; then
7995 if $contains $tlook $tf >/dev/null 2>&1; then
7997 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7998 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
7999 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
8000 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
8004 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
8005 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
8011 $define) tval=true;;
8018 : define an is-in-libc? function
8019 inlibc='echo " "; td=$define; tu=$undef;
8020 sym=$1; var=$2; eval "was=\$$2";
8022 case "$reuseval$was" in
8032 echo "$sym() found." >&4;
8033 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8035 echo "$sym() NOT found." >&4;
8036 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8040 $define) echo "$sym() found." >&4;;
8041 *) echo "$sym() NOT found." >&4;;
8045 : see if dlopen exists
8047 xxx_ccflags="$ccflags"
8049 : with g++ one needs -shared to get is-in-libc to work for dlopen
8050 case "$gccversion" in
8052 *) case "$d_cplusplus" in
8053 "$define") ccflags="$ccflags -shared" ;;
8060 ccflags="$xxx_ccflags"
8062 : see if this is a unistd.h system
8063 set unistd.h i_unistd
8066 : determine which dynamic loading, if any, to compile in
8068 dldir="ext/DynaLoader"
8081 $define) dflt='y' ;;
8083 : Does a dl_xxx.xs file exist for this operating system
8084 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8087 rp="Do you wish to use dynamic loading?"
8094 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8095 dflt="$dldir/dl_${osname}.xs"
8096 elif $test "$d_dlopen" = "$define" ; then
8097 dflt="$dldir/dl_dlopen.xs"
8102 *) dflt="$dldir/$dlsrc"
8105 echo "The following dynamic loading files are available:"
8106 : Can not go over to $dldir because getfile has path hard-coded in.
8107 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8108 rp="Source file to use for dynamic loading"
8114 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8118 Some systems may require passing special flags to $cc -c to
8119 compile modules that will be used to create a shared library.
8120 To use no flags, say "none".
8123 case "$cccdlflags" in
8124 '') case "$gccversion" in
8125 '') case "$osname" in
8127 irix*) dflt='-KPIC' ;;
8128 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8129 sunos) dflt='-pic' ;;
8133 *) case "$osname" in
8134 darwin) dflt='none' ;;
8135 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8140 *) dflt="$cccdlflags" ;;
8147 # If -Dsysroot was specified, now's the time to add it
8149 if test "X$sysroot" != X; then
8150 case "$gccversion" in
8155 dflt="$dflt --sysroot=$sysroot" ;;
8165 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8168 none) cccdlflags=' ' ;;
8169 *) cccdlflags="$ans" ;;
8174 Some systems use ld to create libraries that can be dynamically loaded,
8175 while other systems (such as those using ELF) use $cc.
8179 : Determine if this is ELF
8181 /* Test for whether ELF binaries are produced */
8193 int i = open("a.out",O_RDONLY);
8196 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8197 exit(0); /* succeed (yes, it is ELF) */
8201 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8207 '') if $test $bin_ELF = "$define"; then
8209 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8213 echo "I'll use ld to build dynamic libraries."
8221 rp="What command should be used to create dynamic libraries?"
8227 Some systems may require passing special flags to $ld to create a
8228 library that can be dynamically loaded. If your ld flags include
8229 -L/other/path options to locate libraries outside your loader's normal
8230 search path, you may need to specify those -L options here as well. To
8231 use no flags, say "none".
8234 case "$lddlflags" in
8235 '') case "$osname" in
8236 haiku) dflt='-shared' ;;
8238 case "$gccversion" in
8239 '') dflt="$dflt +vnocompatwarnings" ;;
8242 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8243 solaris) # See [perl #66604].
8244 # On Solaris 11, gcc -m64 on amd64
8245 # appears not to understand -G. gcc versions at
8246 # least as old as 3.4.3 support -shared, so just
8247 # use that with Solaris 11 and later, but keep
8248 # the old behavior for older Solaris versions.
8249 case "$gccversion" in
8251 *) case "$osvers" in
8252 2.?|2.10) dflt='-G' ;;
8253 *) dflt='-shared' ;;
8258 sunos) dflt='-assert nodefinitions' ;;
8259 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8263 *) dflt="$lddlflags" ;;
8266 : Only do this for gcc, since, for example, qcc has no concept
8268 if $test "X$sysroot" != X; then
8269 case "$gccversion" in
8271 *) dflt="$dflt --sysroot $sysroot" ;;
8275 : Try to guess additional flags to pick up local libraries.
8276 : Be careful not to append to a plain 'none'
8280 for thisflag in $ldflags; do
8285 *) dflt="$dflt $thisflag" ;;
8292 ''|' ') dflt='none' ;;
8296 *-fstack-protector*)
8298 *-fstack-protector*) ;; # Don't add it again
8299 *) dflt="$dflt -fstack-protector" ;;
8304 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8307 none) lddlflags=' ' ;;
8308 *) lddlflags="$ans" ;;
8313 Some systems may require passing special flags to $cc to indicate that
8314 the resulting executable will use dynamic linking. To use no flags,
8318 case "$ccdlflags" in
8319 '') case "$osname" in
8320 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8321 sunos) dflt='none' ;;
8325 *) dflt="$ccdlflags" ;;
8327 rp="Any special flags to pass to $cc to use dynamic linking?"
8330 none) ccdlflags=' ' ;;
8331 *) ccdlflags="$ans" ;;
8343 ld_can_script="$undef"
8344 case "$bin_ELF$usedl" in
8346 # Abuse try.h and a.out names for neat cleanup
8358 if $cc $cccdlflags $ccdlflags $ccflags \
8359 $ldflags $lddlflags -o a.out try.c \
8360 -Wl,--version-script=try.h >/dev/null 2>&1 \
8361 && $test -s a.out ; then
8362 echo "ld supports scripting" >&4
8363 ld_can_script="$define"
8365 echo "ld does not support scripting" >&4
8371 : Do we want a shared libperl?
8375 # No dynamic loading being used, so don't bother even to prompt.
8378 *) case "$useshrplib" in
8379 '') case "$osname" in
8380 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8382 also='Building a shared libperl is required for dynamic loading to work on your system.'
8396 The perl executable is normally obtained by linking perlmain.c with
8397 libperl${_a}, any static extensions (usually just DynaLoader), and
8398 any other libraries needed on this system (such as -lm, etc.). Since
8399 your system supports dynamic loading, it is probably possible to build
8400 a shared libperl.$so. If you will have more than one executable linked
8401 to libperl.$so, this will significantly reduce the size of each
8402 executable, but it may have a noticeable effect on performance. The
8403 default is probably sensible for your system.
8407 rp="Build a shared libperl.$so (y/n)"
8411 useshrplib='true' ;;
8412 *) useshrplib='false' ;;
8417 case "$useshrplib" in
8419 case "$userelocatableinc" in
8421 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8422 echo "See INSTALL for an explanation why that won't work." >&4
8428 # Figure out a good name for libperl.so. Since it gets stored in
8429 # a version-specific architecture-dependent library, the version
8430 # number isn't really that important, except for making cc/ld happy.
8432 # A name such as libperl.so.10.1
8433 majmin="libperl.$so.$patchlevel.$subversion"
8434 # A name such as libperl.so.100
8435 majonly=`echo $patchlevel $subversion |
8436 $awk '{printf "%d%02d", $1, $2}'`
8437 majonly=libperl.$so.$majonly
8438 # I'd prefer to keep the os-specific stuff here to a minimum, and
8439 # rely on figuring it out from the naming of libc.
8440 case "${osname}${osvers}" in
8441 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8444 cygwin*) # ld links now against the dll directly
8445 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8446 majonly=`echo $patchlevel $subversion |
8447 $awk '{printf "%03d%03d", $1, $2}'`
8448 majonly=cygperl5.$majonly.$so
8451 *) # Try to guess based on whether libc has major.minor.
8453 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8454 *libc.$so.[0-9]*) dflt=$majonly ;;
8455 *) dflt=libperl.$so ;;
8465 I need to select a good name for the shared libperl. If your system uses
8466 library names with major and minor numbers, then you might want something
8467 like $majmin. Alternatively, if your system uses a single version
8468 number for shared libraries, then you might want to use $majonly.
8469 Or, your system might be quite happy with a simple libperl.$so.
8471 Since the shared libperl will get installed into a version-specific
8472 architecture-dependent directory, the version number of the shared perl
8473 library probably isn't important, so the default should be o.k.
8476 rp='What name do you want to give to the shared libperl?'
8479 echo "Ok, I'll use $libperl"
8482 libperl="libperl${_a}"
8486 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8490 WARNING: Use of the shrpdir variable for the installation location of
8491 the shared $libperl is not supported. It was never documented and
8492 will not work in this version. Let me (perlbug@perl.org)
8493 know of any problems this may cause.
8499 But your current setting of $shrpdir is
8500 the default anyway, so it's harmless.
8505 Further, your current attempted setting of $shrpdir
8506 conflicts with the value of $archlibexp/CORE
8507 that installperl will use.
8514 # How will the perl executable find the installed shared $libperl?
8515 # Add $xxx to ccdlflags.
8516 # If we can't figure out a command-line option, use $shrpenv to
8517 # set env LD_RUN_PATH. The main perl makefile uses this.
8518 shrpdir=$archlibexp/CORE
8521 if "$useshrplib"; then
8524 # We'll set it in Makefile.SH...
8529 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8530 xxx="-Wl,-R$shrpdir"
8532 bsdos|linux|irix*|dec_osf|gnu*)
8533 xxx="-Wl,-rpath,$shrpdir"
8536 # Haiku doesn't like the default, either.
8539 # hpux doesn't like the default, either.
8540 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8543 # cygwin needs only ldlibpth
8546 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8552 # Only add $xxx if it isn't already in ccdlflags.
8553 case " $ccdlflags " in
8555 *) ccdlflags="$ccdlflags $xxx"
8558 Adding $xxx to the flags
8559 passed to $ld so that the perl executable will find the
8560 installed shared $libperl.
8568 # Fix ccdlflags in AIX for building external extensions.
8569 # (For building Perl itself bare -bE:perl.exp is needed,
8570 # Makefile.SH takes care of this.)
8572 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8574 # Respect a hint or command-line value.
8576 '') shrpenv="$tmp_shrpenv" ;;
8578 case "$ldlibpthname" in
8579 '') ldlibpthname=LD_LIBRARY_PATH ;;
8580 none) ldlibpthname='' ;;
8583 : determine where manual pages are on this system
8587 syspath='/usr/share/man/man1 /usr/man/man1'
8588 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8589 syspath="$syspath /usr/man/u_man/man1"
8590 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8591 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8592 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8593 sysman=`./loc . /usr/man/man1 $syspath`
8596 if $test -d "$sysman"; then
8597 echo "System manual is in $sysman." >&4
8599 echo "Could not find manual pages in source form." >&4
8602 : determine where manual pages go
8603 set man1dir man1dir none
8607 $spackage has manual pages available in source form.
8611 echo "However, you don't have nroff, so they're probably useless to you."
8613 '') man1dir="none";;
8616 echo "If you don't want the manual sources installed, answer 'none'."
8621 lookpath="$prefixexp/share/man/man1"
8622 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8623 lookpath="$lookpath $prefixexp/man/p_man/man1"
8624 lookpath="$lookpath $prefixexp/man/u_man/man1"
8625 lookpath="$lookpath $prefixexp/man/man.1"
8627 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8628 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8638 rp="Where do the main $spackage manual pages (source) go?"
8640 if $test "X$man1direxp" != "X$ansexp"; then
8651 : What suffix to use on installed man pages
8658 rp="What suffix should be used for the main $spackage man pages?"
8660 '') case "$man1dir" in
8674 *) dflt="$man1ext";;
8681 : see if we can have long filenames
8683 first=123456789abcdef
8685 if (echo hi >$first) 2>/dev/null; then
8686 if $test -f 123456789abcde; then
8687 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8690 echo 'You can have filenames longer than 14 characters.'>&4
8695 You can't have filenames longer than 14 chars.
8696 You can't even think about them!
8702 $rm -rf 123456789abcde*
8704 : determine where library module manual pages go
8705 set man3dir man3dir none
8709 $spackage has manual pages for many of the library modules.
8715 However, you don't have nroff, so they're probably useless to you.
8718 '') man3dir="none";;
8722 case "$d_flexfnam" in
8725 However, your system can't handle the long file names like File::Basename.3.
8728 '') man3dir="none";;
8732 echo "If you don't want the manual sources installed, answer 'none'."
8733 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8735 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8736 if $test -d "$privlib/man/man3"; then
8739 WARNING: Previous versions of perl installed man3 pages into
8740 $privlib/man/man3. This version will suggest a
8741 new default of $dflt.
8745 rp='Do you wish to preserve the old behavior?(y/n)'
8748 y*) dflt="$privlib/man/man3" ;;
8753 *) dflt="$man3dir" ;;
8760 rp="Where do the $package library man pages (source) go?"
8770 : What suffix to use on installed man pages
8776 rp="What suffix should be used for the $package library man pages?"
8778 '') case "$man3dir" in
8792 *) dflt="$man3ext";;
8799 : see if we have to deal with yellow pages, now NIS.
8800 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8806 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8814 rp='Are you getting the hosts file via yellow pages?'
8817 y*) hostcat='ypcat hosts';;
8818 *) hostcat='cat /etc/hosts';;
8824 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8827 '') test -f /etc/group && groupcat='cat /etc/group';;
8830 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8833 : now get the host name
8835 echo "Figuring out host name..." >&4
8836 case "$myhostname" in
8838 echo 'Maybe "hostname" will work...'
8839 if tans=`sh -c hostname 2>&1` ; then
8847 if $test "$cont"; then
8849 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8850 if tans=`cat /etc/systemid 2>&1` ; then
8852 phostname='cat /etc/systemid'
8853 echo "Whadyaknow. Xenix always was a bit strange..."
8856 elif $test -r /etc/systemid; then
8857 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8860 if $test "$cont"; then
8861 echo 'No, maybe "uuname -l" will work...'
8862 if tans=`sh -c 'uuname -l' 2>&1` ; then
8864 phostname='uuname -l'
8866 echo 'Strange. Maybe "uname -n" will work...'
8867 if tans=`sh -c 'uname -n' 2>&1` ; then
8869 phostname='uname -n'
8871 echo 'Oh well, maybe I can mine it out of whoami.h...'
8872 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8873 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8874 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8876 case "$myhostname" in
8877 '') echo "Does this machine have an identity crisis or something?"
8880 echo "Well, you said $myhostname before..."
8881 phostname='echo $myhostname';;
8887 case "$myhostname" in
8888 '') myhostname=noname ;;
8890 : you do not want to know about this
8895 if $test "$myhostname" ; then
8897 rp='Your host name appears to be "'$myhostname'".'" Right?"
8905 : bad guess or no guess
8906 while $test "X$myhostname" = X ; do
8908 rp="Please type the (one word) name of your host:"
8913 : translate upper to lower if necessary
8914 case "$myhostname" in
8916 echo "(Normalizing case in your host name)"
8917 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8921 case "$myhostname" in
8923 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8924 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8925 echo "(Trimming domain name from host name--host name is now $myhostname)"
8927 *) case "$mydomain" in
8930 test "X$hostcat" = "Xypcat hosts" &&
8931 ypmatch "$myhostname" hosts 2>/dev/null |\
8932 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8935 test "X$hostcat" != "X" &&
8936 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8937 /[ ]$myhostname[ . ]/p" > hosts
8940 if $test -f hosts; then
8941 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8942 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8943 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8944 hosts | $sort | $uniq | \
8945 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8946 case `$echo X$dflt` in
8947 X*\ *) echo "(Several hosts in the database matched hostname)"
8950 X.) echo "(You do not have fully-qualified names in the hosts database)"
8954 echo "(I cannot locate a hosts database anywhere)"
8959 tans=`./loc resolv.conf X /etc /usr/etc`
8960 if $test -f "$tans"; then
8961 echo "(Attempting domain name extraction from $tans)"
8962 dflt=.`$sed -n -e 's/ / /g' \
8963 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8966 .) dflt=.`$sed -n -e 's/ / /g' \
8967 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8975 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8976 dflt=.`sh -c domainname 2>/dev/null`
8979 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8983 case "$dflt$osname" in
8984 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8985 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8989 .) echo "(Lost all hope -- silly guess then)"
8995 *) dflt="$mydomain";;
8999 rp="What is your domain name?"
9009 : translate upper to lower if necessary
9012 echo "(Normalizing case in your domain name)"
9013 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9017 : a little sanity check here
9018 case "$phostname" in
9021 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9022 $myhostname$mydomain|$myhostname) ;;
9024 case "$phostname" in
9026 echo "(That doesn't agree with your whoami.h file, by the way.)"
9029 echo "(That doesn't agree with your $phostname command, by the way.)"
9037 : determine the e-mail address of the user who is running us
9040 I need to get your e-mail address in Internet format if possible, i.e.
9041 something like user@host.domain. Please answer accurately since I have
9042 no easy means to double check it. The default value provided below
9043 is most probably close to reality but may not be valid from outside
9044 your organization...
9048 while test "$cont"; do
9049 case "$MAILDOMAIN" in
9051 if $test -s /etc/mailname; then
9052 maildomain=`$cat /etc/mailname`
9054 maildomain="$myhostname$mydomain"
9057 *) maildomain="$MAILDOMAIN";;
9060 '') dflt="$cf_by@$maildomain";;
9061 *) dflt="$cf_email";;
9063 rp='What is your e-mail address?'
9069 rp='Address does not look like an Internet one. Use it anyway?'
9083 : Ask e-mail of administrator
9086 If you or somebody else will be maintaining perl at your site, please
9087 fill in the correct e-mail address here so that they may be contacted
9088 if necessary. Currently, the "perlbug" program included with perl
9089 will send mail to this address in addition to perlbug@perl.org. You may
9090 enter "none" for no administrator.
9093 case "$perladmin" in
9094 '') dflt="$cf_email";;
9095 *) dflt="$perladmin";;
9097 rp='Perl administrator e-mail address'
9101 : determine whether to only install version-specific parts.
9104 Do you want to install only the version-specific parts of the perl
9105 distribution? Usually you do *not* want to do this.
9107 case "$versiononly" in
9108 "$define"|[Yy]*|true) dflt='y' ;;
9111 rp="Do you want to install only the version-specific parts of perl?"
9114 [yY]*) val="$define";;
9120 case "$versiononly" in
9121 "$define") inc_version_list=''
9122 inc_version_list_init=0
9126 : figure out how to guarantee perl startup
9127 : XXX Note that this currently takes advantage of the bug that binexp ignores
9128 : the Configure -Dinstallprefix setting, which in turn means that under
9129 : relocatable @INC, initialinstalllocation is what binexp started as.
9130 case "$startperl" in
9132 case "$sharpbang" in
9136 I can use the #! construct to start perl on your system. This will
9137 make startup of perl scripts faster, but may cause problems if you
9138 want to share those scripts and perl is not in a standard place
9139 ($initialinstalllocation/perl) on all your platforms. The alternative
9140 is to force a shell by starting the script with a single ':' character.
9143 case "$versiononly" in
9144 "$define") dflt="$initialinstalllocation/perl$version";;
9145 *) dflt="$initialinstalllocation/perl";;
9147 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9150 none) startperl=": # use perl";;
9151 *) startperl="#!$ans"
9152 if $test 30 -lt `echo "$ans" | wc -c`; then
9155 WARNING: Some systems limit the #! command to 32 characters.
9156 If you experience difficulty running Perl scripts with #!, try
9157 installing Perl in a directory with a shorter pathname.
9163 *) startperl=": # use perl"
9168 echo "I'll use $startperl to start perl scripts."
9170 : figure best path for perl in scripts
9173 case "$versiononly" in
9174 "$define") perlpath="$initialinstalllocation/perl$version";;
9175 *) perlpath="$initialinstalllocation/perl";;
9177 case "$startperl" in
9182 I will use the "eval 'exec'" idiom to start Perl on your system.
9183 I can use the full path of your Perl binary for this purpose, but
9184 doing so may cause problems if you want to share those scripts and
9185 Perl is not always in a standard place ($initialinstalllocation/perl).
9188 dflt="$initialinstalllocation/perl"
9189 rp="What path shall I use in \"eval 'exec'\"?"
9196 case "$startperl" in
9198 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9201 : determine where public executable scripts go
9202 set scriptdir scriptdir
9204 case "$scriptdir" in
9207 : guess some guesses
9208 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9209 $test -d /usr/share/bin && dflt=/usr/share/bin
9210 $test -d /usr/local/script && dflt=/usr/local/script
9211 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9212 $test -d $prefixexp/script && dflt=$prefixexp/script
9216 *) dflt="$scriptdir"
9221 Some installations have a separate directory just for executable scripts so
9222 that they can mount it across multiple architectures but keep the scripts in
9223 one spot. You might, for example, have a subdirectory of /usr/share for this.
9224 Or you might just lump your scripts in with all your other executables.
9228 rp='Where do you keep publicly executable scripts?'
9230 if $test "X$ansexp" != "X$scriptdirexp"; then
9236 : A little fix up for an irregularly named variable.
9237 installscript="$installscriptdir"
9239 : determine where add-on public executables go
9241 '') dflt=$siteprefix/bin ;;
9245 rp='Pathname where the add-on public executables should be installed?'
9250 : determine where add-on html pages go
9251 : There is no standard location, so try to copy the previously-selected
9252 : directory structure for the core html pages.
9253 case "$sitehtml1dir" in
9254 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9255 *) dflt=$sitehtml1dir ;;
9258 ''|' ') dflt=none ;;
9261 rp='Pathname where the site-specific html pages should be installed?'
9263 prefixvar=sitehtml1dir
9266 : determine where add-on library html pages go
9267 : There is no standard location, so try to copy the previously-selected
9268 : directory structure for the core html pages.
9269 case "$sitehtml3dir" in
9270 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9271 *) dflt=$sitehtml3dir ;;
9274 ''|' ') dflt=none ;;
9277 rp='Pathname where the site-specific library html pages should be installed?'
9279 prefixvar=sitehtml3dir
9282 : determine where add-on manual pages go
9283 case "$siteman1dir" in
9284 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9285 *) dflt=$siteman1dir ;;
9288 ''|' ') dflt=none ;;
9291 rp='Pathname where the site-specific manual pages should be installed?'
9293 prefixvar=siteman1dir
9296 : determine where add-on library man pages go
9297 case "$siteman3dir" in
9298 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9299 *) dflt=$siteman3dir ;;
9302 ''|' ') dflt=none ;;
9305 rp='Pathname where the site-specific library manual pages should be installed?'
9307 prefixvar=siteman3dir
9310 : determine where add-on public executable scripts go
9311 case "$sitescript" in
9312 '') dflt=$siteprefix/script
9313 $test -d $dflt || dflt=$sitebin ;;
9314 *) dflt="$sitescript" ;;
9317 rp='Pathname where add-on public executable scripts should be installed?'
9319 prefixvar=sitescript
9322 : see if backtrace exists
9323 set backtrace d_backtrace
9326 : add flags if using c backtrace
9327 case "$usecbacktrace" in
9328 "") usecbacktrace=$undef ;;
9330 case "$d_backtrace" in
9332 case " $ccflags " in
9333 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9334 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9338 echo "This system does not support backtrace" >&4
9339 usecbacktrace=$undef
9345 : Check if faststdio is requested and available
9346 case "$usefaststdio" in
9347 $define|true|[yY]*|'')
9348 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9358 Perl can be built to use 'fast stdio', which means using the stdio
9359 library but also directly manipulating the stdio buffers to enable
9360 faster I/O. Using stdio is better for backward compatibility (especially
9361 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9362 interface has been preferred instead of stdio.
9364 If this doesn't make any sense to you, just accept the default '$dflt'.
9366 rp='Use the "fast stdio" if available?'
9369 y|Y) val="$define" ;;
9376 : define an is-a-typedef? function
9377 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9379 "") inclist="sys/types.h";;
9381 eval "varval=\$$var";
9385 for inc in $inclist; do
9386 echo "#include <$inc>" >>temp.c;
9388 echo "#ifdef $type" >> temp.c;
9389 echo "printf(\"We have $type\");" >> temp.c;
9390 echo "#endif" >> temp.c;
9391 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9392 if $contains $type temp.E >/dev/null 2>&1; then
9398 *) eval "$var=\$varval";;
9401 : define an is-a-typedef? function that prompts if the type is not available.
9402 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9404 "") inclist="sys/types.h";;
9406 eval "varval=\$$var";
9410 for inc in $inclist; do
9411 echo "#include <$inc>" >>temp.c;
9413 echo "#ifdef $type" >> temp.c;
9414 echo "printf(\"We have $type\");" >> temp.c;
9415 echo "#endif" >> temp.c;
9416 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9418 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9419 if $contains $type temp.E >/dev/null 2>&1; then
9420 echo "$type found." >&4;
9423 echo "$type NOT found." >&4;
9429 *) eval "$var=\$varval";;
9432 : see what type lseek is declared as in the kernel
9433 rp="What is the type used for lseek's offset on this system?"
9434 set off_t lseektype long stdio.h sys/types.h
9438 echo "Checking to see how big your file offsets are..." >&4
9440 #include <sys/types.h>
9444 printf("%d\n", (int)sizeof($lseektype));
9449 if eval $compile_ok; then
9450 lseeksize=`$run ./try`
9451 echo "Your file offsets are $lseeksize bytes long."
9455 echo "(I can't seem to compile the test program. Guessing...)"
9456 rp="What is the size of your file offsets (in bytes)?"
9462 : see what type file positions are declared as in the library
9463 rp="What is the type for file position used by fsetpos()?"
9464 set fpos_t fpostype long stdio.h sys/types.h
9467 : Check size for Fpos_t
9470 *_t) zzz="$fpostype" ;;
9473 echo "Checking the size of $zzz..." >&4
9475 #include <sys/types.h>
9482 printf("%d\n", (int)sizeof($fpostype));
9487 if eval $compile_ok; then
9491 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9494 echo "Your $zzz is $fpossize bytes long."
9500 echo "(I can't compile the test program. Guessing...)" >&4
9501 rp="What is the size of your file positions (in bytes)?"
9506 : Check for large file support
9507 # Backward compatibility (uselfs is deprecated).
9509 "$define"|true|[yY]*)
9512 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9514 uselargefiles="$define"
9518 case "$lseeksize:$fpossize" in
9521 You can have files larger than 2 gigabytes.
9524 *) case "$uselargefiles" in
9525 "$undef"|false|[nN]*) dflt='n' ;;
9530 Perl can be built to understand large files (files larger than 2 gigabytes)
9531 on some systems. To do so, Configure can be run with -Duselargefiles.
9533 If this doesn't make any sense to you, just accept the default '$dflt'.
9535 rp='Try to understand large files, if available?'
9538 y|Y) val="$define" ;;
9545 : Look for a hint-file generated 'call-back-unit'. If the
9546 : user has specified that a large files perl is to be built,
9547 : we may need to set or change some other defaults.
9548 if $test -f uselargefiles.cbu; then
9549 echo "Your platform has some specific hints regarding large file builds, using them..."
9550 . ./uselargefiles.cbu
9552 case "$uselargefiles" in
9554 if $test -f uselargefiles.cbu; then
9556 echo "Rechecking to see how big your file offsets are..." >&4
9558 #include <sys/types.h>
9562 printf("%d\n", (int)sizeof($lseektype));
9567 if eval $compile_ok; then
9568 lseeksize=`$run ./try`
9569 $echo "Your file offsets are now $lseeksize bytes long."
9573 echo "(I can't seem to compile the test program. Guessing...)"
9574 rp="What is the size of your file offsets (in bytes)?"
9579 *_t) zzz="$fpostype" ;;
9582 $echo $n "Rechecking the size of $zzz...$c" >&4
9584 #include <sys/types.h>
9591 printf("%d\n", (int)sizeof($fpostype));
9596 if eval $compile_ok; then
9601 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9604 echo " $fpossize bytes." >&4
9610 echo "(I can't compile the test program. Guessing...)" >&4
9611 rp="What is the size of your file positions (in bytes)?"
9620 : Check if we want perlio
9623 : Set the vendorbin variables
9624 case "$vendorprefix" in
9625 '') d_vendorbin="$undef"
9629 *) d_vendorbin="$define"
9630 : determine where vendor-supplied executables go.
9631 case "$vendorbin" in
9632 '') dflt=$vendorprefix/bin ;;
9633 *) dflt="$vendorbin" ;;
9636 rp='Pathname for the vendor-supplied executables directory?'
9639 vendorbinexp="$ansexp"
9645 : Set the vendorhtml1dir variables
9646 case "$vendorprefix" in
9647 '') vendorhtml1dir=''
9648 vendorhtml1direxp=''
9650 *) : determine where vendor-supplied html pages go.
9651 : There is no standard location, so try to copy the previously-selected
9652 : directory structure for the core html pages.
9653 : XXX Better default suggestions would be welcome.
9654 case "$vendorhtml1dir" in
9655 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9656 *) dflt=$vendorhtml1dir ;;
9659 ''|' ') dflt=none ;;
9662 rp='Pathname for the vendor-supplied html pages?'
9664 vendorhtml1dir="$ans"
9665 vendorhtml1direxp="$ansexp"
9668 : Use ' ' for none so value is preserved next time through Configure
9669 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9670 prefixvar=vendorhtml1dir
9673 : Set the vendorhtml3dir variables
9674 case "$vendorprefix" in
9675 '') vendorhtml3dir=''
9676 vendorhtml3direxp=''
9678 *) : determine where vendor-supplied module html pages go.
9679 : There is no standard location, so try to copy the previously-selected
9680 : directory structure for the core html pages.
9681 : XXX Better default suggestions would be welcome.
9682 case "$vendorhtml3dir" in
9683 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9684 *) dflt=$vendorhtml3dir ;;
9687 ''|' ') dflt=none ;;
9690 rp='Pathname for the vendor-supplied html pages?'
9692 vendorhtml3dir="$ans"
9693 vendorhtml3direxp="$ansexp"
9696 : Use ' ' for none so value is preserved next time through Configure
9697 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9698 prefixvar=vendorhtml3dir
9701 : Set the vendorman1dir variables
9702 case "$vendorprefix" in
9703 '') vendorman1dir=''
9706 *) : determine where vendor-supplied manual pages go.
9707 case "$vendorman1dir" in
9708 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9709 *) dflt=$vendorman1dir ;;
9712 ''|' ') dflt=none ;;
9715 rp='Pathname for the vendor-supplied manual section 1 pages?'
9717 vendorman1dir="$ans"
9718 vendorman1direxp="$ansexp"
9721 : Use ' ' for none so value is preserved next time through Configure
9722 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9723 prefixvar=vendorman1dir
9726 : Set the vendorman3dir variables
9727 case "$vendorprefix" in
9728 '') vendorman3dir=''
9731 *) : determine where vendor-supplied module manual pages go.
9732 case "$vendorman3dir" in
9733 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9734 *) dflt=$vendorman3dir ;;
9737 ''|' ') dflt=none ;;
9740 rp='Pathname for the vendor-supplied manual section 3 pages?'
9742 vendorman3dir="$ans"
9743 vendorman3direxp="$ansexp"
9746 : Use ' ' for none so value is preserved next time through Configure
9747 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9748 prefixvar=vendorman3dir
9751 : Set the vendorscript variables
9752 case "$vendorprefix" in
9753 '') d_vendorscript="$undef"
9757 *) d_vendorscript="$define"
9758 : determine where vendor-supplied scripts go.
9759 case "$vendorscript" in
9760 '') dflt=$vendorprefix/script
9761 $test -d $dflt || dflt=$vendorbin ;;
9762 *) dflt="$vendorscript" ;;
9766 The installation process will create a directory for
9767 vendor-supplied scripts.
9771 rp='Pathname for the vendor-supplied scripts directory?'
9774 vendorscriptexp="$ansexp"
9777 prefixvar=vendorscript
9780 : script used to emit important warnings
9783 if test \$# -gt 0; then
9788 echo "*** WARNING:" >&4
9789 sed -e 's/^/*** /' <msg >&4
9791 cat msg >>config.msg
9792 echo " " >>config.msg
9798 : see which of string.h or strings.h is needed
9800 strings=`./findhdr string.h`
9801 if $test "$strings" && $test -r "$strings"; then
9802 echo "Using <string.h> instead of <strings.h>." >&4
9806 strings=`./findhdr strings.h`
9807 if $test "$strings" && $test -r "$strings"; then
9808 echo "Using <strings.h> instead of <string.h>." >&4
9810 ./warn "No string header found -- You'll surely have problems."
9816 "$undef") strings=`./findhdr strings.h`;;
9817 *) strings=`./findhdr string.h`;;
9820 : see if qgcvt exists
9824 : Check print/scan long double stuff
9827 if $test X"$d_longdbl" = X"$define"; then
9829 echo "Checking how to print long doubles..." >&4
9831 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9832 $cat >try.c <<'EOCP'
9833 #include <sys/types.h>
9837 printf("%.3f\n", d);
9841 if eval $compile; then
9845 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9846 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9847 echo "We will use %f."
9853 if $test X"$sPRIfldbl" = X; then
9854 $cat >try.c <<'EOCP'
9855 #include <sys/types.h>
9858 long double d = 123.456;
9859 printf("%.3Lf\n", d);
9863 if eval $compile; then
9867 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9868 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9869 echo "We will use %Lf."
9875 if $test X"$sPRIfldbl" = X; then
9876 $cat >try.c <<'EOCP'
9877 #include <sys/types.h>
9880 long double d = 123.456;
9881 printf("%.3llf\n", d);
9885 if eval $compile; then
9889 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9890 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9891 echo "We will use %llf."
9897 if $test X"$sPRIfldbl" = X; then
9898 $cat >try.c <<'EOCP'
9899 #include <sys/types.h>
9902 long double d = 123.456;
9903 printf("%.3lf\n", d);
9907 if eval $compile; then
9911 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9912 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9913 echo "We will use %lf."
9919 if $test X"$sPRIfldbl" = X; then
9920 echo "Cannot figure out how to print long doubles." >&4
9922 sSCNfldbl=$sPRIfldbl # expect consistency
9929 case "$sPRIfldbl" in
9930 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9931 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9932 d_SCNfldbl="$undef";
9934 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9935 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9936 d_SCNfldbl="$define";
9940 : Check how to convert floats to strings.
9942 if test "X$d_Gconvert" = X; then
9945 echo "Checking for an efficient way to convert floats to strings."
9947 case "$uselongdouble" in
9948 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9950 case "$d_longdbl" in
9951 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9953 case "$d_PRIgldbl" in
9954 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9958 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9959 char *myname = "gconvert";
9962 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9963 char *myname = "gcvt";
9966 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9967 char *myname = "qgcvt";
9968 #define DOUBLETYPE long double
9971 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9973 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9975 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9978 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9980 char *myname = "sprintf";
9984 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9985 #define DOUBLETYPE long double
9987 #define DOUBLETYPE double
9999 # include <string.h>
10001 # include <strings.h>
10004 int checkit(char *expect, char *got)
10006 if (strcmp(expect, got)) {
10007 printf("%s oddity: Expected %s, got %s\n",
10008 myname, expect, got);
10018 /* This must be 1st test on (which?) platform */
10019 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10020 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10021 checkit("0.1", buf);
10023 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10024 checkit("0.01", buf);
10026 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10027 checkit("0.001", buf);
10029 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10030 checkit("0.0001", buf);
10032 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10033 if (strlen(buf) > 5)
10034 checkit("9e-005", buf); /* for Microsoft ?? */
10036 checkit("9e-05", buf);
10038 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10041 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10042 checkit("1.1", buf);
10044 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10045 checkit("1.01", buf);
10047 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10048 checkit("1.001", buf);
10050 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10051 checkit("1.0001", buf);
10053 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10054 checkit("1.00001", buf);
10056 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10057 checkit("1.000001", buf);
10059 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10062 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10063 checkit("-1", buf);
10065 /* Some Linux gcvt's give 1.e+5 here. */
10066 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10067 checkit("100000", buf);
10069 /* Some Linux gcvt's give -1.e+5 here. */
10070 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10071 checkit("-100000", buf);
10073 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10074 checkit("123.456", buf);
10076 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10077 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10078 /* 34 should be enough to scare even long double
10079 * places into using the e notation. */
10080 if (strlen(buf) > 5)
10081 checkit("1e+034", buf); /* for Microsoft */
10083 checkit("1e+34", buf);
10085 /* For Perl, if you add additional tests here, also add them to
10086 * t/base/num.t for benefit of platforms not using Configure or
10087 * overriding d_Gconvert */
10092 : first add preferred functions to our list
10094 for xxx_convert in $gconvert_preference; do
10095 case $xxx_convert in
10096 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10097 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10100 : then add any others
10101 for xxx_convert in gconvert gcvt sprintf; do
10102 case "$xxx_list" in
10104 *) xxx_list="$xxx_list $xxx_convert" ;;
10108 case "$d_longdbl$uselongdouble" in
10110 : again, add preferred functions to our list first
10112 for xxx_convert in $gconvert_ld_preference; do
10113 case $xxx_convert in
10114 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10115 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10118 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10119 for xxx_convert in qgcvt sprintf $xxx_list; do
10120 case "$xxx_ld_list" in
10121 $xxx_convert*|*" $xxx_convert"*) ;;
10122 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10125 : if sprintf cannot do long doubles, move it to the end
10126 if test "$d_PRIgldbl" != "$define"; then
10127 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10129 : if no qgcvt, remove it
10130 if test "$d_qgcvt" != "$define"; then
10131 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10134 xxx_list="$xxx_ld_list"
10138 for xxx_convert in $xxx_list; do
10139 echo "Trying $xxx_convert..."
10140 $rm -f try try$_o core
10141 set try -DTRY_$xxx_convert
10142 if eval $compile; then
10143 echo "$xxx_convert() found." >&4
10144 if $run ./try; then
10145 echo "I'll use $xxx_convert to convert floats into a string." >&4
10148 echo "...But $xxx_convert didn't work as I expected."
10152 echo "$xxx_convert NOT found." >&4
10156 if test X$xxx_convert = X; then
10157 echo "*** WHOA THERE!!! ***" >&4
10158 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10159 xxx_convert=sprintf
10162 case "$xxx_convert" in
10163 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10164 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10165 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10166 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10167 "$define$define$define")
10168 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10169 "$define$define$undef")
10170 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10171 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10179 : see if _fwalk exists
10183 : Initialize h_fcntl
10186 : Initialize h_sysfile
10189 : access call always available on UNIX
10190 set access d_access
10193 : locate the flags for 'access()'
10194 case "$d_access" in
10197 $cat >access.c <<EOCP
10198 #include <sys/types.h>
10203 #include <sys/file.h>
10206 #include <unistd.h>
10208 #$i_stdlib I_STDLIB
10210 #include <stdlib.h>
10216 : check sys/file.h first, no particular reason here
10217 if $test `./findhdr sys/file.h` && \
10218 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10220 echo "<sys/file.h> defines the *_OK access constants." >&4
10221 elif $test `./findhdr fcntl.h` && \
10222 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10224 echo "<fcntl.h> defines the *_OK access constants." >&4
10225 elif $test `./findhdr unistd.h` && \
10226 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10227 echo "<unistd.h> defines the *_OK access constants." >&4
10229 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10235 : see if accessx exists
10236 set accessx d_accessx
10239 : see if aintl exists
10243 : see if alarm exists
10247 : see if 64bit time functions exists
10249 set ctime64 d_ctime64
10252 set localtime64 d_localtime64
10255 set gmtime64 d_gmtime64
10258 set mktime64 d_mktime64
10261 set difftime64 d_difftime64
10264 set asctime64 d_asctime64
10267 : see if POSIX threads are available
10268 set pthread.h i_pthread
10271 : define a function to check prototypes
10272 $cat > protochk <<EOSH
10275 optimize="$optimize"
10277 prototype="$prototype"
10280 usethreads=$usethreads
10281 i_pthread=$i_pthread
10282 pthread_h_first=$pthread_h_first
10285 $cat >> protochk <<'EOSH'
10290 while test $# -ge 2; do
10292 $define) echo "#include <$2>" >> try.c ;;
10293 literal) echo "$2" >> try.c ;;
10295 # Extra magic for the benefit of systems that need pthread.h
10296 # to be included early to correctly detect threadsafe functions.
10297 # Such functions must guarantee themselves, though, that the usethreads
10298 # and i_pthread have been defined, before calling protochk.
10299 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10300 echo "#include <pthread.h>" >> try.c
10305 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10306 cat >> try.c <<'EOCP'
10307 #ifdef CAN_PROTOTYPE
10308 #define _(args) args
10313 echo "$foo" >> try.c
10314 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10315 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10321 $eunicefix protochk
10323 : Define hasproto macro for Configure internal use
10324 hasproto='varname=$1; func=$2; shift; shift;
10325 while $test $# -ge 2; do
10327 $define) echo "#include <$2>";;
10331 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10332 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10333 echo "$func() prototype found.";
10336 echo "$func() prototype NOT found.";
10343 : see if sys/types.h has to be included
10344 set sys/types.h i_systypes
10347 : see if sys/select.h has to be included
10348 set sys/select.h i_sysselct
10351 : Define hasfield macro for Configure internal use
10352 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10353 while $test $# -ge 2; do
10355 $define) echo "#include <$2>";;
10359 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10361 if eval $compile; then
10370 : see if we should include time.h, sys/time.h, or both
10372 if test "X$timeincl" = X; then
10373 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10374 $echo $n "I'm now running the test program...$c"
10376 #include <sys/types.h>
10381 #ifdef SYSTIMEKERNEL
10384 #include <sys/time.h>
10387 #include <sys/select.h>
10389 #$i_stdlib I_STDLIB
10391 #include <stdlib.h>
10397 struct timeval bar;
10400 struct timezone tzp;
10402 if (foo.tm_sec == foo.tm_sec)
10405 if (bar.tv_sec == bar.tv_sec)
10412 for s_timezone in '-DS_TIMEZONE' ''; do
10414 for s_timeval in '-DS_TIMEVAL' ''; do
10415 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10416 for i_time in '' '-DI_TIME'; do
10417 for i_systime in '-DI_SYSTIME' ''; do
10420 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10421 if eval $compile; then
10422 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10426 $echo $n "Succeeded with $flags$c"
10438 *SYSTIMEKERNEL*) i_systimek="$define"
10439 timeincl=`./findhdr sys/time.h`
10440 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10441 *) i_systimek="$undef";;
10444 *I_TIME*) i_time="$define"
10445 timeincl=`./findhdr time.h`" $timeincl"
10446 echo "We'll include <time.h>." >&4;;
10447 *) i_time="$undef";;
10450 *I_SYSTIME*) i_systime="$define"
10451 timeincl=`./findhdr sys/time.h`" $timeincl"
10452 echo "We'll include <sys/time.h>." >&4;;
10453 *) i_systime="$undef";;
10457 : see if struct tm knows about tm_zone
10458 case "$i_systime$i_time" in
10461 echo "Checking to see if your struct tm has tm_zone field..." >&4
10462 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10470 case "$d_tm_tm_zone" in
10471 "$define") echo "Yes, it does." ;;
10472 *) echo "No, it doesn't." ;;
10474 : see if struct tm knows about tm_gmtoff
10475 case "$i_systime$i_time" in
10478 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10479 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10487 case "$d_tm_tm_gmtoff" in
10488 "$define") echo "Yes, it does." ;;
10489 *) echo "No, it doesn't." ;;
10492 : see if asctime_r exists
10493 set asctime_r d_asctime_r
10495 case "$d_asctime_r" in
10497 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10498 case "$d_asctime_r_proto:$usethreads" in
10499 ":define") d_asctime_r_proto=define
10500 set d_asctime_r_proto asctime_r $hdrs
10504 case "$d_asctime_r_proto" in
10506 case "$asctime_r_proto" in
10507 ''|0) try='char* asctime_r(const struct tm*, char*);'
10508 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10510 case "$asctime_r_proto" in
10511 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10512 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10514 case "$asctime_r_proto" in
10515 ''|0) try='int asctime_r(const struct tm*, char*);'
10516 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10518 case "$asctime_r_proto" in
10519 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10520 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10522 case "$asctime_r_proto" in
10523 ''|0) d_asctime_r=undef
10525 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10526 * ) case "$asctime_r_proto" in
10527 REENTRANT_PROTO*) ;;
10528 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10530 echo "Prototype: $try" ;;
10533 *) case "$usethreads" in
10534 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10541 *) asctime_r_proto=0
10545 : see if atolf exists
10549 : see if atoll exists
10553 : Look for GCC-style attribute format
10554 case "$d_attribute_format" in
10557 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10558 $cat >attrib.c <<'EOCP'
10560 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10562 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10563 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10564 echo "Your C compiler doesn't support __attribute__((format))."
10567 echo "Your C compiler supports __attribute__((format))."
10571 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10575 *) val="$d_attribute_format" ;;
10577 set d_attribute_format
10581 : Look for GCC-style attribute format with null format allowed
10582 case "$d_printf_format_null" in
10583 '') case "$d_attribute_format" in
10586 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10587 $cat >attrib.c <<EOCP
10589 #$i_stdlib I_STDLIB
10591 #include <stdlib.h>
10593 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10594 int null_printf (char* pat,...) { return (int)pat; }
10595 int main () { exit(null_printf(NULL)); }
10597 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10598 : run the executable in case it produces a run-time warning
10599 if $run ./attrib >>attrib.out 2>&1; then
10600 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10601 echo "Your C compiler doesn't allow __printf__ format to be null."
10604 echo "Your C compiler allows __printf__ format to be null."
10608 echo "Your C compiler executable failed with __printf__ format null."
10612 echo "Your C compiler fails with __printf__ format null."
10619 *) val="$d_printf_format_null" ;;
10621 set d_printf_format_null
10625 : Look for GCC-style attribute malloc
10626 case "$d_attribute_malloc" in
10629 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10630 $cat >attrib.c <<'EOCP'
10632 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10634 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10635 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10636 echo "Your C compiler doesn't support __attribute__((malloc))."
10639 echo "Your C compiler supports __attribute__((malloc))."
10643 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10647 *) val="$d_attribute_malloc" ;;
10649 set d_attribute_malloc
10653 : Look for GCC-style attribute nonnull
10654 case "$d_attribute_nonnull" in
10657 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10658 $cat >attrib.c <<'EOCP'
10660 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10662 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10663 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10664 echo "Your C compiler doesn't support __attribute__((nonnull))."
10667 echo "Your C compiler supports __attribute__((nonnull))."
10671 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10675 *) val="$d_attribute_nonnull" ;;
10677 set d_attribute_nonnull
10681 : Look for GCC-style attribute noreturn
10682 case "$d_attribute_noreturn" in
10685 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10686 $cat >attrib.c <<'EOCP'
10688 void fall_over_dead( void ) __attribute__((noreturn));
10690 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10691 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10692 echo "Your C compiler doesn't support __attribute__((noreturn))."
10695 echo "Your C compiler supports __attribute__((noreturn))."
10699 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10703 *) val="$d_attribute_noreturn" ;;
10705 set d_attribute_noreturn
10709 : Look for GCC-style attribute pure
10710 case "$d_attribute_pure" in
10713 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10714 $cat >attrib.c <<'EOCP'
10716 int square( int n ) __attribute__((pure));
10718 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10719 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10720 echo "Your C compiler doesn't support __attribute__((pure))."
10723 echo "Your C compiler supports __attribute__((pure))."
10727 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10731 *) val="$d_attribute_pure" ;;
10733 set d_attribute_pure
10737 : Look for GCC-style attribute unused
10738 case "$d_attribute_unused" in
10741 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10742 $cat >attrib.c <<'EOCP'
10744 int do_something( int dummy __attribute__((unused)), int n );
10746 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10747 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10748 echo "Your C compiler doesn't support __attribute__((unused))."
10751 echo "Your C compiler supports __attribute__((unused))."
10755 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10759 *) val="$d_attribute_unused" ;;
10761 set d_attribute_unused
10765 : Look for GCC-style attribute deprecated
10766 case "$d_attribute_deprecated" in
10769 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10770 $cat >attrib.c <<'EOCP'
10772 int I_am_deprecated(void) __attribute__((deprecated));
10774 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10775 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10776 echo "Your C compiler doesn't support __attribute__((deprecated))."
10779 echo "Your C compiler supports __attribute__((deprecated))."
10783 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10787 *) val="$d_attribute_deprecated" ;;
10789 set d_attribute_deprecated
10793 : Look for GCC-style attribute warn_unused_result
10794 case "$d_attribute_warn_unused_result" in
10797 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10798 $cat >attrib.c <<'EOCP'
10800 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10802 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10803 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10804 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10807 echo "Your C compiler supports __attribute__((warn_unused_result))."
10811 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10815 *) val="$d_attribute_warn_unused_result" ;;
10817 set d_attribute_warn_unused_result
10821 : see if bcmp exists
10825 : see if bcopy exists
10829 : see if getpgrp exists
10830 set getpgrp d_getpgrp
10833 case "$d_getpgrp" in
10836 echo "Checking to see which flavor of getpgrp is in use..."
10838 #$i_unistd I_UNISTD
10839 #include <sys/types.h>
10841 # include <unistd.h>
10843 #$i_stdlib I_STDLIB
10845 #include <stdlib.h>
10849 if (getuid() == 0) {
10850 printf("(I see you are running Configure as super-user...)\n");
10853 #ifdef TRY_BSD_PGRP
10854 if (getpgrp(1) == 0)
10863 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10864 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10866 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10867 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10870 echo "I can't seem to compile and run the test program."
10872 xxx="a USG one, i.e. you use getpgrp()."
10874 # SVR4 systems can appear rather BSD-ish.
10875 case "$i_unistd" in
10877 xxx="a BSD one, i.e. you use getpgrp(pid)."
10881 xxx="probably a USG one, i.e. you use getpgrp()."
10886 echo "Assuming your getpgrp is $xxx" >&4
10895 : see if setpgrp exists
10896 set setpgrp d_setpgrp
10899 case "$d_setpgrp" in
10902 echo "Checking to see which flavor of setpgrp is in use..."
10904 #$i_unistd I_UNISTD
10905 #include <sys/types.h>
10907 # include <unistd.h>
10909 #$i_stdlib I_STDLIB
10911 #include <stdlib.h>
10915 if (getuid() == 0) {
10916 printf("(I see you are running Configure as super-user...)\n");
10919 #ifdef TRY_BSD_PGRP
10920 if (-1 == setpgrp(1, 1))
10923 if (setpgrp() != -1)
10929 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10930 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10932 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10933 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10936 echo "(I can't seem to compile and run the test program.)"
10938 xxx="a USG one, i.e. you use setpgrp()."
10940 # SVR4 systems can appear rather BSD-ish.
10941 case "$i_unistd" in
10943 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10947 xxx="probably a USG one, i.e. you use setpgrp()."
10952 echo "Assuming your setpgrp is $xxx" >&4
10961 : Look for GCC-style __builtin_choose_expr
10962 case "$d_builtin_choose_expr" in
10965 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10966 $cat >try.c <<'EOCP'
10967 #include <assert.h>
10968 #include <stdlib.h>
10971 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10974 assert( SYRINX(1) == 2112 );
10975 assert( SYRINX(1) != 5150 );
10976 assert( SYRINX(0) == 5150 );
10977 assert( SYRINX(0) != 2112 );
10978 puts( "All good!" );
10984 if eval $compile && $run ./try; then
10985 echo "Your C compiler supports __builtin_choose_expr."
10988 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10992 *) val="$d_builtin_choose_expr" ;;
10995 set d_builtin_choose_expr
10999 : Look for GCC-style __builtin_expect
11000 case "$d_builtin_expect" in
11003 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11004 $cat >try.c <<'EOCP'
11007 if ( __builtin_expect(n, 0) ) n = 1;
11008 /* Remember shell exit code truth is 0, C truth is non-zero */
11013 if eval $compile && $run ./try; then
11014 echo "Your C compiler supports __builtin_expect."
11017 echo "Your C compiler doesn't seem to understand __builtin_expect."
11021 *) val="$d_builtin_expect" ;;
11024 set d_builtin_expect
11028 : see if bzero exists
11032 : see if stdarg is available
11034 if $test `./findhdr stdarg.h`; then
11035 echo "<stdarg.h> found." >&4
11038 echo "<stdarg.h> NOT found." >&4
11042 : see if varargs is available
11044 if $test `./findhdr varargs.h`; then
11045 echo "<varargs.h> found." >&4
11047 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11050 : set up the varargs testing programs
11051 $cat > varargs.c <<EOP
11053 #include <stdarg.h>
11056 #include <varargs.h>
11060 int f(char *p, ...)
11074 p = va_arg(ap, char *);
11080 $cat > varargs <<EOP
11082 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11091 : now check which varargs header should be included
11097 if `./varargs I_STDARG`; then
11099 elif `./varargs I_VARARGS`; then
11104 if `./varargs I_VARARGS`; then
11112 echo "*** WHOA THERE!!! ***" >&4
11113 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11114 case "$knowitall" in
11116 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11120 echo "I could not find the definition for va_dcl... You have problems..." >&4
11121 val="$undef"; set i_stdarg; eval $setvar
11122 val="$undef"; set i_varargs; eval $setvar
11127 case "$i_varhdr" in
11129 val="$define"; set i_stdarg; eval $setvar
11130 val="$undef"; set i_varargs; eval $setvar
11133 val="$undef"; set i_stdarg; eval $setvar
11134 val="$define"; set i_varargs; eval $setvar
11137 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11141 : see if the Compiler supports C99 variadic macros
11142 case "$i_stdarg$i_stdlib" in
11144 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11147 #include <stdarg.h>
11149 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11153 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11159 if eval $compile && $run ./try 2>&1 >/dev/null; then
11160 case "`$run ./try`" in
11162 echo "You have C99 variadic macros." >&4
11163 d_c99_variadic_macros="$define"
11166 echo "You don't have functional C99 variadic macros." >&4
11167 d_c99_variadic_macros="$undef"
11171 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11172 d_c99_variadic_macros="$undef"
11177 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11178 d_c99_variadic_macros="$undef"
11182 : see if signal is declared as pointer to function returning int or void
11184 xxx=`./findhdr signal.h`
11185 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11186 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11187 echo "You have int (*signal())() instead of void." >&4
11189 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11190 echo "You have void (*signal())()." >&4
11192 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11193 echo "You have int (*signal())() instead of void." >&4
11195 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11196 echo "You have void (*signal())()." >&4
11199 case "$d_voidsig" in
11201 echo "I can't determine whether signal handler returns void or int..." >&4
11203 rp="What type does your signal handler return?"
11206 v*) val="$define";;
11210 echo "As you already told me, signal handler returns void." >&4
11213 *) echo "As you already told me, signal handler returns int." >&4
11220 case "$d_voidsig" in
11221 "$define") signal_t="void";;
11222 *) signal_t="int";;
11226 : check for ability to cast large floats to 32-bit ints.
11228 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11229 if $test "$intsize" -ge 4; then
11236 #$i_stdlib I_STDLIB
11238 #include <stdlib.h>
11240 #include <sys/types.h>
11241 #include <signal.h>
11242 $signal_t blech(int s) { exit(3); }
11249 signal(SIGFPE, blech);
11251 /* Don't let compiler optimize the test away. Store the number
11252 in a writable string for gcc to pass to sscanf under HP-UX.
11254 sprintf(str, "2147483647");
11255 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11259 /* x86 processors will probably give 0x8000 0000, which is a
11260 sign change. We don't want that. We want to mimic SPARC
11261 behavior here, which is to preserve the sign and give
11264 if (i32 != ($xxx) f)
11270 if eval $compile_ok; then
11274 echo "(I can't seem to compile the test program--assuming it can't)"
11279 echo "Yup, it can."
11282 echo "Nope, it can't."
11289 : check for ability to cast negative floats to unsigned
11291 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11294 #$i_stdlib I_STDLIB
11296 #include <stdlib.h>
11298 #include <sys/types.h>
11299 #include <signal.h>
11300 $signal_t blech(int s) { exit(7); }
11301 $signal_t blech_in_list(int s) { exit(4); }
11302 unsigned long dummy_long(unsigned long p) { return p; }
11303 unsigned int dummy_int(unsigned int p) { return p; }
11304 unsigned short dummy_short(unsigned short p) { return p; }
11308 unsigned long along;
11310 unsigned short ashort;
11314 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11315 a direct f = -123. assignment. gcc-2.8.0 reportedly
11316 optimized the whole file away
11318 /* Store the number in a writable string for gcc to pass to
11319 sscanf under HP-UX.
11321 sprintf(str, "-123");
11322 sscanf(str, "%lf", &f); /* f = -123.; */
11324 signal(SIGFPE, blech);
11325 along = (unsigned long)f;
11326 aint = (unsigned int)f;
11327 ashort = (unsigned short)f;
11328 if (along != (unsigned long)-123)
11330 if (aint != (unsigned int)-123)
11332 if (ashort != (unsigned short)-123)
11334 sprintf(str, "1073741824.");
11335 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11338 along = (unsigned long)f;
11339 if (along != 0x80000000)
11343 along = (unsigned long)f;
11344 if (along != 0x7fffffff)
11348 along = (unsigned long)f;
11349 if (along != 0x80000001)
11353 signal(SIGFPE, blech_in_list);
11354 sprintf(str, "123.");
11355 sscanf(str, "%lf", &f); /* f = 123.; */
11356 along = dummy_long((unsigned long)f);
11357 aint = dummy_int((unsigned int)f);
11358 ashort = dummy_short((unsigned short)f);
11359 if (along != (unsigned long)123)
11361 if (aint != (unsigned int)123)
11363 if (ashort != (unsigned short)123)
11370 if eval $compile_ok; then
11374 echo "(I can't seem to compile the test program--assuming it can't)"
11377 case "$castflags" in
11379 echo "Yup, it can."
11382 echo "Nope, it can't."
11389 : see if vprintf exists
11391 if set vprintf val -f d_vprintf; eval $csym; $val; then
11392 echo 'vprintf() found.' >&4
11395 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11396 #$i_varargs I_VARARGS
11398 #$i_stdlib I_STDLIB
11399 #$i_unistd I_UNISTD
11402 # include <stdarg.h>
11403 #else /* I_VARARGS */
11404 # include <varargs.h>
11408 # include <unistd.h>
11412 # include <stdlib.h>
11415 #include <stdio.h> /* vsprintf prototype */
11418 void xxx(int n, ...)
11423 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11425 int main() { xxx(1, "foo"); }
11427 #else /* I_VARARGS */
11435 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11437 int main() { xxx("foo"); }
11443 if eval $compile_ok; then
11444 if $run ./try; then
11445 echo "Your vsprintf() returns (int)." >&4
11448 echo "Your vsprintf() returns (char*)." >&4
11452 echo 'I am unable to compile the vsprintf() test program.' >&4
11453 # We shouldn't get here. If we do, assume the standard signature,
11454 # not the old BSD one.
11455 echo 'Guessing that vsprintf() returns (int).' >&4
11459 echo 'vprintf() NOT found.' >&4
11470 : see if chown exists
11474 : see if chroot exists
11475 set chroot d_chroot
11478 : see if chsize exists
11479 set chsize d_chsize
11482 : see if class exists
11486 : see if clearenv exists
11487 set clearenv d_clearenv
11490 : Define hasstruct macro for Configure internal use
11491 hasstruct='varname=$1; struct=$2; shift; shift;
11492 while $test $# -ge 2; do
11494 $define) echo "#include <$2>";;
11498 echo "int main () { struct $struct foo; }" >> try.c;
11500 if eval $compile; then
11509 : see whether socket exists
11513 $echo $n "Hmm... $c" >&4
11514 if set socket val -f d_socket; eval $csym; $val; then
11515 echo "Looks like you have Berkeley networking support." >&4
11517 if set setsockopt val -f; eval $csym; $val; then
11520 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11521 d_oldsock="$define"
11524 if $contains socklib libc.list >/dev/null 2>&1; then
11525 echo "Looks like you have Berkeley networking support." >&4
11527 : we will have to assume that it supports the 4.2 BSD interface
11530 echo "You don't have Berkeley networking in libc$_a..." >&4
11531 if test "X$d_socket" = "X$define"; then
11532 echo "...but you seem to believe that you have sockets." >&4
11534 for net in net socket
11536 if test -f $sysroot/usr/lib/lib$net$_a; then
11537 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11538 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11539 if $contains socket libc.list >/dev/null 2>&1; then
11544 echo "...but the Wollongong group seems to have hacked it in." >&4
11545 sockethdr="-I$sysroot/usr/netinclude"
11548 echo "Found Berkeley sockets interface in lib$net." >&4
11549 if $contains setsockopt libc.list >/dev/null 2>&1; then
11552 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11553 d_oldsock="$define"
11559 if test "X$d_socket" != "X$define"; then
11560 echo "or anywhere else I see." >&4
11568 : see if socketpair exists
11569 set socketpair d_sockpair
11574 echo "Checking the availability sa_len in the sock struct ..." >&4
11576 #include <sys/types.h>
11577 #include <sys/socket.h>
11579 struct sockaddr sa;
11580 return (sa.sa_len);
11584 set try; if eval $compile; then
11587 set d_sockaddr_sa_len; eval $setvar
11591 echo "Checking the availability struct sockaddr_in6 ..." >&4
11593 #include <sys/types.h>
11594 #include <sys/socket.h>
11595 #include <netinet/in.h>
11597 struct sockaddr_in6 sin6;
11598 return (sin6.sin6_family);
11602 set try; if eval $compile; then
11605 set d_sockaddr_in6; eval $setvar
11609 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11611 #include <sys/types.h>
11612 #include <sys/socket.h>
11613 #include <netinet/in.h>
11615 struct sockaddr_in6 sin6;
11616 return (sin6.sin6_scope_id);
11620 set try; if eval $compile; then
11623 set d_sin6_scope_id; eval $setvar
11627 echo "Checking the availability struct ip_mreq ..." >&4
11629 #include <sys/types.h>
11630 #include <sys/socket.h>
11631 #include <netinet/in.h>
11633 struct ip_mreq mreq;
11634 return (mreq.imr_multiaddr.s_addr);
11638 set try; if eval $compile; then
11641 set d_ip_mreq; eval $setvar
11645 echo "Checking the availability struct ip_mreq_source ..." >&4
11647 #include <sys/types.h>
11648 #include <sys/socket.h>
11649 #include <netinet/in.h>
11651 struct ip_mreq_source mreq;
11652 return (mreq.imr_multiaddr.s_addr);
11656 set try; if eval $compile; then
11659 set d_ip_mreq_source; eval $setvar
11663 echo "Checking the availability struct ipv6_mreq ..." >&4
11665 #include <sys/types.h>
11666 #include <sys/socket.h>
11667 #include <netinet/in.h>
11669 struct ipv6_mreq mreq;
11670 return (mreq.ipv6mr_interface);
11674 set try; if eval $compile; then
11677 set d_ipv6_mreq; eval $setvar
11681 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11683 #include <sys/types.h>
11684 #include <sys/socket.h>
11685 #include <netinet/in.h>
11687 struct ipv6_mreq_source mreq;
11688 return (mreq.imr_multiaddr.s_addr);
11692 set try; if eval $compile; then
11695 set d_ipv6_mreq_source; eval $setvar
11699 echo "Checking the availability of certain socket constants..." >&4
11700 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11701 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11703 #include <sys/types.h>
11704 #include <sys/socket.h>
11710 set try; if eval $compile; then
11713 set d_${enum}; eval $setvar
11717 : see if this is a sys/uio.h system
11718 set sys/uio.h i_sysuio
11721 : Check for cmsghdr support
11723 echo "Checking to see if your system supports struct cmsghdr..." >&4
11724 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11726 case "$d_cmsghdr_s" in
11727 "$define") echo "Yes, it does." ;;
11728 *) echo "No, it doesn't." ;;
11732 : check for const keyword
11734 echo 'Checking to see if your C compiler knows about "const"...' >&4
11735 $cat >const.c <<'EOCP'
11736 typedef struct spug { int drokk; } spug;
11740 const spug y = { 0 };
11743 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11745 echo "Yup, it does."
11748 echo "Nope, it doesn't."
11753 : see if copysignl exists
11754 set copysignl d_copysignl
11757 : see if crypt exists
11762 $define) cryptlib='' ;;
11763 *) if set crypt val -f d_crypt; eval $csym; $val; then
11764 echo 'crypt() found.' >&4
11768 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11769 if $test -z "$cryptlib"; then
11770 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11774 if $test -z "$cryptlib"; then
11775 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11779 if $test -z "$cryptlib"; then
11780 cryptlib=`./loc libcrypt$_a "" $libpth`
11784 if $test -z "$cryptlib"; then
11785 echo 'crypt() NOT found.' >&4
11796 : see if this is a crypt.h system
11797 set crypt.h i_crypt
11800 : see if crypt_r exists
11801 set crypt_r d_crypt_r
11803 case "$d_crypt_r" in
11805 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11806 case "$d_crypt_r_proto:$usethreads" in
11807 ":define") d_crypt_r_proto=define
11808 set d_crypt_r_proto crypt_r $hdrs
11812 case "$d_crypt_r_proto" in
11814 case "$crypt_r_proto" in
11815 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11816 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11818 case "$crypt_r_proto" in
11819 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11820 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11822 case "$crypt_r_proto" in
11823 ''|0) d_crypt_r=undef
11825 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11826 * ) case "$crypt_r_proto" in
11827 REENTRANT_PROTO*) ;;
11828 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11830 echo "Prototype: $try" ;;
11833 *) case "$usethreads" in
11834 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11845 : get csh whereabouts
11847 'csh') val="$undef" ;;
11848 *) val="$define" ;;
11852 : Respect a hint or command line value for full_csh.
11853 case "$full_csh" in
11854 '') full_csh=$csh ;;
11857 : see if ctermid exists
11858 set ctermid d_ctermid
11861 : see if ctermid_r exists
11862 set ctermid_r d_ctermid_r
11864 case "$d_ctermid_r" in
11866 hdrs="$i_systypes sys/types.h define stdio.h "
11867 case "$d_ctermid_r_proto:$usethreads" in
11868 ":define") d_ctermid_r_proto=define
11869 set d_ctermid_r_proto ctermid_r $hdrs
11873 case "$d_ctermid_r_proto" in
11875 case "$ctermid_r_proto" in
11876 ''|0) try='char* ctermid_r(char*);'
11877 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11879 case "$ctermid_r_proto" in
11880 ''|0) d_ctermid_r=undef
11882 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11883 * ) case "$ctermid_r_proto" in
11884 REENTRANT_PROTO*) ;;
11885 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11887 echo "Prototype: $try" ;;
11890 *) case "$usethreads" in
11891 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11898 *) ctermid_r_proto=0
11902 : see if ctime_r exists
11903 set ctime_r d_ctime_r
11905 case "$d_ctime_r" in
11907 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11908 case "$d_ctime_r_proto:$usethreads" in
11909 ":define") d_ctime_r_proto=define
11910 set d_ctime_r_proto ctime_r $hdrs
11914 case "$d_ctime_r_proto" in
11916 case "$ctime_r_proto" in
11917 ''|0) try='char* ctime_r(const time_t*, char*);'
11918 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11920 case "$ctime_r_proto" in
11921 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11922 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11924 case "$ctime_r_proto" in
11925 ''|0) try='int ctime_r(const time_t*, char*);'
11926 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11928 case "$ctime_r_proto" in
11929 ''|0) try='int ctime_r(const time_t*, char*, int);'
11930 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11932 case "$ctime_r_proto" in
11933 ''|0) d_ctime_r=undef
11935 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11936 * ) case "$ctime_r_proto" in
11937 REENTRANT_PROTO*) ;;
11938 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11940 echo "Prototype: $try" ;;
11943 *) case "$usethreads" in
11944 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11955 : see if cuserid exists
11956 set cuserid d_cuserid
11959 : see if this is a limits.h system
11960 set limits.h i_limits
11963 : see if this is a float.h system
11964 set float.h i_float
11967 : See if number of significant digits in a double precision number is known
11969 $cat >dbl_dig.c <<EOM
11970 #$i_limits I_LIMITS
11973 #include <limits.h>
11979 printf("Contains DBL_DIG");
11982 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11983 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11984 echo "DBL_DIG found." >&4
11987 echo "DBL_DIG NOT found." >&4
11994 : see if dbm.h is available
11995 : see if dbmclose exists
11996 set dbmclose d_dbmclose
11999 case "$d_dbmclose" in
12009 *) set rpcsvc/dbm.h i_rpcsvcdbm
12014 *) echo "We won't be including <dbm.h>"
12024 : see if prototype for dbminit is available
12026 set d_dbminitproto dbminit $i_dbm dbm.h
12029 : see if difftime exists
12030 set difftime d_difftime
12033 : see if this is a dirent system
12035 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12037 echo "<dirent.h> found." >&4
12040 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12041 echo "<sys/dir.h> found." >&4
12044 xinc=`./findhdr sys/ndir.h`
12046 echo "<dirent.h> NOT found." >&4
12051 : Look for type of directory structure.
12053 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12055 case "$direntrytype" in
12057 case "$i_dirent" in
12058 $define) guess1='struct dirent' ;;
12059 *) guess1='struct direct' ;;
12062 *) guess1="$direntrytype"
12067 'struct dirent') guess2='struct direct' ;;
12068 *) guess2='struct dirent' ;;
12071 if $contains "$guess1" try.c >/dev/null 2>&1; then
12072 direntrytype="$guess1"
12073 echo "Your directory entries are $direntrytype." >&4
12074 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12075 direntrytype="$guess2"
12076 echo "Your directory entries seem to be $direntrytype." >&4
12078 echo "I don't recognize your system's directory entries." >&4
12079 rp="What type is used for directory entries on this system?"
12082 direntrytype="$ans"
12086 : see if the directory entry stores field length
12088 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12089 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12090 echo "Good, your directory entry keeps length information in d_namlen." >&4
12093 echo "Your directory entry does not know about the d_namlen field." >&4
12100 : Look for DIR.dd_fd
12101 case "$i_dirent" in
12103 echo "Checking to see if DIR has a dd_fd member variable" >&4
12105 #$i_stdlib I_STDLIB
12107 #include <stdlib.h>
12109 #include <dirent.h>
12119 if eval $compile; then
12120 echo "Yes, it does."
12123 echo "No, it does not."
12128 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12136 : see if this is an sysdir system
12137 set sys/dir.h i_sysdir
12140 : see if this is an sysndir system
12141 set sys/ndir.h i_sysndir
12146 $cat >dirfd.c <<EOM
12148 #$i_stdlib I_STDLIB
12150 #include <stdlib.h>
12152 #$i_dirent I_DIRENT /**/
12153 #$i_sysdir I_SYS_DIR /**/
12154 #$i_sysndir I_SYS_NDIR /**/
12155 #$i_systypes I_SYS_TYPES /**/
12156 #if defined(I_SYS_TYPES)
12157 #include <sys/types.h>
12159 #if defined(I_DIRENT)
12160 #include <dirent.h>
12163 #include <sys/ndir.h>
12167 #include <ndir.h> /* may be wrong in the future */
12169 #include <sys/dir.h>
12175 DIR *dirp = opendir(".");
12176 if (dirfd(dirp) >= 0)
12184 if eval $compile; then
12188 $define) echo "dirfd() found." >&4 ;;
12189 *) echo "dirfd() NOT found." >&4 ;;
12195 : see if dladdr exists
12196 set dladdr d_dladdr
12199 : see if dlerror exists
12202 set dlerror d_dlerror
12206 : see if dlfcn is available
12207 set dlfcn.h i_dlfcn
12210 : Check what extension to use for shared libs
12215 On a few systems, the dynamically loaded modules that perl generates and uses
12216 will need a different extension than shared libs. The default will probably
12222 *) dflt="$dlext" ;;
12224 rp='What is the extension of dynamically loaded modules'
12233 : Check if dlsym need a leading underscore
12239 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12240 $cat >dyna.c <<'EOM'
12247 #$i_stdlib I_STDLIB
12249 #include <stdlib.h>
12253 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12255 #include <sys/types.h>
12260 extern int fred() ;
12269 int mode = RTLD_LAZY ;
12271 handle = dlopen("./dyna.$dlext", mode) ;
12272 if (handle == NULL) {
12277 symbol = dlsym(handle, "fred") ;
12278 if (symbol == NULL) {
12279 /* try putting a leading underscore */
12280 symbol = dlsym(handle, "_fred") ;
12281 if (symbol == NULL) {
12294 : Call the object file tmp-dyna.o in case dlext=o.
12295 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12296 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12297 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12298 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12301 1) echo "Test program failed using dlopen." >&4
12302 echo "Perhaps you should not use dynamic loading." >&4;;
12303 2) echo "Test program failed using dlsym." >&4
12304 echo "Perhaps you should not use dynamic loading." >&4;;
12305 3) echo "dlsym needs a leading underscore" >&4
12307 4) echo "dlsym doesn't need a leading underscore." >&4;;
12310 echo "I can't compile and run the test program." >&4
12311 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12316 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12321 : see if drand48_r exists
12322 set drand48_r d_drand48_r
12324 case "$d_drand48_r" in
12326 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12327 case "$d_drand48_r_proto:$usethreads" in
12328 ":define") d_drand48_r_proto=define
12329 set d_drand48_r_proto drand48_r $hdrs
12333 case "$d_drand48_r_proto" in
12335 case "$drand48_r_proto" in
12336 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12337 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12339 case "$drand48_r_proto" in
12340 ''|0) d_drand48_r=undef
12342 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12343 * ) case "$drand48_r_proto" in
12344 REENTRANT_PROTO*) ;;
12345 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12347 echo "Prototype: $try" ;;
12350 *) case "$usethreads" in
12351 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12358 *) drand48_r_proto=0
12362 : see if prototype for drand48 is available
12364 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12367 : see if dup2 exists
12371 : see if eaccess exists
12372 set eaccess d_eaccess
12375 : see if endgrent exists
12376 set endgrent d_endgrent
12379 : see if this is an grp system
12385 xxx=`./findhdr grp.h`
12386 $cppstdin $cppflags $cppminus < $xxx >$$.h
12388 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12400 set d_grpasswd; eval $setvar
12404 : see if endgrent_r exists
12405 set endgrent_r d_endgrent_r
12407 case "$d_endgrent_r" in
12409 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12410 case "$d_endgrent_r_proto:$usethreads" in
12411 ":define") d_endgrent_r_proto=define
12412 set d_endgrent_r_proto endgrent_r $hdrs
12416 case "$d_endgrent_r_proto" in
12418 case "$endgrent_r_proto" in
12419 ''|0) try='int endgrent_r(FILE**);'
12420 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12422 case "$endgrent_r_proto" in
12423 ''|0) try='void endgrent_r(FILE**);'
12424 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12426 case "$endgrent_r_proto" in
12427 ''|0) d_endgrent_r=undef
12429 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12430 * ) case "$endgrent_r_proto" in
12431 REENTRANT_PROTO*) ;;
12432 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12434 echo "Prototype: $try" ;;
12437 *) case "$usethreads" in
12438 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12445 *) endgrent_r_proto=0
12449 : see if endhostent exists
12450 set endhostent d_endhent
12453 : see if this is a netdb.h system
12454 set netdb.h i_netdb
12457 : see if endhostent_r exists
12458 set endhostent_r d_endhostent_r
12460 case "$d_endhostent_r" in
12462 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12463 case "$d_endhostent_r_proto:$usethreads" in
12464 ":define") d_endhostent_r_proto=define
12465 set d_endhostent_r_proto endhostent_r $hdrs
12469 case "$d_endhostent_r_proto" in
12471 case "$endhostent_r_proto" in
12472 ''|0) try='int endhostent_r(struct hostent_data*);'
12473 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12475 case "$endhostent_r_proto" in
12476 ''|0) try='void endhostent_r(struct hostent_data*);'
12477 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12479 case "$endhostent_r_proto" in
12480 ''|0) d_endhostent_r=undef
12481 endhostent_r_proto=0
12482 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12483 * ) case "$endhostent_r_proto" in
12484 REENTRANT_PROTO*) ;;
12485 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12487 echo "Prototype: $try" ;;
12490 *) case "$usethreads" in
12491 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12493 d_endhostent_r=undef
12494 endhostent_r_proto=0
12498 *) endhostent_r_proto=0
12502 : see if endnetent exists
12503 set endnetent d_endnent
12506 : see if endnetent_r exists
12507 set endnetent_r d_endnetent_r
12509 case "$d_endnetent_r" in
12511 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12512 case "$d_endnetent_r_proto:$usethreads" in
12513 ":define") d_endnetent_r_proto=define
12514 set d_endnetent_r_proto endnetent_r $hdrs
12518 case "$d_endnetent_r_proto" in
12520 case "$endnetent_r_proto" in
12521 ''|0) try='int endnetent_r(struct netent_data*);'
12522 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12524 case "$endnetent_r_proto" in
12525 ''|0) try='void endnetent_r(struct netent_data*);'
12526 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12528 case "$endnetent_r_proto" in
12529 ''|0) d_endnetent_r=undef
12530 endnetent_r_proto=0
12531 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12532 * ) case "$endnetent_r_proto" in
12533 REENTRANT_PROTO*) ;;
12534 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12536 echo "Prototype: $try" ;;
12539 *) case "$usethreads" in
12540 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12542 d_endnetent_r=undef
12543 endnetent_r_proto=0
12547 *) endnetent_r_proto=0
12551 : see if endprotoent exists
12552 set endprotoent d_endpent
12555 : see if endprotoent_r exists
12556 set endprotoent_r d_endprotoent_r
12558 case "$d_endprotoent_r" in
12560 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12561 case "$d_endprotoent_r_proto:$usethreads" in
12562 ":define") d_endprotoent_r_proto=define
12563 set d_endprotoent_r_proto endprotoent_r $hdrs
12567 case "$d_endprotoent_r_proto" in
12569 case "$endprotoent_r_proto" in
12570 ''|0) try='int endprotoent_r(struct protoent_data*);'
12571 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12573 case "$endprotoent_r_proto" in
12574 ''|0) try='void endprotoent_r(struct protoent_data*);'
12575 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12577 case "$endprotoent_r_proto" in
12578 ''|0) d_endprotoent_r=undef
12579 endprotoent_r_proto=0
12580 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12581 * ) case "$endprotoent_r_proto" in
12582 REENTRANT_PROTO*) ;;
12583 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12585 echo "Prototype: $try" ;;
12588 *) case "$usethreads" in
12589 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12591 d_endprotoent_r=undef
12592 endprotoent_r_proto=0
12596 *) endprotoent_r_proto=0
12600 : see if endpwent exists
12601 set endpwent d_endpwent
12604 : see if this is a pwd.h system
12610 xxx=`./findhdr pwd.h`
12611 $cppstdin $cppflags $cppminus < $xxx >$$.h
12613 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12621 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12629 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12637 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12645 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12653 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12661 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12669 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12681 set d_pwquota; eval $setvar
12682 set d_pwage; eval $setvar
12683 set d_pwchange; eval $setvar
12684 set d_pwclass; eval $setvar
12685 set d_pwexpire; eval $setvar
12686 set d_pwcomment; eval $setvar
12687 set d_pwgecos; eval $setvar
12688 set d_pwpasswd; eval $setvar
12692 : see if endpwent_r exists
12693 set endpwent_r d_endpwent_r
12695 case "$d_endpwent_r" in
12697 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12698 case "$d_endpwent_r_proto:$usethreads" in
12699 ":define") d_endpwent_r_proto=define
12700 set d_endpwent_r_proto endpwent_r $hdrs
12704 case "$d_endpwent_r_proto" in
12706 case "$endpwent_r_proto" in
12707 ''|0) try='int endpwent_r(FILE**);'
12708 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12710 case "$endpwent_r_proto" in
12711 ''|0) try='void endpwent_r(FILE**);'
12712 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12714 case "$endpwent_r_proto" in
12715 ''|0) d_endpwent_r=undef
12717 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12718 * ) case "$endpwent_r_proto" in
12719 REENTRANT_PROTO*) ;;
12720 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12722 echo "Prototype: $try" ;;
12725 *) case "$usethreads" in
12726 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12733 *) endpwent_r_proto=0
12737 : see if endservent exists
12738 set endservent d_endsent
12741 : see if endservent_r exists
12742 set endservent_r d_endservent_r
12744 case "$d_endservent_r" in
12746 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12747 case "$d_endservent_r_proto:$usethreads" in
12748 ":define") d_endservent_r_proto=define
12749 set d_endservent_r_proto endservent_r $hdrs
12753 case "$d_endservent_r_proto" in
12755 case "$endservent_r_proto" in
12756 ''|0) try='int endservent_r(struct servent_data*);'
12757 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12759 case "$endservent_r_proto" in
12760 ''|0) try='void endservent_r(struct servent_data*);'
12761 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12763 case "$endservent_r_proto" in
12764 ''|0) d_endservent_r=undef
12765 endservent_r_proto=0
12766 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12767 * ) case "$endservent_r_proto" in
12768 REENTRANT_PROTO*) ;;
12769 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12771 echo "Prototype: $try" ;;
12774 *) case "$usethreads" in
12775 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12777 d_endservent_r=undef
12778 endservent_r_proto=0
12782 *) endservent_r_proto=0
12786 : Locate the flags for 'open()'
12789 #include <sys/types.h>
12794 #include <sys/file.h>
12796 #$i_stdlib I_STDLIB
12798 #include <stdlib.h>
12809 : check sys/file.h first to get FREAD on Sun
12810 if $test `./findhdr sys/file.h` && \
12811 set try -DI_SYS_FILE && eval $compile; then
12813 echo "<sys/file.h> defines the O_* constants..." >&4
12814 if $run ./try; then
12815 echo "and you have the 3 argument form of open()." >&4
12818 echo "but not the 3 argument form of open(). Oh, well." >&4
12821 elif $test `./findhdr fcntl.h` && \
12822 set try -DI_FCNTL && eval $compile; then
12824 echo "<fcntl.h> defines the O_* constants..." >&4
12825 if $run ./try; then
12826 echo "and you have the 3 argument form of open()." >&4
12829 echo "but not the 3 argument form of open(). Oh, well." >&4
12834 echo "I can't find the O_* constant definitions! You got problems." >&4
12840 : see if this is a sys/file.h system
12845 : do we need to include sys/file.h ?
12849 if $h_sysfile; then
12851 echo "We'll be including <sys/file.h>." >&4
12854 echo "We won't be including <sys/file.h>." >&4
12864 : see if fcntl.h is there
12869 : see if we can include fcntl.h
12875 echo "We'll be including <fcntl.h>." >&4
12878 if $h_sysfile; then
12879 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12881 echo "We won't be including <fcntl.h>." >&4
12893 : see if fork exists
12897 : see if pipe exists
12901 : check for non-blocking I/O stuff
12902 case "$h_sysfile" in
12903 true) echo "#include <sys/file.h>" > head.c;;
12906 true) echo "#include <fcntl.h>" > head.c;;
12907 *) echo "#include <sys/fcntl.h>" > head.c;;
12912 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12913 case "$o_nonblock" in
12915 $cat head.c > try.c
12916 $cat >>try.c <<EOCP
12918 #$i_stdlib I_STDLIB
12920 #include <stdlib.h>
12928 printf("O_NONBLOCK\n");
12932 printf("O_NDELAY\n");
12936 printf("FNDELAY\n");
12943 if eval $compile_ok; then
12944 o_nonblock=`$run ./try`
12945 case "$o_nonblock" in
12946 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12947 *) echo "Seems like we can use $o_nonblock.";;
12950 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12953 *) echo "Using $hint value $o_nonblock.";;
12958 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12961 case "$d_fork:$d_pipe" in
12963 $cat head.c > try.c
12964 $cat >>try.c <<EOCP
12966 #include <sys/types.h>
12967 #include <signal.h>
12969 #$i_stdlib I_STDLIB
12971 #include <stdlib.h>
12977 #define MY_O_NONBLOCK $o_nonblock
12978 #ifndef errno /* XXX need better Configure test */
12981 #$i_unistd I_UNISTD
12983 #include <unistd.h>
12985 #$i_string I_STRING
12987 #include <string.h>
12989 #include <strings.h>
12991 $signal_t blech(int x) { exit(3); }
12993 $cat >> try.c <<'EOCP'
13002 ret = pipe(pd); /* Down: child -> parent */
13005 ret = pipe(pu); /* Up: parent -> child */
13009 close(pd[1]); /* Parent reads from pd[0] */
13010 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13012 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13017 signal(SIGALRM, blech);
13019 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13021 sprintf(string, "%d\n", ret);
13022 ret = write(2, string, strlen(string));
13023 if (ret != strlen(string))
13027 if (errno == EAGAIN) {
13028 printf("EAGAIN\n");
13033 if (errno == EWOULDBLOCK)
13034 printf("EWOULDBLOCK\n");
13037 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13040 sleep(2); /* Give it time to close our pipe */
13042 ret = read(pd[0], buf, 1); /* Should read EOF */
13044 sprintf(string, "%d\n", ret);
13045 ret = write(4, string, strlen(string));
13046 if (ret != strlen(string))
13051 close(pd[0]); /* We write to pd[1] */
13052 close(pu[1]); /* We read from pu[0] */
13053 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13056 close(pd[1]); /* Pipe pd is now fully closed! */
13057 exit(0); /* Bye bye, thank you for playing! */
13061 if eval $compile_ok; then
13062 echo "$startsh" >mtry
13063 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13065 $run ./mtry >/dev/null 2>&1
13067 0) eagain=`$cat try.out`;;
13068 1) echo "Could not perform non-blocking setting!";;
13069 2) echo "I did a successful read() for something that was not there!";;
13070 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13071 4) echo "Could not find F_SETFL!";;
13072 *) echo "Something terribly wrong happened during testing.";;
13074 rd_nodata=`$cat try.ret`
13075 echo "A read() system call with no data present returns $rd_nodata."
13076 case "$rd_nodata" in
13079 echo "(That's peculiar, fixing that to be -1.)"
13085 echo "Forcing errno EAGAIN on read() with no data available."
13089 echo "Your read() sets errno to $eagain when no data is available."
13092 status=`$cat try.err`
13094 0) echo "And it correctly returns 0 to signal EOF.";;
13095 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13096 *) echo "However, your read() returns '$status' on EOF??";;
13099 if test "$status" = "$rd_nodata"; then
13100 echo "WARNING: you can't distinguish between EOF and no data!"
13104 echo "I can't compile the test program--assuming errno EAGAIN will do."
13108 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13117 echo "Using $hint value $eagain."
13118 echo "Your read() returns $rd_nodata when no data is present."
13119 case "$d_eofnblk" in
13120 "$define") echo "And you can see EOF because read() returns 0.";;
13121 "$undef") echo "But you can't see EOF status from read() returned value.";;
13123 echo "(Assuming you can't see EOF status from read anyway.)"
13129 $rm_try head.c mtry
13131 : see if _ptr and _cnt from stdio act std
13134 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13135 echo "(Looks like you have stdio.h from BSD.)"
13136 case "$stdio_ptr" in
13137 '') stdio_ptr='((fp)->_p)'
13140 *) ptr_lval=$d_stdio_ptr_lval;;
13142 case "$stdio_cnt" in
13143 '') stdio_cnt='((fp)->_r)'
13146 *) cnt_lval=$d_stdio_cnt_lval;;
13148 case "$stdio_base" in
13149 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13151 case "$stdio_bufsiz" in
13152 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13154 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13155 echo "(Looks like you have stdio.h from Linux.)"
13156 case "$stdio_ptr" in
13157 '') stdio_ptr='((fp)->_IO_read_ptr)'
13160 *) ptr_lval=$d_stdio_ptr_lval;;
13162 case "$stdio_cnt" in
13163 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13166 *) cnt_lval=$d_stdio_cnt_lval;;
13168 case "$stdio_base" in
13169 '') stdio_base='((fp)->_IO_read_base)';;
13171 case "$stdio_bufsiz" in
13172 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13175 case "$stdio_ptr" in
13176 '') stdio_ptr='((fp)->_ptr)'
13179 *) ptr_lval=$d_stdio_ptr_lval;;
13181 case "$stdio_cnt" in
13182 '') stdio_cnt='((fp)->_cnt)'
13185 *) cnt_lval=$d_stdio_cnt_lval;;
13187 case "$stdio_base" in
13188 '') stdio_base='((fp)->_base)';;
13190 case "$stdio_bufsiz" in
13191 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13195 : test whether _ptr and _cnt really work
13196 echo "Checking how std your stdio is..." >&4
13199 #$i_stdlib I_STDLIB
13201 #include <stdlib.h>
13203 #define FILE_ptr(fp) $stdio_ptr
13204 #define FILE_cnt(fp) $stdio_cnt
13206 FILE *fp = fopen("try.c", "r");
13209 18 <= FILE_cnt(fp) &&
13210 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13218 if eval $compile && $to try.c; then
13219 if $run ./try; then
13220 echo "Your stdio acts pretty std."
13223 echo "Your stdio isn't very std."
13226 echo "Your stdio doesn't appear very std."
13230 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13231 # direct buffer manipulation no longer works. The Configure tests
13232 # should be changed to correctly detect this, but until then,
13233 # the following check should at least let perl compile and run.
13234 # (This quick fix should be updated before 5.8.1.)
13235 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13236 # A. Dougherty, June 3, 2002.
13237 case "$d_gnulibc" in
13239 case "$gnulibc_version" in
13243 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13252 : Can _ptr be used as an lvalue?
13253 case "$d_stdstdio$ptr_lval" in
13254 $define$define) val=$define ;;
13257 set d_stdio_ptr_lval
13260 : Can _cnt be used as an lvalue?
13261 case "$d_stdstdio$cnt_lval" in
13262 $define$define) val=$define ;;
13265 set d_stdio_cnt_lval
13269 : test whether setting _ptr sets _cnt as a side effect
13270 d_stdio_ptr_lval_sets_cnt="$undef"
13271 d_stdio_ptr_lval_nochange_cnt="$undef"
13272 case "$d_stdio_ptr_lval$d_stdstdio" in
13274 echo "Checking to see what happens if we set the stdio ptr..." >&4
13277 /* Can we scream? */
13278 /* Eat dust sed :-) */
13279 /* In the buffer space, no one can hear you scream. */
13280 #$i_stdlib I_STDLIB
13282 #include <stdlib.h>
13284 #define FILE_ptr(fp) $stdio_ptr
13285 #define FILE_cnt(fp) $stdio_cnt
13286 #include <sys/types.h>
13288 FILE *fp = fopen("try.c", "r");
13293 puts("Fail even to read");
13296 c = getc(fp); /* Read away the first # */
13298 puts("Fail even to read");
13302 18 <= FILE_cnt(fp) &&
13303 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13305 puts("Fail even to read");
13308 ptr = (char*) FILE_ptr(fp);
13309 cnt = (size_t)FILE_cnt(fp);
13311 FILE_ptr(fp) += 42;
13313 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13314 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13317 if (FILE_cnt(fp) <= 20) {
13318 printf ("Fail (<20 chars to test)");
13321 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13322 puts("Fail compare");
13325 if (cnt == FILE_cnt(fp)) {
13326 puts("Pass_unchanged");
13329 if (FILE_cnt(fp) == (cnt - 42)) {
13330 puts("Pass_changed");
13333 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13339 if eval $compile && $to try.c; then
13340 case `$run ./try` in
13342 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13343 d_stdio_ptr_lval_sets_cnt="$define" ;;
13345 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13346 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13348 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13350 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13353 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13359 : see if _base is also standard
13361 case "$d_stdstdio" in
13365 #$i_stdlib I_STDLIB
13367 #include <stdlib.h>
13369 #define FILE_base(fp) $stdio_base
13370 #define FILE_bufsiz(fp) $stdio_bufsiz
13372 FILE *fp = fopen("try.c", "r");
13375 19 <= FILE_bufsiz(fp) &&
13376 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13383 if eval $compile && $to try.c; then
13384 if $run ./try; then
13385 echo "And its _base field acts std."
13388 echo "But its _base field isn't std."
13391 echo "However, it seems to be lacking the _base field."
13399 : see if fast_stdio exists
13401 case "$d_stdstdio:$d_stdio_ptr_lval" in
13403 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13405 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13416 : see if fchdir exists
13417 set fchdir d_fchdir
13420 : see if fchmod exists
13421 set fchmod d_fchmod
13424 : see if fchown exists
13425 set fchown d_fchown
13428 : see if this is an fcntl system
13432 : See if fcntl-based locking works.
13435 #$i_stdlib I_STDLIB
13437 #include <stdlib.h>
13439 #include <unistd.h>
13441 #include <signal.h>
13442 $signal_t blech(int x) { exit(3); }
13444 #if defined(F_SETLK) && defined(F_SETLKW)
13445 struct flock flock;
13447 fd = open("try.c", O_RDONLY);
13448 flock.l_type = F_RDLCK;
13449 flock.l_whence = SEEK_SET;
13450 flock.l_start = flock.l_len = 0;
13451 signal(SIGALRM, blech);
13453 retval = fcntl(fd, F_SETLK, &flock);
13455 (retval < 0 ? exit(2) : exit(0));
13461 echo "Checking if fcntl-based file locking works... "
13465 if eval $compile_ok; then
13466 if $run ./try; then
13467 echo "Yes, it seems to work."
13470 echo "Nope, it didn't work."
13475 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13476 *** This is (almost) impossible.
13477 *** If your NFS lock daemons are not feeling well, something like
13478 *** this may happen, please investigate. Cannot continue, aborting.
13486 echo "I'm unable to compile the test program, so I'll assume not."
13491 echo "Nope, since you don't even have fcntl()."
13494 set d_fcntl_can_lock
13498 : check for fd_set items
13501 Checking to see how well your C compiler handles fd_set and friends ...
13504 #$i_stdlib I_STDLIB
13506 #include <stdlib.h>
13508 #$i_systime I_SYS_TIME
13509 #$i_sysselct I_SYS_SELECT
13510 #$d_socket HAS_SOCKET
13511 #include <sys/types.h>
13513 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13516 #include <sys/time.h>
13518 #ifdef I_SYS_SELECT
13519 #include <sys/select.h>
13528 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13536 if eval $compile; then
13537 d_fds_bits="$define"
13539 echo "Well, your system knows about the normal fd_set typedef..." >&4
13540 if $run ./try; then
13541 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13542 d_fd_macros="$define"
13545 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13547 d_fd_macros="$undef"
13551 Hmm, your compiler has some difficulty with fd_set. Checking further...
13554 if eval $compile; then
13555 d_fds_bits="$undef"
13557 echo "Well, your system has some sort of fd_set available..." >&4
13558 if $run ./try; then
13559 echo "and you have the normal fd_set macros." >&4
13560 d_fd_macros="$define"
13563 but not the normal fd_set macros! Gross! More work for me...
13565 d_fd_macros="$undef"
13568 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13570 d_fds_bits="$undef"
13571 d_fd_macros="$undef"
13576 : see if fgetpos exists
13577 set fgetpos d_fgetpos
13580 : see if finite exists
13581 set finite d_finite
13584 : see if finitel exists
13585 set finitel d_finitel
13588 : see if flock exists
13592 : see if prototype for flock is available
13594 set d_flockproto flock $i_sysfile sys/file.h
13597 : see if fp_class exists
13598 set fp_class d_fp_class
13601 : see if pathconf exists
13602 set pathconf d_pathconf
13605 : see if fpathconf exists
13606 set fpathconf d_fpathconf
13609 : see if fpclass exists
13610 set fpclass d_fpclass
13613 : see if fpclassify exists
13614 set fpclassify d_fpclassify
13617 : see if fpclassl exists
13618 set fpclassl d_fpclassl
13621 : check for fpos64_t
13623 echo "Checking to see if you have fpos64_t..." >&4
13626 int main() { fpos64_t x = 7; }
13629 if eval $compile; then
13631 echo "You have fpos64_t."
13634 echo "You do not have fpos64_t."
13635 case "$fpossize" in
13636 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13643 : see if frexpl exists
13644 set frexpl d_frexpl
13647 : see if this is a sys/param system
13648 set sys/param.h i_sysparam
13651 : see if this is a sys/mount.h system
13652 set sys/mount.h i_sysmount
13655 : Check for fs_data_s
13657 echo "Checking to see if your system supports struct fs_data..." >&4
13658 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13660 case "$d_fs_data_s" in
13661 "$define") echo "Yes, it does." ;;
13662 *) echo "No, it doesn't." ;;
13665 : see if fseeko exists
13666 set fseeko d_fseeko
13668 case "$longsize" in
13669 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13672 : see if fsetpos exists
13673 set fsetpos d_fsetpos
13676 : see if fstatfs exists
13677 set fstatfs d_fstatfs
13680 : see if statvfs exists
13681 set statvfs d_statvfs
13684 : see if fstatvfs exists
13685 set fstatvfs d_fstatvfs
13689 : see if fsync exists
13693 : see if ftello exists
13694 set ftello d_ftello
13696 case "$longsize" in
13697 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13700 : check for a working futimes
13703 echo "Checking if you have a working futimes()" >&4
13706 #include <sys/time.h>
13713 fd = open ("try.c", O_RDWR);
13714 if (-1 == fd) exit (1);
13715 rv = futimes (fd, NULL);
13716 exit (rv == -1 ? errno : 0);
13720 if eval $compile; then
13724 0) echo "Yes, you have" >&4
13725 d_futimes="$define"
13727 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13731 echo "No, it does not (probably harmless)" >&4
13735 : see if ndbm.h is available
13738 : Compatibility location for RedHat 7.1
13739 set gdbm/ndbm.h i_gdbmndbm
13741 : Compatibility location for Debian 4.0
13742 set gdbm-ndbm.h i_gdbm_ndbm
13746 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13747 : see if dbm_open exists
13748 set dbm_open d_dbm_open
13750 case "$d_dbm_open" in
13753 i_gdbmndbm="$undef"
13754 i_gdbm_ndbm="$undef"
13755 echo "We won't be including <ndbm.h>"
13765 ndbm_hdr_protochk='name=$1; hdr=$2;
13766 eval "ihdr=\$""i_$name";
13768 if $test "$ihdr" = "$define"; then
13769 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13770 case "$d_cplusplus" in
13771 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13772 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13775 $define) $echo "Your <$hdr> seems to have prototypes";;
13776 *) $echo "Your <$hdr> does not seem to have prototypes";;
13779 set "d_${name}_h_uses_prototypes";
13783 eval $ndbm_hdr_protochk
13784 set gdbmndbm gdbm/ndbm.h
13785 eval $ndbm_hdr_protochk
13786 set gdbm_ndbm gdbm-ndbm.h
13787 eval $ndbm_hdr_protochk
13789 : see if getaddrinfo exists
13790 set getaddrinfo d_getaddrinfo
13793 : see if getcwd exists
13794 set getcwd d_getcwd
13797 : see if getespwnam exists
13798 set getespwnam d_getespwnam
13801 : see if getfsstat exists
13802 set getfsstat d_getfsstat
13805 : see if getgrent exists
13806 set getgrent d_getgrent
13809 : see if getgrent_r exists
13810 set getgrent_r d_getgrent_r
13812 case "$d_getgrent_r" in
13814 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13815 case "$d_getgrent_r_proto:$usethreads" in
13816 ":define") d_getgrent_r_proto=define
13817 set d_getgrent_r_proto getgrent_r $hdrs
13821 case "$d_getgrent_r_proto" in
13823 case "$getgrent_r_proto" in
13824 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13825 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13827 case "$getgrent_r_proto" in
13828 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13829 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13831 case "$getgrent_r_proto" in
13832 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13833 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13835 case "$getgrent_r_proto" in
13836 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13837 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13839 case "$getgrent_r_proto" in
13840 ''|0) try='int getgrent_r(struct group*, char*, int);'
13841 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13843 case "$getgrent_r_proto" in
13844 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13845 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13847 case "$getgrent_r_proto" in
13848 ''|0) d_getgrent_r=undef
13850 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13851 * ) case "$getgrent_r_proto" in
13852 REENTRANT_PROTO*) ;;
13853 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13855 echo "Prototype: $try" ;;
13858 *) case "$usethreads" in
13859 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13866 *) getgrent_r_proto=0
13870 : see if getgrgid_r exists
13871 set getgrgid_r d_getgrgid_r
13873 case "$d_getgrgid_r" in
13875 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13876 case "$d_getgrgid_r_proto:$usethreads" in
13877 ":define") d_getgrgid_r_proto=define
13878 set d_getgrgid_r_proto getgrgid_r $hdrs
13882 case "$d_getgrgid_r_proto" in
13884 case "$getgrgid_r_proto" in
13885 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13886 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13888 case "$getgrgid_r_proto" in
13889 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13890 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13892 case "$getgrgid_r_proto" in
13893 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13894 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13896 case "$getgrgid_r_proto" in
13897 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13898 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13900 case "$getgrgid_r_proto" in
13901 ''|0) d_getgrgid_r=undef
13903 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13904 * ) case "$getgrgid_r_proto" in
13905 REENTRANT_PROTO*) ;;
13906 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13908 echo "Prototype: $try" ;;
13911 *) case "$usethreads" in
13912 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13919 *) getgrgid_r_proto=0
13923 : see if getgrnam_r exists
13924 set getgrnam_r d_getgrnam_r
13926 case "$d_getgrnam_r" in
13928 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13929 case "$d_getgrnam_r_proto:$usethreads" in
13930 ":define") d_getgrnam_r_proto=define
13931 set d_getgrnam_r_proto getgrnam_r $hdrs
13935 case "$d_getgrnam_r_proto" in
13937 case "$getgrnam_r_proto" in
13938 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13939 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13941 case "$getgrnam_r_proto" in
13942 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13943 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13945 case "$getgrnam_r_proto" in
13946 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13947 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13949 case "$getgrnam_r_proto" in
13950 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13951 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13953 case "$getgrnam_r_proto" in
13954 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13955 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13957 case "$getgrnam_r_proto" in
13958 ''|0) d_getgrnam_r=undef
13960 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13961 * ) case "$getgrnam_r_proto" in
13962 REENTRANT_PROTO*) ;;
13963 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13965 echo "Prototype: $try" ;;
13968 *) case "$usethreads" in
13969 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13976 *) getgrnam_r_proto=0
13980 : see if gethostbyaddr exists
13981 set gethostbyaddr d_gethbyaddr
13984 : see if gethostbyname exists
13985 set gethostbyname d_gethbyname
13988 : see if gethostent exists
13989 set gethostent d_gethent
13992 : see how we will look up host name
13995 if set gethostname val -f d_gethname; eval $csym; $val; then
13996 echo 'gethostname() found.' >&4
13997 d_gethname="$define"
14000 if set uname val -f d_uname; eval $csym; $val; then
14003 uname() was found, but you're running xenix, and older versions of xenix
14004 have a broken uname(). If you don't really know whether your xenix is old
14005 enough to have a broken system call, use the default answer.
14010 "$define") dflt=n;;
14012 rp='Is your uname() broken?'
14015 n*) d_uname="$define"; call=uname;;
14018 echo 'uname() found.' >&4
14025 case "$d_gethname" in
14026 '') d_gethname="$undef";;
14029 '') d_uname="$undef";;
14031 case "$d_uname$d_gethname" in
14036 Every now and then someone has a $call() that lies about the hostname
14037 but can't be fixed for political or economic reasons. If you wish, I can
14038 pretend $call() isn't there and maybe compute hostname at run-time
14039 thanks to the '$phostname' command.
14042 rp="Shall I ignore $call() from now on?"
14045 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14048 case "$phostname" in
14049 '') aphostname='';;
14050 *) case "$aphostname" in
14052 *) set X $phostname
14056 file=`./loc $file $file $pth`
14057 aphostname=`echo $file $*`
14062 case "$d_uname$d_gethname" in
14065 case "$phostname" in
14067 echo "There will be no way for $package to get your hostname." >&4;;
14069 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14073 case "$d_phostname" in
14074 '') d_phostname="$undef";;
14077 : see if gethostbyaddr_r exists
14078 set gethostbyaddr_r d_gethostbyaddr_r
14080 case "$d_gethostbyaddr_r" in
14082 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14083 case "$d_gethostbyaddr_r_proto:$usethreads" in
14084 ":define") d_gethostbyaddr_r_proto=define
14085 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14089 case "$d_gethostbyaddr_r_proto" in
14091 case "$gethostbyaddr_r_proto" in
14092 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14093 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14095 case "$gethostbyaddr_r_proto" in
14096 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14097 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14099 case "$gethostbyaddr_r_proto" in
14100 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14101 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14103 case "$gethostbyaddr_r_proto" in
14104 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14105 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14107 case "$gethostbyaddr_r_proto" in
14108 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14109 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14111 case "$gethostbyaddr_r_proto" in
14112 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14113 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14115 case "$gethostbyaddr_r_proto" in
14116 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14117 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14119 case "$gethostbyaddr_r_proto" in
14120 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14121 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14123 case "$gethostbyaddr_r_proto" in
14124 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14125 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14127 case "$gethostbyaddr_r_proto" in
14128 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14129 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14131 case "$gethostbyaddr_r_proto" in
14132 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14133 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14135 case "$gethostbyaddr_r_proto" in
14136 ''|0) d_gethostbyaddr_r=undef
14137 gethostbyaddr_r_proto=0
14138 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14139 * ) case "$gethostbyaddr_r_proto" in
14140 REENTRANT_PROTO*) ;;
14141 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14143 echo "Prototype: $try" ;;
14146 *) case "$usethreads" in
14147 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14149 d_gethostbyaddr_r=undef
14150 gethostbyaddr_r_proto=0
14154 *) gethostbyaddr_r_proto=0
14158 : see if gethostbyname_r exists
14159 set gethostbyname_r d_gethostbyname_r
14161 case "$d_gethostbyname_r" in
14163 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14164 case "$d_gethostbyname_r_proto:$usethreads" in
14165 ":define") d_gethostbyname_r_proto=define
14166 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14170 case "$d_gethostbyname_r_proto" in
14172 case "$gethostbyname_r_proto" in
14173 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14174 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14176 case "$gethostbyname_r_proto" in
14177 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14178 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14180 case "$gethostbyname_r_proto" in
14181 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14182 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14184 case "$gethostbyname_r_proto" in
14185 ''|0) d_gethostbyname_r=undef
14186 gethostbyname_r_proto=0
14187 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14188 * ) case "$gethostbyname_r_proto" in
14189 REENTRANT_PROTO*) ;;
14190 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14192 echo "Prototype: $try" ;;
14195 *) case "$usethreads" in
14196 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14198 d_gethostbyname_r=undef
14199 gethostbyname_r_proto=0
14203 *) gethostbyname_r_proto=0
14207 : see if gethostent_r exists
14208 set gethostent_r d_gethostent_r
14210 case "$d_gethostent_r" in
14212 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14213 case "$d_gethostent_r_proto:$usethreads" in
14214 ":define") d_gethostent_r_proto=define
14215 set d_gethostent_r_proto gethostent_r $hdrs
14219 case "$d_gethostent_r_proto" in
14221 case "$gethostent_r_proto" in
14222 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14223 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14225 case "$gethostent_r_proto" in
14226 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14227 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14229 case "$gethostent_r_proto" in
14230 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14231 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14233 case "$gethostent_r_proto" in
14234 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14235 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14237 case "$gethostent_r_proto" in
14238 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14239 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14241 case "$gethostent_r_proto" in
14242 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14243 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14245 case "$gethostent_r_proto" in
14246 ''|0) d_gethostent_r=undef
14247 gethostent_r_proto=0
14248 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14249 * ) case "$gethostent_r_proto" in
14250 REENTRANT_PROTO*) ;;
14251 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14253 echo "Prototype: $try" ;;
14256 *) case "$usethreads" in
14257 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14259 d_gethostent_r=undef
14260 gethostent_r_proto=0
14264 *) gethostent_r_proto=0
14268 : see if prototypes for various gethostxxx netdb.h functions are available
14270 set d_gethostprotos gethostent $i_netdb netdb.h
14273 : see if getitimer exists
14274 set getitimer d_getitimer
14277 : see if getlogin exists
14278 set getlogin d_getlogin
14281 : see if getlogin_r exists
14282 set getlogin_r d_getlogin_r
14284 case "$d_getlogin_r" in
14286 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14287 case "$d_getlogin_r_proto:$usethreads" in
14288 ":define") d_getlogin_r_proto=define
14289 set d_getlogin_r_proto getlogin_r $hdrs
14293 case "$d_getlogin_r_proto" in
14295 case "$getlogin_r_proto" in
14296 ''|0) try='int getlogin_r(char*, size_t);'
14297 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14299 case "$getlogin_r_proto" in
14300 ''|0) try='int getlogin_r(char*, int);'
14301 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14303 case "$getlogin_r_proto" in
14304 ''|0) try='char* getlogin_r(char*, size_t);'
14305 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14307 case "$getlogin_r_proto" in
14308 ''|0) try='char* getlogin_r(char*, int);'
14309 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14311 case "$getlogin_r_proto" in
14312 ''|0) d_getlogin_r=undef
14314 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14315 * ) case "$getlogin_r_proto" in
14316 REENTRANT_PROTO*) ;;
14317 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14319 echo "Prototype: $try" ;;
14322 *) case "$usethreads" in
14323 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14330 *) getlogin_r_proto=0
14334 : see if getmnt exists
14335 set getmnt d_getmnt
14338 : see if getmntent exists
14339 set getmntent d_getmntent
14342 : see if getnameinfo exists
14343 set getnameinfo d_getnameinfo
14346 : see if getnetbyaddr exists
14347 set getnetbyaddr d_getnbyaddr
14350 : see if getnetbyname exists
14351 set getnetbyname d_getnbyname
14354 : see if getnetent exists
14355 set getnetent d_getnent
14358 : see if getnetbyaddr_r exists
14359 set getnetbyaddr_r d_getnetbyaddr_r
14361 case "$d_getnetbyaddr_r" in
14363 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14364 case "$d_getnetbyaddr_r_proto:$usethreads" in
14365 ":define") d_getnetbyaddr_r_proto=define
14366 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14370 case "$d_getnetbyaddr_r_proto" in
14372 case "$getnetbyaddr_r_proto" in
14373 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14374 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14376 case "$getnetbyaddr_r_proto" in
14377 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14378 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14380 case "$getnetbyaddr_r_proto" in
14381 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14382 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14384 case "$getnetbyaddr_r_proto" in
14385 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14386 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14388 case "$getnetbyaddr_r_proto" in
14389 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14390 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14392 case "$getnetbyaddr_r_proto" in
14393 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14394 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14396 case "$getnetbyaddr_r_proto" in
14397 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14398 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14400 case "$getnetbyaddr_r_proto" in
14401 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14402 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14404 case "$getnetbyaddr_r_proto" in
14405 ''|0) d_getnetbyaddr_r=undef
14406 getnetbyaddr_r_proto=0
14407 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14408 * ) case "$getnetbyaddr_r_proto" in
14409 REENTRANT_PROTO*) ;;
14410 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14412 echo "Prototype: $try" ;;
14415 *) case "$usethreads" in
14416 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14418 d_getnetbyaddr_r=undef
14419 getnetbyaddr_r_proto=0
14423 *) getnetbyaddr_r_proto=0
14427 : see if getnetbyname_r exists
14428 set getnetbyname_r d_getnetbyname_r
14430 case "$d_getnetbyname_r" in
14432 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14433 case "$d_getnetbyname_r_proto:$usethreads" in
14434 ":define") d_getnetbyname_r_proto=define
14435 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14439 case "$d_getnetbyname_r_proto" in
14441 case "$getnetbyname_r_proto" in
14442 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14443 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14445 case "$getnetbyname_r_proto" in
14446 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14447 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14449 case "$getnetbyname_r_proto" in
14450 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14451 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14453 case "$getnetbyname_r_proto" in
14454 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14455 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14457 case "$getnetbyname_r_proto" in
14458 ''|0) d_getnetbyname_r=undef
14459 getnetbyname_r_proto=0
14460 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14461 * ) case "$getnetbyname_r_proto" in
14462 REENTRANT_PROTO*) ;;
14463 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14465 echo "Prototype: $try" ;;
14468 *) case "$usethreads" in
14469 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14471 d_getnetbyname_r=undef
14472 getnetbyname_r_proto=0
14476 *) getnetbyname_r_proto=0
14480 : see if getnetent_r exists
14481 set getnetent_r d_getnetent_r
14483 case "$d_getnetent_r" in
14485 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14486 case "$d_getnetent_r_proto:$usethreads" in
14487 ":define") d_getnetent_r_proto=define
14488 set d_getnetent_r_proto getnetent_r $hdrs
14492 case "$d_getnetent_r_proto" in
14494 case "$getnetent_r_proto" in
14495 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14496 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14498 case "$getnetent_r_proto" in
14499 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14500 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14502 case "$getnetent_r_proto" in
14503 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14504 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14506 case "$getnetent_r_proto" in
14507 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14508 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14510 case "$getnetent_r_proto" in
14511 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14512 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14514 case "$getnetent_r_proto" in
14515 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14516 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14518 case "$getnetent_r_proto" in
14519 ''|0) d_getnetent_r=undef
14520 getnetent_r_proto=0
14521 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14522 * ) case "$getnetent_r_proto" in
14523 REENTRANT_PROTO*) ;;
14524 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14526 echo "Prototype: $try" ;;
14529 *) case "$usethreads" in
14530 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14532 d_getnetent_r=undef
14533 getnetent_r_proto=0
14537 *) getnetent_r_proto=0
14541 : see if prototypes for various getnetxxx netdb.h functions are available
14543 set d_getnetprotos getnetent $i_netdb netdb.h
14546 : see if getpagesize exists
14547 set getpagesize d_getpagsz
14550 : Optional checks for getprotobyname and getprotobynumber
14552 : see if getprotobyname exists
14553 set getprotobyname d_getpbyname
14556 : see if getprotobynumber exists
14557 set getprotobynumber d_getpbynumber
14560 : see if getprotoent exists
14561 set getprotoent d_getpent
14564 : see if getpgid exists
14565 set getpgid d_getpgid
14568 : see if getpgrp2 exists
14569 set getpgrp2 d_getpgrp2
14572 : see if getppid exists
14573 set getppid d_getppid
14576 : see if getpriority exists
14577 set getpriority d_getprior
14580 : see if getprotobyname_r exists
14581 set getprotobyname_r d_getprotobyname_r
14583 case "$d_getprotobyname_r" in
14585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14586 case "$d_getprotobyname_r_proto:$usethreads" in
14587 ":define") d_getprotobyname_r_proto=define
14588 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14592 case "$d_getprotobyname_r_proto" in
14594 case "$getprotobyname_r_proto" in
14595 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14596 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14598 case "$getprotobyname_r_proto" in
14599 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14600 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14602 case "$getprotobyname_r_proto" in
14603 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14604 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14606 case "$getprotobyname_r_proto" in
14607 ''|0) d_getprotobyname_r=undef
14608 getprotobyname_r_proto=0
14609 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14610 * ) case "$getprotobyname_r_proto" in
14611 REENTRANT_PROTO*) ;;
14612 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14614 echo "Prototype: $try" ;;
14617 *) case "$usethreads" in
14618 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14620 d_getprotobyname_r=undef
14621 getprotobyname_r_proto=0
14625 *) getprotobyname_r_proto=0
14629 : see if getprotobynumber_r exists
14630 set getprotobynumber_r d_getprotobynumber_r
14632 case "$d_getprotobynumber_r" in
14634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14635 case "$d_getprotobynumber_r_proto:$usethreads" in
14636 ":define") d_getprotobynumber_r_proto=define
14637 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14641 case "$d_getprotobynumber_r_proto" in
14643 case "$getprotobynumber_r_proto" in
14644 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14645 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14647 case "$getprotobynumber_r_proto" in
14648 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14649 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14651 case "$getprotobynumber_r_proto" in
14652 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14653 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14655 case "$getprotobynumber_r_proto" in
14656 ''|0) d_getprotobynumber_r=undef
14657 getprotobynumber_r_proto=0
14658 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14659 * ) case "$getprotobynumber_r_proto" in
14660 REENTRANT_PROTO*) ;;
14661 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14663 echo "Prototype: $try" ;;
14666 *) case "$usethreads" in
14667 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14669 d_getprotobynumber_r=undef
14670 getprotobynumber_r_proto=0
14674 *) getprotobynumber_r_proto=0
14678 : see if getprotoent_r exists
14679 set getprotoent_r d_getprotoent_r
14681 case "$d_getprotoent_r" in
14683 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14684 case "$d_getprotoent_r_proto:$usethreads" in
14685 ":define") d_getprotoent_r_proto=define
14686 set d_getprotoent_r_proto getprotoent_r $hdrs
14690 case "$d_getprotoent_r_proto" in
14692 case "$getprotoent_r_proto" in
14693 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14694 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14696 case "$getprotoent_r_proto" in
14697 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14698 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14700 case "$getprotoent_r_proto" in
14701 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14702 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14704 case "$getprotoent_r_proto" in
14705 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14706 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14708 case "$getprotoent_r_proto" in
14709 ''|0) d_getprotoent_r=undef
14710 getprotoent_r_proto=0
14711 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14712 * ) case "$getprotoent_r_proto" in
14713 REENTRANT_PROTO*) ;;
14714 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14716 echo "Prototype: $try" ;;
14719 *) case "$usethreads" in
14720 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14722 d_getprotoent_r=undef
14723 getprotoent_r_proto=0
14727 *) getprotoent_r_proto=0
14731 : see if prototypes for various getprotoxxx netdb.h functions are available
14733 set d_getprotoprotos getprotoent $i_netdb netdb.h
14736 : see if getprpwnam exists
14737 set getprpwnam d_getprpwnam
14740 : see if getpwent exists
14741 set getpwent d_getpwent
14744 : see if getpwent_r exists
14745 set getpwent_r d_getpwent_r
14747 case "$d_getpwent_r" in
14749 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14750 case "$d_getpwent_r_proto:$usethreads" in
14751 ":define") d_getpwent_r_proto=define
14752 set d_getpwent_r_proto getpwent_r $hdrs
14756 case "$d_getpwent_r_proto" in
14758 case "$getpwent_r_proto" in
14759 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14760 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14762 case "$getpwent_r_proto" in
14763 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14764 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14766 case "$getpwent_r_proto" in
14767 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14768 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14770 case "$getpwent_r_proto" in
14771 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14772 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14774 case "$getpwent_r_proto" in
14775 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14776 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14778 case "$getpwent_r_proto" in
14779 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14780 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14782 case "$getpwent_r_proto" in
14783 ''|0) d_getpwent_r=undef
14785 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14786 * ) case "$getpwent_r_proto" in
14787 REENTRANT_PROTO*) ;;
14788 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14790 echo "Prototype: $try" ;;
14793 *) case "$usethreads" in
14794 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14801 *) getpwent_r_proto=0
14805 : see if getpwnam_r exists
14806 set getpwnam_r d_getpwnam_r
14808 case "$d_getpwnam_r" in
14810 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14811 case "$d_getpwnam_r_proto:$usethreads" in
14812 ":define") d_getpwnam_r_proto=define
14813 set d_getpwnam_r_proto getpwnam_r $hdrs
14817 case "$d_getpwnam_r_proto" in
14819 case "$getpwnam_r_proto" in
14820 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14821 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14823 case "$getpwnam_r_proto" in
14824 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14825 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14827 case "$getpwnam_r_proto" in
14828 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14829 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14831 case "$getpwnam_r_proto" in
14832 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14833 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14835 case "$getpwnam_r_proto" in
14836 ''|0) d_getpwnam_r=undef
14838 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14839 * ) case "$getpwnam_r_proto" in
14840 REENTRANT_PROTO*) ;;
14841 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14843 echo "Prototype: $try" ;;
14846 *) case "$usethreads" in
14847 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14854 *) getpwnam_r_proto=0
14858 : see if getpwuid_r exists
14859 set getpwuid_r d_getpwuid_r
14861 case "$d_getpwuid_r" in
14863 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14864 case "$d_getpwuid_r_proto:$usethreads" in
14865 ":define") d_getpwuid_r_proto=define
14866 set d_getpwuid_r_proto getpwuid_r $hdrs
14870 case "$d_getpwuid_r_proto" in
14872 case "$getpwuid_r_proto" in
14873 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14874 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14876 case "$getpwuid_r_proto" in
14877 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14878 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14880 case "$getpwuid_r_proto" in
14881 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14882 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14884 case "$getpwuid_r_proto" in
14885 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14886 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14888 case "$getpwuid_r_proto" in
14889 ''|0) d_getpwuid_r=undef
14891 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14892 * ) case "$getpwuid_r_proto" in
14893 REENTRANT_PROTO*) ;;
14894 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14896 echo "Prototype: $try" ;;
14899 *) case "$usethreads" in
14900 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14907 *) getpwuid_r_proto=0
14911 : Optional checks for getsbyname and getsbyport
14913 : see if getservbyname exists
14914 set getservbyname d_getsbyname
14917 : see if getservbyport exists
14918 set getservbyport d_getsbyport
14921 : see if getservent exists
14922 set getservent d_getsent
14925 : see if getservbyname_r exists
14926 set getservbyname_r d_getservbyname_r
14928 case "$d_getservbyname_r" in
14930 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14931 case "$d_getservbyname_r_proto:$usethreads" in
14932 ":define") d_getservbyname_r_proto=define
14933 set d_getservbyname_r_proto getservbyname_r $hdrs
14937 case "$d_getservbyname_r_proto" in
14939 case "$getservbyname_r_proto" in
14940 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14941 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14943 case "$getservbyname_r_proto" in
14944 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14945 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14947 case "$getservbyname_r_proto" in
14948 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14949 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14951 case "$getservbyname_r_proto" in
14952 ''|0) d_getservbyname_r=undef
14953 getservbyname_r_proto=0
14954 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14955 * ) case "$getservbyname_r_proto" in
14956 REENTRANT_PROTO*) ;;
14957 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14959 echo "Prototype: $try" ;;
14962 *) case "$usethreads" in
14963 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14965 d_getservbyname_r=undef
14966 getservbyname_r_proto=0
14970 *) getservbyname_r_proto=0
14974 : see if getservbyport_r exists
14975 set getservbyport_r d_getservbyport_r
14977 case "$d_getservbyport_r" in
14979 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14980 case "$d_getservbyport_r_proto:$usethreads" in
14981 ":define") d_getservbyport_r_proto=define
14982 set d_getservbyport_r_proto getservbyport_r $hdrs
14986 case "$d_getservbyport_r_proto" in
14988 case "$getservbyport_r_proto" in
14989 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14990 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14992 case "$getservbyport_r_proto" in
14993 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14994 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14996 case "$getservbyport_r_proto" in
14997 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14998 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15000 case "$getservbyport_r_proto" in
15001 ''|0) d_getservbyport_r=undef
15002 getservbyport_r_proto=0
15003 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15004 * ) case "$getservbyport_r_proto" in
15005 REENTRANT_PROTO*) ;;
15006 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15008 echo "Prototype: $try" ;;
15011 *) case "$usethreads" in
15012 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15014 d_getservbyport_r=undef
15015 getservbyport_r_proto=0
15019 *) getservbyport_r_proto=0
15023 : see if getservent_r exists
15024 set getservent_r d_getservent_r
15026 case "$d_getservent_r" in
15028 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15029 case "$d_getservent_r_proto:$usethreads" in
15030 ":define") d_getservent_r_proto=define
15031 set d_getservent_r_proto getservent_r $hdrs
15035 case "$d_getservent_r_proto" in
15037 case "$getservent_r_proto" in
15038 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15039 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15041 case "$getservent_r_proto" in
15042 ''|0) try='int getservent_r(struct servent*, char*, int);'
15043 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15045 case "$getservent_r_proto" in
15046 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15047 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15049 case "$getservent_r_proto" in
15050 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15051 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15053 case "$getservent_r_proto" in
15054 ''|0) d_getservent_r=undef
15055 getservent_r_proto=0
15056 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15057 * ) case "$getservent_r_proto" in
15058 REENTRANT_PROTO*) ;;
15059 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15061 echo "Prototype: $try" ;;
15064 *) case "$usethreads" in
15065 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15067 d_getservent_r=undef
15068 getservent_r_proto=0
15072 *) getservent_r_proto=0
15076 : see if prototypes for various getservxxx netdb.h functions are available
15078 set d_getservprotos getservent $i_netdb netdb.h
15081 : see if getspnam exists
15082 set getspnam d_getspnam
15085 : see if this is a shadow.h system
15086 set shadow.h i_shadow
15089 : see if getspnam_r exists
15090 set getspnam_r d_getspnam_r
15092 case "$d_getspnam_r" in
15094 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15095 case "$d_getspnam_r_proto:$usethreads" in
15096 ":define") d_getspnam_r_proto=define
15097 set d_getspnam_r_proto getspnam_r $hdrs
15101 case "$d_getspnam_r_proto" in
15103 case "$getspnam_r_proto" in
15104 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15105 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15107 case "$getspnam_r_proto" in
15108 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15109 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15111 case "$getspnam_r_proto" in
15112 ''|0) d_getspnam_r=undef
15114 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15115 * ) case "$getspnam_r_proto" in
15116 REENTRANT_PROTO*) ;;
15117 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15119 echo "Prototype: $try" ;;
15122 *) case "$usethreads" in
15123 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15130 *) getspnam_r_proto=0
15134 : see if gettimeofday or ftime exists
15135 set gettimeofday d_gettimeod
15137 case "$d_gettimeod" in
15143 val="$undef"; set d_ftime; eval $setvar
15146 case "$d_gettimeod$d_ftime" in
15149 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15153 : see if gmtime_r exists
15154 set gmtime_r d_gmtime_r
15156 case "$d_gmtime_r" in
15158 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15159 case "$d_gmtime_r_proto:$usethreads" in
15160 ":define") d_gmtime_r_proto=define
15161 set d_gmtime_r_proto gmtime_r $hdrs
15165 case "$d_gmtime_r_proto" in
15167 case "$gmtime_r_proto" in
15168 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15169 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15171 case "$gmtime_r_proto" in
15172 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15173 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15175 case "$gmtime_r_proto" in
15176 ''|0) d_gmtime_r=undef
15178 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15179 * ) case "$gmtime_r_proto" in
15180 REENTRANT_PROTO*) ;;
15181 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15183 echo "Prototype: $try" ;;
15186 *) case "$usethreads" in
15187 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15194 *) gmtime_r_proto=0
15198 : see if hasmntopt exists
15199 set hasmntopt d_hasmntopt
15202 : see if this is a netinet/in.h or sys/in.h system
15203 set netinet/in.h i_niin sys/in.h i_sysin
15206 : see if arpa/inet.h has to be included
15207 set arpa/inet.h i_arpainet
15210 : see if htonl --and friends-- exists
15215 : Maybe they are macros.
15218 $cat >htonl.c <<EOM
15220 #include <sys/types.h>
15221 #$i_niin I_NETINET_IN
15223 #$i_arpainet I_ARPA_INET
15224 #ifdef I_NETINET_IN
15225 #include <netinet/in.h>
15228 #include <sys/in.h>
15231 #include <arpa/inet.h>
15234 printf("Defined as a macro.");
15237 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15238 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15240 echo "But it seems to be defined as a macro." >&4
15248 : see if ilogbl exists
15249 set ilogbl d_ilogbl
15254 if set index val -f; eval $csym; $val; then
15255 if set strchr val -f d_strchr; eval $csym; $val; then
15256 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15259 echo "strchr() found." >&4
15263 echo "index() found." >&4
15268 echo "index() found." >&4
15271 if set strchr val -f d_strchr; eval $csym; $val; then
15274 echo "strchr() found." >&4
15276 echo "No index() or strchr() found!" >&4
15281 set d_strchr; eval $setvar
15283 set d_index; eval $setvar
15285 : check whether inet_aton exists
15286 set inet_aton d_inetaton
15289 : see if inet_ntop exists
15290 set inet_ntop d_inetntop
15293 : see if inet_pton exists
15294 set inet_pton d_inetpton
15299 $cat >isascii.c <<EOCP
15302 #$i_stdlib I_STDLIB
15304 #include <stdlib.h>
15315 if eval $compile; then
15316 echo "isascii() found." >&4
15319 echo "isascii() NOT found." >&4
15328 $cat >isblank.c <<'EOCP'
15339 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15340 echo "isblank() found." >&4
15343 echo "isblank() NOT found." >&4
15350 : see if isfinite exists
15351 set isfinite d_isfinite
15354 : see if isinf exists
15358 : see if isnan exists
15362 : see if isnanl exists
15363 set isnanl d_isnanl
15366 : see if killpg exists
15367 set killpg d_killpg
15370 : see if lchown exists
15372 $cat > try.c <<'EOCP'
15373 /* System header to define __stub macros and hopefully few prototypes,
15374 which can conflict with char lchown(); below. */
15375 #include <assert.h>
15376 /* Override any gcc2 internal prototype to avoid an error. */
15377 /* We use char because int might match the return type of a gcc2
15378 builtin and then its argument prototype would still apply. */
15381 /* The GNU C library defines this for functions which it implements
15382 to always fail with ENOSYS. Some functions are actually named
15383 something starting with __ and the normal name is an alias. */
15384 #if defined (__stub_lchown) || defined (__stub___lchown)
15392 if eval $compile; then
15393 $echo "lchown() found." >&4
15396 $echo "lchown() NOT found." >&4
15402 : See if number of significant digits in a double precision number is known
15404 $cat >ldbl_dig.c <<EOM
15405 #$i_limits I_LIMITS
15408 #include <limits.h>
15414 printf("Contains LDBL_DIG");
15417 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15418 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15419 echo "LDBL_DIG found." >&4
15422 echo "LDBL_DIG NOT found." >&4
15429 : see if this is a math.h system
15433 : check to see if math.h defines _LIB_VERSION
15434 d_libm_lib_version="$undef"
15438 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15440 #include <unistd.h>
15442 int main (int argc, char *argv[])
15444 printf ("%d\n", _LIB_VERSION);
15449 if eval $compile; then
15451 echo "Yes, it does ($foo)" >&4
15452 d_libm_lib_version="$define"
15454 echo "No, it does not (probably harmless)" >&4
15461 : see if link exists
15465 : see if localtime_r exists
15466 set localtime_r d_localtime_r
15468 case "$d_localtime_r" in
15470 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15471 case "$d_localtime_r_proto:$usethreads" in
15472 ":define") d_localtime_r_proto=define
15473 set d_localtime_r_proto localtime_r $hdrs
15477 case "$d_localtime_r_proto" in
15479 case "$localtime_r_proto" in
15480 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15481 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15483 case "$localtime_r_proto" in
15484 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15485 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15487 case "$localtime_r_proto" in
15488 ''|0) d_localtime_r=undef
15489 localtime_r_proto=0
15490 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15491 * ) case "$localtime_r_proto" in
15492 REENTRANT_PROTO*) ;;
15493 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15495 echo "Prototype: $try" ;;
15498 *) case "$usethreads" in
15499 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15501 d_localtime_r=undef
15502 localtime_r_proto=0
15506 *) localtime_r_proto=0
15510 : see if localtime_r calls tzset
15511 case "$localtime_r_proto" in
15514 /* Does our libc's localtime_r call tzset ?
15515 * return 0 if so, 1 otherwise.
15517 #$i_systypes I_SYS_TYPES
15518 #$i_unistd I_UNISTD
15520 #$i_stdlib I_STDLIB
15521 #$i_string I_STRING
15522 #$i_malloc I_MALLOC
15524 # include <sys/types.h>
15527 # include <unistd.h>
15533 #include <stdlib.h>
15536 # include <string.h>
15538 # include <strings.h>
15541 # include <malloc.h>
15545 time_t t = time(0L);
15546 char w_tz[]="TZ" "=GMT+5",
15547 e_tz[]="TZ" "=GMT-5",
15548 *tz_e = (char*)malloc(16),
15549 *tz_w = (char*)malloc(16);
15550 struct tm tm_e, tm_w;
15551 memset(&tm_e,'\0',sizeof(struct tm));
15552 memset(&tm_w,'\0',sizeof(struct tm));
15557 localtime_r(&t, &tm_e);
15560 localtime_r(&t, &tm_w);
15562 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15568 if eval $compile; then
15569 if $run ./try; then
15570 d_localtime_r_needs_tzset=undef;
15572 d_localtime_r_needs_tzset=define;
15575 d_localtime_r_needs_tzset=undef;
15579 d_localtime_r_needs_tzset=undef;
15584 : see if localeconv exists
15585 set localeconv d_locconv
15588 : see if lockf exists
15592 : see if prototype for lseek is available
15594 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15597 : see if lstat exists
15601 : see if madvise exists
15602 set madvise d_madvise
15605 : see if malloc_size exists
15606 set malloc_size d_malloc_size
15609 : see if malloc_size_good exists
15610 set malloc_good_size d_malloc_good_size
15613 : see if mblen exists
15617 : see if mbstowcs exists
15618 set mbstowcs d_mbstowcs
15621 : see if mbtowc exists
15622 set mbtowc d_mbtowc
15625 : see if memchr exists
15626 set memchr d_memchr
15629 : see if memcmp exists
15630 set memcmp d_memcmp
15633 : see if memcpy exists
15634 set memcpy d_memcpy
15637 : see if memmove exists
15638 set memmove d_memmove
15641 : see if memset exists
15642 set memset d_memset
15645 : see if mkdir exists
15649 : see if mkdtemp exists
15650 set mkdtemp d_mkdtemp
15653 : see if mkfifo exists
15654 set mkfifo d_mkfifo
15657 : see if mkstemp exists
15658 set mkstemp d_mkstemp
15661 : see if mkstemps exists
15662 set mkstemps d_mkstemps
15665 : see if mktime exists
15666 set mktime d_mktime
15669 : see if this is a sys/mman.h system
15670 set sys/mman.h i_sysmman
15673 : see if mmap exists
15676 : see what shmat returns
15677 : default to something harmless
15679 case "$i_sysmman$d_mmap" in
15681 $cat >mmap.c <<'END'
15682 #include <sys/mman.h>
15685 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15690 echo "and it returns ($mmaptype)." >&4
15696 : see if sqrtl exists
15700 : see if scalbnl exists
15701 set scalbnl d_scalbnl
15704 : see if modfl exists
15708 : see if prototype for modfl is available
15710 set d_modflproto modfl $i_math math.h
15713 d_modfl_pow32_bug="$undef"
15715 case "$d_longdbl$d_modfl" in
15718 Checking to see whether your modfl() is okay for large values...
15724 if $test "X$d_modflproto" != "X$define"; then
15725 $cat >>try.c <<EOCP
15726 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15727 long double modfl (long double, long double *);
15730 $cat >>try.c <<EOCP
15732 long double nv = 4294967303.15;
15738 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15742 case "$osname:$gccversion" in
15743 aix:) saveccflags="$ccflags"
15744 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15747 if eval $compile; then
15750 *" 4294967303.150000 1.150000 4294967302.000000")
15751 echo >&4 "Your modfl() is broken for large values."
15752 d_modfl_pow32_bug="$define"
15754 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15758 *" 4294967303.150000 0.150000 4294967303.000000")
15759 echo >&4 "Your modfl() seems okay for large values."
15761 *) echo >&4 "I don't understand your modfl() at all."
15767 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15770 case "$osname:$gccversion" in
15771 aix:) ccflags="$saveccflags" ;; # restore
15776 if $test "$uselongdouble" = "$define"; then
15778 if $test "$d_sqrtl" != "$define"; then
15779 message="$message sqrtl"
15781 if $test "$d_modfl" != "$define"; then
15782 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15783 echo "You have both aintl and copysignl, so I can emulate modfl."
15785 message="$message modfl"
15788 if $test "$d_frexpl" != "$define"; then
15789 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15790 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15792 message="$message frexpl"
15796 if $test "$message" != ""; then
15799 *** You requested the use of long doubles but you do not seem to have
15800 *** the following mathematical functions needed for long double support:
15802 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15803 *** Cannot continue, aborting.
15811 : see if mprotect exists
15812 set mprotect d_mprotect
15815 : see if msgctl exists
15816 set msgctl d_msgctl
15819 : see if msgget exists
15820 set msgget d_msgget
15823 : see if msgsnd exists
15824 set msgsnd d_msgsnd
15827 : see if msgrcv exists
15828 set msgrcv d_msgrcv
15831 : see how much of the 'msg*(2)' library is present.
15834 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15835 *"$undef"*) h_msg=false;;
15839 case "`ipcs 2>&1`" in
15840 "SVID messages"*"not configured"*)
15841 echo "Your $osname does not have the msg*(2) configured." >&4
15844 set msgctl d_msgctl
15846 set msgget d_msgget
15848 set msgsnd d_msgsnd
15850 set msgrcv d_msgrcv
15856 : we could also check for sys/ipc.h ...
15857 if $h_msg && $test `./findhdr sys/msg.h`; then
15858 echo "You have the full msg*(2) library." >&4
15861 echo "You don't have the full msg*(2) library." >&4
15867 : Check for msghdr_s
15869 echo "Checking to see if your system supports struct msghdr..." >&4
15870 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15872 case "$d_msghdr_s" in
15873 "$define") echo "Yes, it does." ;;
15874 *) echo "No, it doesn't." ;;
15878 : see if msync exists
15882 : see if munmap exists
15883 set munmap d_munmap
15886 : see if nice exists
15890 : see if this is a langinfo.h system
15891 set langinfo.h i_langinfo
15894 : see if nl_langinfo exists
15895 set nl_langinfo d_nl_langinfo
15898 : check for volatile keyword
15900 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15901 $cat >try.c <<'EOCP'
15904 typedef struct _goo_struct goo_struct;
15905 goo_struct * volatile goo = ((goo_struct *)0);
15906 struct _goo_struct {
15911 typedef unsigned short foo_t;
15912 char *volatile foo;
15914 volatile foo_t blech;
15918 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15920 echo "Yup, it does."
15923 echo "Nope, it doesn't."
15929 : Check basic sizes
15931 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15933 case "$use64bitint:$d_quad:$quadtype" in
15936 uvtype="$uquadtype"
15941 uvtype="unsigned long"
15947 case "$uselongdouble:$d_longdbl" in
15949 nvtype="long double"
15950 nvsize=$longdblsize
15957 $echo "(IV will be "$ivtype", $ivsize bytes)"
15958 $echo "(UV will be "$uvtype", $uvsize bytes)"
15959 $echo "(NV will be "$nvtype", $nvsize bytes)"
15962 #$i_inttypes I_INTTYPES
15964 #include <inttypes.h>
15969 int8_t i = INT8_MAX;
15970 uint8_t u = UINT8_MAX;
15971 printf("int8_t\n");
15974 int16_t i = INT16_MAX;
15975 uint16_t u = UINT16_MAX;
15976 printf("int16_t\n");
15979 int32_t i = INT32_MAX;
15980 uint32_t u = UINT32_MAX;
15981 printf("int32_t\n");
15986 i8type="signed char"
15987 u8type="unsigned char"
15992 '') case "$shortsize" in
15994 u16type="unsigned short"
16002 '') set try -DINT16
16003 if eval $compile; then
16004 case "`$run ./try`" in
16016 '') if $test $shortsize -ge 2; then
16018 u16type="unsigned short"
16026 '') case "$longsize" in
16028 u32type="unsigned long"
16032 *) case "$intsize" in
16034 u32type="unsigned int"
16044 '') set try -DINT32
16045 if eval $compile; then
16046 case "`$run ./try`" in
16058 '') if $test $intsize -ge 4; then
16060 u32type="unsigned int"
16068 '') case "$d_quad:$quadtype" in
16070 i64type="$quadtype"
16071 u64type="$uquadtype"
16079 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16080 : volatile so that the compiler has to store it out to memory.
16081 if test X"$d_volatile" = X"$define"; then
16086 #$i_stdlib I_STDLIB
16088 #include <stdlib.h>
16090 #include <sys/types.h>
16091 #include <signal.h>
16093 $volatile int bletched = 0;
16094 $signal_t blech(int s) { bletched = 1; }
16099 int n = 8 * $uvsize;
16102 signal(SIGFPE, blech);
16105 for (i = 0; i < n; i++) {
16106 u = u << 1 | ($uvtype)1;
16108 if (($uvtype)d != u)
16112 d = ($nvtype)(u - 1);
16113 if (($uvtype)d != (u - 1))
16120 printf("%d\n", ((i == n) ? -n : i));
16126 d_nv_preserves_uv="$undef"
16127 if eval $compile; then
16128 nv_preserves_uv_bits="`$run ./try`"
16130 case "$nv_preserves_uv_bits" in
16132 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16133 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16134 d_nv_preserves_uv="$define"
16136 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16137 d_nv_preserves_uv="$undef" ;;
16138 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16139 nv_preserves_uv_bits="0" ;;
16143 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16144 : volatile so that the compiler has to store it out to memory.
16145 if test X"$d_volatile" = X"$define"; then
16151 typedef $nvtype NV;
16158 while(count < 256) {
16159 $volatile NV up = value + 1.0;
16160 $volatile NV negated = -value;
16161 $volatile NV down = negated - 1.0;
16162 $volatile NV got_up = up - value;
16163 int up_good = got_up == 1.0;
16164 int got_down = down - negated;
16165 int down_good = got_down == -1.0;
16167 if (down_good != up_good) {
16169 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16170 up_good, (double) got_up, down_good, (double) got_down,
16171 count, (double) value);
16178 fputs("256.0", stdout);
16181 fputs("2.0", stdout);
16187 fputs("*", stdout);
16193 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16194 count, (double) value);
16200 nv_overflows_integers_at='0'
16201 if eval $compile; then
16207 The largest integer your NVs can preserve is equal to $xxx
16209 nv_overflows_integers_at="$xxx"
16212 Cannot determine the largest integer value your NVs can hold, unexpected output
16219 Cannot determine the largest integer value your NVs can hold
16226 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16227 : volatile so that the compiler has to store it out to memory.
16228 if test X"$d_volatile" = X"$define"; then
16233 #$i_stdlib I_STDLIB
16235 #include <stdlib.h>
16237 #$i_string I_STRING
16239 # include <string.h>
16241 # include <strings.h>
16243 #include <sys/types.h>
16244 #include <signal.h>
16246 $volatile int bletched = 0;
16247 $signal_t blech(int s) { bletched = 1; }
16250 int checkit($nvtype d, char *where) {
16251 unsigned char *p = (char *)&d;
16252 unsigned char *end = p + sizeof(d);
16262 printf("No - %s: 0x", where);
16264 printf ("%02X", *p++);
16269 int main(int argc, char **argv) {
16272 fail += checkit(d, "0.0");
16274 /* The compiler shouldn't be assuming that bletched is 0 */
16277 fail += checkit(d, "bleched");
16280 signal(SIGFPE, blech);
16283 /* Paranoia - the compiler should have no way of knowing that ANSI says
16284 that argv[argc] will always be NULL. Actually, if it did assume this it
16285 would be buggy, as this is C and main() can be called from elsewhere in
16287 d = argv[argc] ? 1 : 0;
16290 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16293 fail += checkit(d, "ternary");
16295 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16298 printf("No - memset doesn't give 0.0\n");
16299 /* This might just blow up: */
16300 printf("(gives %g)\n", d);
16306 printf("No - something bleched\n");
16311 printf("No - %d fail(s)\n", fail);
16320 d_nv_zero_is_allbits_zero="$undef"
16321 if eval $compile; then
16327 0.0 is represented as all bits zero in memory
16329 d_nv_zero_is_allbits_zero="$define"
16332 0.0 is not represented as all bits zero in memory
16334 d_nv_zero_is_allbits_zero="$undef"
16339 0.0 is not represented as all bits zero in memory
16341 d_nv_zero_is_allbits_zero="$undef"
16347 : check for off64_t
16349 echo "Checking to see if you have off64_t..." >&4
16351 #include <sys/types.h>
16352 #include <unistd.h>
16353 int main() { off64_t x = 7; }
16356 if eval $compile; then
16358 echo "You have off64_t."
16361 echo "You do not have off64_t."
16362 case "$lseeksize" in
16363 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16370 : check for ptrdiff_t
16372 echo "Checking to see if you have ptrdiff_t..." >&4
16374 #include <stddef.h>
16375 int main() { ptrdiff_t x = 7; }
16378 if eval $compile; then
16380 echo "You have ptrdiff_t."
16383 echo "You do not have ptrdiff_t."
16389 : how to create joinable pthreads
16390 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16392 echo "Checking what constant to use for creating joinable pthreads..." >&4
16393 $cat >try.c <<'EOCP'
16394 #include <pthread.h>
16396 int detachstate = JOINABLE;
16399 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16400 if eval $compile; then
16401 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16402 val="$undef" # Yes, undef.
16403 set d_old_pthread_create_joinable
16406 set old_pthread_create_joinable
16409 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16410 if eval $compile; then
16411 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16413 set d_old_pthread_create_joinable
16415 val=PTHREAD_CREATE_UNDETACHED
16416 set old_pthread_create_joinable
16419 set try -DJOINABLE=__UNDETACHED
16420 if eval $compile; then
16421 echo "You seem to use __UNDETACHED." >&4
16423 set d_old_pthread_create_joinable
16426 set old_pthread_create_joinable
16429 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16431 set d_old_pthread_create_joinable
16434 set old_pthread_create_joinable
16441 d_old_pthread_create_joinable="$undef"
16442 old_pthread_create_joinable=""
16445 : see if pause exists
16449 : see if poll exists
16453 : see if prctl exists
16457 : see if prctl supports PR_SET_NAME
16458 d_prctl_set_name=$undef
16462 #include <sys/prctl.h>
16464 int main (int argc, char *argv[])
16466 return (prctl (PR_SET_NAME, "Test"));
16470 if eval $compile_ok && $run ./try; then
16471 echo "Your prctl (PR_SET_NAME, ...) works"
16472 d_prctl_set_name=$define
16478 : see if readlink exists
16479 set readlink d_readlink
16482 : Check if exe is symlink to abs path of executing program
16486 case "$d_readlink" in
16488 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16489 : more tidy to avoid an extra level of symlink
16490 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16491 while test $# -gt 0; do
16494 if $issymlink $try; then
16495 $ls -l $try > reflect
16496 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16497 echo "You have $type-like $try."
16498 procselfexe='"'$try'"'
16500 : This will break out of the loop
16511 : backward compatibility for d_hvfork
16512 if test X$d_hvfork != X; then
16513 d_vfork="$d_hvfork"
16516 : see if there is a vfork
16521 d_pseudofork=$undef
16523 : Ok, but do we want to use it. vfork is reportedly unreliable in
16524 : perl on Solaris 2.x, and probably elsewhere.
16528 case "$usevfork" in
16534 Perl can only use a vfork() that doesn't suffer from strict
16535 restrictions on calling functions or modifying global data in
16536 the child. For example, glibc-2.1 contains such a vfork()
16537 that is unsuitable. If your system provides a proper fork()
16538 call, chances are that you do NOT want perl to use vfork().
16541 rp="Do you still want to use vfork()?"
16546 echo "Ok, we won't use vfork()."
16555 $define) usevfork='true';;
16556 *) usevfork='false';;
16559 : see whether the pthread_atfork exists
16561 #include <pthread.h>
16564 #ifdef PTHREAD_ATFORK
16565 pthread_atfork(NULL,NULL,NULL);
16570 : see if pthread_atfork exists
16571 set try -DPTHREAD_ATFORK
16572 if eval $compile; then
16577 case "$usethreads" in
16580 $define) echo 'pthread_atfork found.' >&4 ;;
16581 *) echo 'pthread_atfork NOT found.' >&4 ;;
16584 set d_pthread_atfork
16587 : see if pthread_attr_setscope exists
16588 set pthread_attr_setscope d_pthread_attr_setscope
16591 : see whether the various POSIXish _yields exist
16593 #include <pthread.h>
16599 #ifdef PTHREAD_YIELD
16602 #ifdef PTHREAD_YIELD_NULL
16603 pthread_yield(NULL);
16609 : see if sched_yield exists
16610 set try -DSCHED_YIELD
16611 if eval $compile; then
16613 sched_yield='sched_yield()'
16617 case "$usethreads" in
16620 $define) echo 'sched_yield() found.' >&4 ;;
16621 *) echo 'sched_yield() NOT found.' >&4 ;;
16627 : see if pthread_yield exists
16628 set try -DPTHREAD_YIELD
16629 if eval $compile; then
16631 case "$sched_yield" in
16632 '') sched_yield='pthread_yield()' ;;
16635 set try -DPTHREAD_YIELD_NULL
16636 if eval $compile; then
16638 case "$sched_yield" in
16639 '') sched_yield='pthread_yield(NULL)' ;;
16645 case "$usethreads" in
16648 $define) echo 'pthread_yield() found.' >&4 ;;
16649 *) echo 'pthread_yield() NOT found.' >&4 ;;
16653 set d_pthread_yield
16655 case "$sched_yield" in
16656 '') sched_yield=undef ;;
16660 : see if random_r exists
16661 set random_r d_random_r
16663 case "$d_random_r" in
16665 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16666 case "$d_random_r_proto:$usethreads" in
16667 ":define") d_random_r_proto=define
16668 set d_random_r_proto random_r $hdrs
16672 case "$d_random_r_proto" in
16674 case "$random_r_proto" in
16675 ''|0) try='int random_r(int*, struct random_data*);'
16676 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16678 case "$random_r_proto" in
16679 ''|0) try='int random_r(long*, struct random_data*);'
16680 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16682 case "$random_r_proto" in
16683 ''|0) try='int random_r(struct random_data*, int32_t*);'
16684 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16686 case "$random_r_proto" in
16687 ''|0) d_random_r=undef
16689 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16690 * ) case "$random_r_proto" in
16691 REENTRANT_PROTO*) ;;
16692 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16694 echo "Prototype: $try" ;;
16697 *) case "$usethreads" in
16698 define) echo "random_r has no prototype, not using it." >&4 ;;
16705 *) random_r_proto=0
16709 : see if readdir and friends exist
16710 set readdir d_readdir
16712 set seekdir d_seekdir
16714 set telldir d_telldir
16716 set rewinddir d_rewinddir
16719 : see if readdir64_r exists
16720 set readdir64_r d_readdir64_r
16722 case "$d_readdir64_r" in
16724 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16725 case "$d_readdir64_r_proto:$usethreads" in
16726 ":define") d_readdir64_r_proto=define
16727 set d_readdir64_r_proto readdir64_r $hdrs
16731 case "$d_readdir64_r_proto" in
16733 case "$readdir64_r_proto" in
16734 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16735 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16737 case "$readdir64_r_proto" in
16738 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16739 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16741 case "$readdir64_r_proto" in
16742 ''|0) d_readdir64_r=undef
16743 readdir64_r_proto=0
16744 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16745 * ) case "$readdir64_r_proto" in
16746 REENTRANT_PROTO*) ;;
16747 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16749 echo "Prototype: $try" ;;
16752 *) case "$usethreads" in
16753 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16755 d_readdir64_r=undef
16756 readdir64_r_proto=0
16760 *) readdir64_r_proto=0
16764 : see if readdir_r exists
16765 set readdir_r d_readdir_r
16767 case "$d_readdir_r" in
16769 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16770 case "$d_readdir_r_proto:$usethreads" in
16771 ":define") d_readdir_r_proto=define
16772 set d_readdir_r_proto readdir_r $hdrs
16776 case "$d_readdir_r_proto" in
16778 case "$readdir_r_proto" in
16779 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16780 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16782 case "$readdir_r_proto" in
16783 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16784 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16786 case "$readdir_r_proto" in
16787 ''|0) d_readdir_r=undef
16789 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16790 * ) case "$readdir_r_proto" in
16791 REENTRANT_PROTO*) ;;
16792 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16794 echo "Prototype: $try" ;;
16797 *) case "$usethreads" in
16798 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16805 *) readdir_r_proto=0
16809 : see if readv exists
16813 : see if recvmsg exists
16814 set recvmsg d_recvmsg
16817 : see if rename exists
16818 set rename d_rename
16821 : see if rmdir exists
16825 : see if memory.h is available.
16830 : See if it conflicts with string.h
16836 $cppstdin $cppflags $cppminus < $strings > mem.h
16837 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16839 echo "We won't be including <memory.h>."
16849 : can bcopy handle overlapping blocks?
16852 case "$d_memmove" in
16853 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16854 *) case "$d_bcopy" in
16856 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16858 #$i_memory I_MEMORY
16859 #$i_stdlib I_STDLIB
16860 #$i_string I_STRING
16861 #$i_unistd I_UNISTD
16863 $cat >>try.c <<'EOCP'
16866 # include <memory.h>
16869 # include <stdlib.h>
16872 # include <string.h>
16874 # include <strings.h>
16877 # include <unistd.h> /* Needed for NetBSD */
16881 char buf[128], abc[128];
16887 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16888 try to store the string in read-only memory. */
16889 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16891 for (align = 7; align >= 0; align--) {
16892 for (len = 36; len; len--) {
16894 bcopy(abc, b, len);
16895 for (off = 1; off <= len; off++) {
16896 bcopy(b, b+off, len);
16897 bcopy(b+off, b, len);
16898 if (bcmp(b, abc, len))
16907 if eval $compile_ok; then
16908 if $run ./try 2>/dev/null; then
16909 echo "Yes, it can."
16912 echo "It can't, sorry."
16915 echo "(I can't compile the test program, so we'll assume not...)"
16925 : can memcpy handle overlapping blocks?
16928 case "$d_memmove" in
16929 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16930 *) case "$d_memcpy" in
16932 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16934 #$i_memory I_MEMORY
16935 #$i_stdlib I_STDLIB
16936 #$i_string I_STRING
16937 #$i_unistd I_UNISTD
16939 $cat >>try.c <<'EOCP'
16942 # include <memory.h>
16945 # include <stdlib.h>
16948 # include <string.h>
16950 # include <strings.h>
16953 # include <unistd.h> /* Needed for NetBSD */
16957 char buf[128], abc[128];
16963 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16964 try to store the string in read-only memory. */
16965 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16967 for (align = 7; align >= 0; align--) {
16968 for (len = 36; len; len--) {
16970 memcpy(b, abc, len);
16971 for (off = 1; off <= len; off++) {
16972 memcpy(b+off, b, len);
16973 memcpy(b, b+off, len);
16974 if (memcmp(b, abc, len))
16983 if eval $compile_ok; then
16984 if $run ./try 2>/dev/null; then
16985 echo "Yes, it can."
16988 echo "It can't, sorry."
16991 echo "(I can't compile the test program, so we'll assume not...)"
17001 : can memcmp be trusted to compare relative magnitude?
17003 case "$d_memcmp" in
17006 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17008 #$i_memory I_MEMORY
17009 #$i_stdlib I_STDLIB
17010 #$i_string I_STRING
17011 #$i_unistd I_UNISTD
17013 $cat >>try.c <<'EOCP'
17016 # include <memory.h>
17019 # include <stdlib.h>
17022 # include <string.h>
17024 # include <strings.h>
17027 # include <unistd.h> /* Needed for NetBSD */
17033 if ((a < b) && memcmp(&a, &b, 1) < 0)
17039 if eval $compile_ok; then
17040 if $run ./try 2>/dev/null; then
17041 echo "Yes, it can."
17044 echo "No, it can't (it uses signed chars)."
17047 echo "(I can't compile the test program, so we'll assume not...)"
17055 : see if prototype for sbrk is available
17057 set d_sbrkproto sbrk $i_unistd unistd.h
17060 : see if select exists
17061 set select d_select
17064 : see if semctl exists
17065 set semctl d_semctl
17068 : see if semget exists
17069 set semget d_semget
17072 : see if semop exists
17076 : see how much of the 'sem*(2)' library is present.
17079 case "$d_semctl$d_semget$d_semop" in
17080 *"$undef"*) h_sem=false;;
17084 case "`ipcs 2>&1`" in
17085 "SVID messages"*"not configured"*)
17086 echo "Your $osname does not have the sem*(2) configured." >&4
17089 set semctl d_semctl
17091 set semget d_semget
17099 : we could also check for sys/ipc.h ...
17100 if $h_sem && $test `./findhdr sys/sem.h`; then
17101 echo "You have the full sem*(2) library." >&4
17104 echo "You don't have the full sem*(2) library." >&4
17110 : see whether sys/sem.h defines union semun
17112 $cat > try.c <<'END'
17113 #include <sys/types.h>
17114 #include <sys/ipc.h>
17115 #include <sys/sem.h>
17116 int main () { union semun semun; semun.buf = 0; }
17119 if eval $compile; then
17120 echo "You have union semun in <sys/sem.h>." >&4
17123 echo "You do not have union semun in <sys/sem.h>." >&4
17130 : see how to do semctl IPC_STAT
17134 $cat > tryh.h <<END
17137 # define S_IRUSR S_IREAD
17138 # define S_IWUSR S_IWRITE
17139 # define S_IXUSR S_IEXEC
17141 # define S_IRUSR 0400
17142 # define S_IWUSR 0200
17143 # define S_IXUSR 0100
17145 # define S_IRGRP (S_IRUSR>>3)
17146 # define S_IWGRP (S_IWUSR>>3)
17147 # define S_IXGRP (S_IXUSR>>3)
17148 # define S_IROTH (S_IRUSR>>6)
17149 # define S_IWOTH (S_IWUSR>>6)
17150 # define S_IXOTH (S_IXUSR>>6)
17153 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17154 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17155 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17158 : see whether semctl IPC_STAT can use union semun
17159 case "$d_semctl_semun" in
17163 #include <sys/types.h>
17164 #include <sys/ipc.h>
17165 #include <sys/sem.h>
17166 #include <sys/stat.h>
17173 #$d_union_semun HAS_UNION_SEMUN
17176 #ifndef HAS_UNION_SEMUN
17179 struct semid_ds *buf;
17180 unsigned short *array;
17186 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17187 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17189 struct semid_ds argbuf;
17192 st = semctl(sem, 0, IPC_STAT, arg);
17196 # endif /* IPC_STAT */
17197 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17199 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17200 # endif /* IPC_RMID */
17201 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17203 #endif /* IPC_PRIVATE && ... */
17204 printf("semget failed: errno = %d\n", errno);
17209 if eval $compile; then
17212 semun) val="$define" ;;
17220 case "$d_semctl_semun" in
17222 echo "You can use union semun for semctl IPC_STAT." >&4
17225 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17230 : see whether semctl IPC_STAT can use struct semid_ds pointer
17231 case "$d_semctl_semid_ds" in
17234 $cat > try.c <<'END'
17235 #include <sys/types.h>
17236 #include <sys/ipc.h>
17237 #include <sys/sem.h>
17238 #include <sys/stat.h>
17246 struct semid_ds arg;
17249 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17250 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17253 st = semctl(sem, 0, IPC_STAT, &arg);
17255 printf("semid_ds\n");
17257 # endif /* IPC_STAT */
17258 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17260 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17261 # endif /* IPC_RMID */
17262 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17264 #endif /* IPC_PRIVATE && ... */
17265 printf("semget failed: errno = %d\n", errno);
17271 if eval $compile; then
17274 semid_ds) val="$define" ;;
17278 set d_semctl_semid_ds
17282 case "$d_semctl_semid_ds" in
17284 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17286 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17292 # We do not have the full sem*(2) library, so assume we can not
17298 set d_semctl_semid_ds
17304 : see if sendmsg exists
17305 set sendmsg d_sendmsg
17308 : see if setegid exists
17309 set setegid d_setegid
17312 : see if seteuid exists
17313 set seteuid d_seteuid
17316 : see if setgrent exists
17317 set setgrent d_setgrent
17320 : see if setgrent_r exists
17321 set setgrent_r d_setgrent_r
17323 case "$d_setgrent_r" in
17325 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17326 case "$d_setgrent_r_proto:$usethreads" in
17327 ":define") d_setgrent_r_proto=define
17328 set d_setgrent_r_proto setgrent_r $hdrs
17332 case "$d_setgrent_r_proto" in
17334 case "$setgrent_r_proto" in
17335 ''|0) try='int setgrent_r(FILE**);'
17336 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17338 case "$setgrent_r_proto" in
17339 ''|0) try='void setgrent_r(FILE**);'
17340 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17342 case "$setgrent_r_proto" in
17343 ''|0) d_setgrent_r=undef
17345 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17346 * ) case "$setgrent_r_proto" in
17347 REENTRANT_PROTO*) ;;
17348 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17350 echo "Prototype: $try" ;;
17353 *) case "$usethreads" in
17354 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17361 *) setgrent_r_proto=0
17365 : see if sethostent exists
17366 set sethostent d_sethent
17369 : see if sethostent_r exists
17370 set sethostent_r d_sethostent_r
17372 case "$d_sethostent_r" in
17374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17375 case "$d_sethostent_r_proto:$usethreads" in
17376 ":define") d_sethostent_r_proto=define
17377 set d_sethostent_r_proto sethostent_r $hdrs
17381 case "$d_sethostent_r_proto" in
17383 case "$sethostent_r_proto" in
17384 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17385 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17387 case "$sethostent_r_proto" in
17388 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17389 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17391 case "$sethostent_r_proto" in
17392 ''|0) d_sethostent_r=undef
17393 sethostent_r_proto=0
17394 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17395 * ) case "$sethostent_r_proto" in
17396 REENTRANT_PROTO*) ;;
17397 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17399 echo "Prototype: $try" ;;
17402 *) case "$usethreads" in
17403 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17405 d_sethostent_r=undef
17406 sethostent_r_proto=0
17410 *) sethostent_r_proto=0
17414 : see if setitimer exists
17415 set setitimer d_setitimer
17418 : see if setlinebuf exists
17419 set setlinebuf d_setlinebuf
17422 : see if setlocale exists
17423 set setlocale d_setlocale
17426 : see if locale.h is available
17427 set locale.h i_locale
17430 : see if setlocale_r exists
17431 set setlocale_r d_setlocale_r
17433 case "$d_setlocale_r" in
17435 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17436 case "$d_setlocale_r_proto:$usethreads" in
17437 ":define") d_setlocale_r_proto=define
17438 set d_setlocale_r_proto setlocale_r $hdrs
17442 case "$d_setlocale_r_proto" in
17444 case "$setlocale_r_proto" in
17445 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17446 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17448 case "$setlocale_r_proto" in
17449 ''|0) d_setlocale_r=undef
17450 setlocale_r_proto=0
17451 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17452 * ) case "$setlocale_r_proto" in
17453 REENTRANT_PROTO*) ;;
17454 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17456 echo "Prototype: $try" ;;
17459 *) case "$usethreads" in
17460 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17462 d_setlocale_r=undef
17463 setlocale_r_proto=0
17467 *) setlocale_r_proto=0
17471 : see if setnetent exists
17472 set setnetent d_setnent
17475 : see if setnetent_r exists
17476 set setnetent_r d_setnetent_r
17478 case "$d_setnetent_r" in
17480 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17481 case "$d_setnetent_r_proto:$usethreads" in
17482 ":define") d_setnetent_r_proto=define
17483 set d_setnetent_r_proto setnetent_r $hdrs
17487 case "$d_setnetent_r_proto" in
17489 case "$setnetent_r_proto" in
17490 ''|0) try='int setnetent_r(int, struct netent_data*);'
17491 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17493 case "$setnetent_r_proto" in
17494 ''|0) try='void setnetent_r(int, struct netent_data*);'
17495 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17497 case "$setnetent_r_proto" in
17498 ''|0) d_setnetent_r=undef
17499 setnetent_r_proto=0
17500 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17501 * ) case "$setnetent_r_proto" in
17502 REENTRANT_PROTO*) ;;
17503 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17505 echo "Prototype: $try" ;;
17508 *) case "$usethreads" in
17509 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17511 d_setnetent_r=undef
17512 setnetent_r_proto=0
17516 *) setnetent_r_proto=0
17520 : see if setprotoent exists
17521 set setprotoent d_setpent
17524 : see if setpgid exists
17525 set setpgid d_setpgid
17528 : see if setpgrp2 exists
17529 set setpgrp2 d_setpgrp2
17532 : see if setpriority exists
17533 set setpriority d_setprior
17536 : see if setproctitle exists
17537 set setproctitle d_setproctitle
17540 : see if setprotoent_r exists
17541 set setprotoent_r d_setprotoent_r
17543 case "$d_setprotoent_r" in
17545 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17546 case "$d_setprotoent_r_proto:$usethreads" in
17547 ":define") d_setprotoent_r_proto=define
17548 set d_setprotoent_r_proto setprotoent_r $hdrs
17552 case "$d_setprotoent_r_proto" in
17554 case "$setprotoent_r_proto" in
17555 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17556 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17558 case "$setprotoent_r_proto" in
17559 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17560 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17562 case "$setprotoent_r_proto" in
17563 ''|0) d_setprotoent_r=undef
17564 setprotoent_r_proto=0
17565 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17566 * ) case "$setprotoent_r_proto" in
17567 REENTRANT_PROTO*) ;;
17568 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17570 echo "Prototype: $try" ;;
17573 *) case "$usethreads" in
17574 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17576 d_setprotoent_r=undef
17577 setprotoent_r_proto=0
17581 *) setprotoent_r_proto=0
17585 : see if setpwent exists
17586 set setpwent d_setpwent
17589 : see if setpwent_r exists
17590 set setpwent_r d_setpwent_r
17592 case "$d_setpwent_r" in
17594 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17595 case "$d_setpwent_r_proto:$usethreads" in
17596 ":define") d_setpwent_r_proto=define
17597 set d_setpwent_r_proto setpwent_r $hdrs
17601 case "$d_setpwent_r_proto" in
17603 case "$setpwent_r_proto" in
17604 ''|0) try='int setpwent_r(FILE**);'
17605 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17607 case "$setpwent_r_proto" in
17608 ''|0) try='void setpwent_r(FILE**);'
17609 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17611 case "$setpwent_r_proto" in
17612 ''|0) d_setpwent_r=undef
17614 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17615 * ) case "$setpwent_r_proto" in
17616 REENTRANT_PROTO*) ;;
17617 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17619 echo "Prototype: $try" ;;
17622 *) case "$usethreads" in
17623 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17630 *) setpwent_r_proto=0
17634 : see if setregid exists
17635 set setregid d_setregid
17637 set setresgid d_setresgid
17640 : see if setreuid exists
17641 set setreuid d_setreuid
17643 set setresuid d_setresuid
17646 : see if setrgid exists
17647 set setrgid d_setrgid
17650 : see if setruid exists
17651 set setruid d_setruid
17654 : see if setservent exists
17655 set setservent d_setsent
17658 : see if setservent_r exists
17659 set setservent_r d_setservent_r
17661 case "$d_setservent_r" in
17663 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17664 case "$d_setservent_r_proto:$usethreads" in
17665 ":define") d_setservent_r_proto=define
17666 set d_setservent_r_proto setservent_r $hdrs
17670 case "$d_setservent_r_proto" in
17672 case "$setservent_r_proto" in
17673 ''|0) try='int setservent_r(int, struct servent_data*);'
17674 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17676 case "$setservent_r_proto" in
17677 ''|0) try='void setservent_r(int, struct servent_data*);'
17678 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17680 case "$setservent_r_proto" in
17681 ''|0) d_setservent_r=undef
17682 setservent_r_proto=0
17683 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17684 * ) case "$setservent_r_proto" in
17685 REENTRANT_PROTO*) ;;
17686 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17688 echo "Prototype: $try" ;;
17691 *) case "$usethreads" in
17692 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17694 d_setservent_r=undef
17695 setservent_r_proto=0
17699 *) setservent_r_proto=0
17703 : see if setsid exists
17704 set setsid d_setsid
17707 : see if setvbuf exists
17708 set setvbuf d_setvbuf
17711 : see if shmctl exists
17712 set shmctl d_shmctl
17715 : see if shmget exists
17716 set shmget d_shmget
17719 : see if shmat exists
17722 : see what shmat returns
17725 $cat >shmat.c <<'END'
17726 #include <sys/shm.h>
17729 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17734 echo "and it returns ($shmattype)." >&4
17735 : see if a prototype for shmat is available
17736 xxx=`./findhdr sys/shm.h`
17737 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17738 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17749 set d_shmatprototype
17752 : see if shmdt exists
17756 : see how much of the 'shm*(2)' library is present.
17759 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17760 *"$undef"*) h_shm=false;;
17764 case "`ipcs 2>&1`" in
17765 "SVID shared memory"*"not configured"*)
17766 echo "Your $osname does not have the shm*(2) configured." >&4
17769 set shmctl d_shmctl
17771 set shmget d_shmget
17781 : we could also check for sys/ipc.h ...
17782 if $h_shm && $test `./findhdr sys/shm.h`; then
17783 echo "You have the full shm*(2) library." >&4
17786 echo "You don't have the full shm*(2) library." >&4
17792 : see if we have sigaction
17794 if set sigaction val -f d_sigaction; eval $csym; $val; then
17795 echo 'sigaction() found.' >&4
17798 #include <sys/types.h>
17799 #include <signal.h>
17800 #$i_stdlib I_STDLIB
17802 #include <stdlib.h>
17806 struct sigaction act, oact;
17808 oact.sa_handler = 0;
17809 /* so that act and oact are used */
17810 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17814 if eval $compile_ok; then
17817 echo "But you don't seem to have a usable struct sigaction." >&4
17821 echo 'sigaction NOT found.' >&4
17824 set d_sigaction; eval $setvar
17827 : see if this is a sunmath.h system
17828 set sunmath.h i_sunmath
17831 : see if signbit exists
17832 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17835 #$i_sunmath I_SUNMATH
17839 #ifdef I_SUNMATH /* Solaris special math library */
17840 # include <sunmath.h>
17843 int main(int argc, char **argv)
17847 if ((signbit(x) == 0) && (signbit(y) != 0))
17855 if eval $compile; then
17856 if $run ./try; then
17860 $echo "Signbit seems to be available, but doesn't work as I expected."
17861 $echo "I won't use it." >&4
17872 : see if sigprocmask exists
17873 set sigprocmask d_sigprocmask
17876 : see if sigsetjmp exists
17878 case "$d_sigsetjmp" in
17881 #include <setjmp.h>
17882 #$i_stdlib I_STDLIB
17884 #include <stdlib.h>
17890 if (sigsetjmp(env,1))
17893 siglongjmp(env, 1);
17898 if eval $compile; then
17899 if $run ./try >/dev/null 2>&1; then
17900 echo "POSIX sigsetjmp found." >&4
17904 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17910 echo "sigsetjmp not found." >&4
17914 *) val="$d_sigsetjmp"
17915 case "$d_sigsetjmp" in
17916 $define) echo "POSIX sigsetjmp found." >&4;;
17917 $undef) echo "sigsetjmp not found." >&4;;
17925 : see if snprintf exists
17926 set snprintf d_snprintf
17929 : see if vsnprintf exists
17930 set vsnprintf d_vsnprintf
17933 case "$d_snprintf-$d_vsnprintf" in
17936 Checking whether your snprintf() and vsnprintf() work okay...
17938 $cat >try.c <<'EOCP'
17939 /* v?snprintf testing logic courtesy of Russ Allbery.
17940 * According to C99:
17941 * - if the buffer is too short it still must be \0-terminated
17942 * - if the buffer is too short the potentially required length
17943 * must be returned and not -1
17944 * - if the buffer is NULL the potentially required length
17945 * must be returned and not -1 or core dump
17948 #include <stdarg.h>
17952 int test (char *format, ...)
17957 va_start (args, format);
17958 count = vsnprintf (buf, sizeof buf, format, args);
17965 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17966 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17970 if eval $compile; then
17973 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17975 Your snprintf() and snprintf() don't seem to be working okay.
17977 d_snprintf="$undef"
17978 d_vsnprintf="$undef"
17982 echo "(I can't seem to compile the test program--assuming they don't)"
17983 d_snprintf="$undef"
17984 d_vsnprintf="$undef"
17990 : see if sockatmark exists
17991 set sockatmark d_sockatmark
17994 : see if prototype for sockatmark is available
17996 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17999 : see if socks5_init exists
18000 set socks5_init d_socks5_init
18003 : see if sprintf returns the length of the string in the buffer as per ANSI
18004 $echo "Checking whether sprintf returns the length of the string..." >&4
18007 #$i_stdlib I_STDLIB
18009 #include <stdlib.h>
18011 #$i_string I_STRING
18013 # include <string.h>
18015 # include <strings.h>
18024 int check (size_t expect, int test) {
18025 size_t got = strlen(buffer);
18029 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18034 int main(int argc, char **argv) {
18037 check(sprintf(buffer, ""), ++test);
18038 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18039 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18046 if eval $compile; then
18050 sprintf returns the length of the string (as ANSI says it should)
18052 d_sprintf_returns_strlen="$define"
18055 sprintf does not return the length of the string (how old is this system?)
18057 d_sprintf_returns_strlen="$undef"
18061 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18062 d_sprintf_returns_strlen="$undef"
18066 : see if srand48_r exists
18067 set srand48_r d_srand48_r
18069 case "$d_srand48_r" in
18071 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18072 case "$d_srand48_r_proto:$usethreads" in
18073 ":define") d_srand48_r_proto=define
18074 set d_srand48_r_proto srand48_r $hdrs
18078 case "$d_srand48_r_proto" in
18080 case "$srand48_r_proto" in
18081 ''|0) try='int srand48_r(long, struct drand48_data*);'
18082 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18084 case "$srand48_r_proto" in
18085 ''|0) d_srand48_r=undef
18087 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18088 * ) case "$srand48_r_proto" in
18089 REENTRANT_PROTO*) ;;
18090 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18092 echo "Prototype: $try" ;;
18095 *) case "$usethreads" in
18096 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18103 *) srand48_r_proto=0
18107 : see if srandom_r exists
18108 set srandom_r d_srandom_r
18110 case "$d_srandom_r" in
18112 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18113 case "$d_srandom_r_proto:$usethreads" in
18114 ":define") d_srandom_r_proto=define
18115 set d_srandom_r_proto srandom_r $hdrs
18119 case "$d_srandom_r_proto" in
18121 case "$srandom_r_proto" in
18122 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18123 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18125 case "$srandom_r_proto" in
18126 ''|0) d_srandom_r=undef
18128 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18129 * ) case "$srandom_r_proto" in
18130 REENTRANT_PROTO*) ;;
18131 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18133 echo "Prototype: $try" ;;
18136 *) case "$usethreads" in
18137 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18144 *) srandom_r_proto=0
18148 : see if prototype for setresgid is available
18150 set d_sresgproto setresgid $i_unistd unistd.h
18153 : see if prototype for setresuid is available
18155 set d_sresuproto setresuid $i_unistd unistd.h
18158 : see if sys/stat.h is available
18159 set sys/stat.h i_sysstat
18162 : see if stat knows about block sizes
18164 echo "Checking to see if your struct stat has st_blocks field..." >&4
18165 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18168 : see if this is a sys/vfs.h system
18169 set sys/vfs.h i_sysvfs
18172 : see if this is a sys/statfs.h system
18173 set sys/statfs.h i_sysstatfs
18176 : Check for statfs_s
18178 echo "Checking to see if your system supports struct statfs..." >&4
18179 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
18181 case "$d_statfs_s" in
18182 "$define") echo "Yes, it does." ;;
18183 *) echo "No, it doesn't." ;;
18187 : see if struct statfs knows about f_flags
18188 case "$d_statfs_s" in
18191 echo "Checking to see if your struct statfs has f_flags field..." >&4
18192 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
18196 set d_statfs_f_flags
18200 case "$d_statfs_f_flags" in
18201 "$define") echo "Yes, it does." ;;
18202 *) echo "No, it doesn't." ;;
18205 : see what flavor, if any, of static inline is supported
18207 echo "Checking to see if your system supports static inline..."
18208 $cat > try.c <<'EOCP'
18209 #include <stdlib.h>
18210 extern int f_via_a(int x);
18211 extern int f_via_b(int x);
18212 int main(int argc, char **argv)
18221 return EXIT_SUCCESS;
18224 return EXIT_FAILURE;
18228 $cat > a.c <<'EOCP'
18229 static INLINE int f(int x) {
18240 $cat > b.c <<'EOCP'
18241 extern int f(int x);
18249 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18250 case "$perl_static_inline" in
18251 '') # Check the various possibilities, and break out on success.
18252 # For gcc, prefer __inline__, which will still permit
18253 # cflags.SH to add in -ansi.
18254 case "$gccversion" in
18255 '') xxx="inline __inline__ __inline _inline";;
18256 *) xxx="__inline__ inline __inline _inline";;
18258 for inline in $xxx; do
18259 set try -DINLINE=$inline a.c
18260 if eval $compile && $run ./try; then
18261 # Now make sure there is no external linkage of static
18263 set try -DINLINE=$inline -DUSE_B a.c b.c
18264 if eval $compile && $run ./try; then
18265 $echo "Your compiler supports static $inline, " >&4
18266 $echo "but it also creates an external definition," >&4
18267 $echo "so I won't use it." >&4
18270 $echo "Your compiler supports static $inline." >&4
18272 perl_static_inline="static $inline";
18276 $echo "Your compiler does NOT support static $inline." >&4
18281 *inline*) # Some variant of inline exists.
18282 echo "Keeping your $hint value of $perl_static_inline."
18285 static) # No inline capabilities
18286 echo "Keeping your $hint value of $perl_static_inline."
18289 *) # Unrecognized previous value -- blindly trust the supplied
18290 # value and hope it makes sense. Use old value for
18291 # d_static_inline, if there is one.
18292 echo "Keeping your $hint value of $perl_static_inline."
18293 case "$d_static_inline" in
18295 *) val=$d_static_inline ;;
18299 # Fallback to plain 'static' if nothing worked.
18300 case "$perl_static_inline" in
18302 perl_static_inline="static"
18306 set d_static_inline
18308 $rm -f a.[co] b.[co]
18311 : Check stream access
18313 Checking how to access stdio streams by file descriptor number...
18315 case "$stdio_stream_array" in
18316 '') $cat >try.c <<EOCP
18319 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18323 for s in _iob __iob __sF
18325 set try -DSTDIO_STREAM_ARRAY=$s
18326 if eval $compile; then
18327 case "`$run ./try`" in
18328 yes) stdio_stream_array=$s; break ;;
18334 case "$stdio_stream_array" in
18336 I can't figure out how to access stdio streams by file descriptor number.
18338 d_stdio_stream_array="$undef"
18341 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18343 d_stdio_stream_array="$define"
18347 : see if strcoll exists
18348 set strcoll d_strcoll
18351 : check for structure copying
18353 echo "Checking to see if your C compiler can copy structs..." >&4
18354 $cat >try.c <<'EOCP'
18364 if $cc -c try.c >/dev/null 2>&1 ; then
18366 echo "Yup, it can."
18369 echo "Nope, it can't."
18375 : see if strerror and/or sys_errlist[] exist
18377 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18378 if set strerror val -f d_strerror; eval $csym; $val; then
18379 echo 'strerror() found.' >&4
18380 d_strerror="$define"
18381 d_strerrm='strerror(e)'
18382 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18383 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18384 d_syserrlst="$define"
18386 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18387 d_syserrlst="$undef"
18389 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18390 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18391 echo 'strerror() found in string header.' >&4
18392 d_strerror="$define"
18393 d_strerrm='strerror(e)'
18394 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18395 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18396 d_syserrlst="$define"
18398 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18399 d_syserrlst="$undef"
18401 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18402 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18403 d_strerror="$undef"
18404 d_syserrlst="$define"
18405 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18407 echo 'strerror() and sys_errlist[] NOT found.' >&4
18408 d_strerror="$undef"
18409 d_syserrlst="$undef"
18410 d_strerrm='"unknown"'
18414 : see if strerror_r exists
18415 set strerror_r d_strerror_r
18417 case "$d_strerror_r" in
18419 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18420 case "$d_strerror_r_proto:$usethreads" in
18421 ":define") d_strerror_r_proto=define
18422 set d_strerror_r_proto strerror_r $hdrs
18426 case "$d_strerror_r_proto" in
18428 case "$strerror_r_proto" in
18429 ''|0) try='int strerror_r(int, char*, size_t);'
18430 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18432 case "$strerror_r_proto" in
18433 ''|0) try='int strerror_r(int, char*, int);'
18434 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18436 case "$strerror_r_proto" in
18437 ''|0) try='char* strerror_r(int, char*, size_t);'
18438 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18440 case "$strerror_r_proto" in
18441 ''|0) d_strerror_r=undef
18443 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18444 * ) case "$strerror_r_proto" in
18445 REENTRANT_PROTO*) ;;
18446 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18448 echo "Prototype: $try" ;;
18451 *) case "$usethreads" in
18452 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18459 *) strerror_r_proto=0
18463 : see if strftime exists
18464 set strftime d_strftime
18467 : see if strlcat exists
18468 set strlcat d_strlcat
18471 : see if strlcpy exists
18472 set strlcpy d_strlcpy
18475 : see if strtod exists
18476 set strtod d_strtod
18479 : see if strtol exists
18480 set strtol d_strtol
18483 : see if strtold exists
18484 set strtold d_strtold
18487 : see if strtoll exists
18488 set strtoll d_strtoll
18491 case "$d_longlong-$d_strtoll" in
18494 Checking whether your strtoll() works okay...
18496 $cat >try.c <<'EOCP'
18499 #define strtoll __strtoll
18502 #define strtoll _strtoll
18505 extern long long int strtoll(char *s, char **, int);
18506 static int bad = 0;
18507 int check(char *s, long long ell, int een) {
18510 gll = strtoll(s, 0, 10);
18511 if (!((gll == ell) && (errno == een)))
18515 check(" 1", 1LL, 0);
18516 check(" 0", 0LL, 0);
18517 check("-1", -1LL, 0);
18518 check("-9223372036854775808", -9223372036854775808LL, 0);
18519 check("-9223372036854775808", -9223372036854775808LL, 0);
18520 check(" 9223372036854775807", 9223372036854775807LL, 0);
18521 check("-9223372036854775808", -9223372036854775808LL, 0);
18522 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18523 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18529 if eval $compile; then
18532 ok) echo "Your strtoll() seems to be working okay." ;;
18534 Your strtoll() doesn't seem to be working okay.
18540 echo "(I can't seem to compile the test program--assuming it doesn't)"
18546 : see if strtoq exists
18547 set strtoq d_strtoq
18550 : see if strtoul exists
18551 set strtoul d_strtoul
18554 case "$d_strtoul" in
18557 Checking whether your strtoul() works okay...
18559 $cat >try.c <<'EOCP'
18562 extern unsigned long int strtoul(char *s, char **, int);
18563 static int bad = 0;
18564 void check(char *s, unsigned long eul, int een) {
18567 gul = strtoul(s, 0, 10);
18568 if (!((gul == eul) && (errno == een)))
18572 check(" 1", 1L, 0);
18573 check(" 0", 0L, 0);
18575 case "$longsize" in
18577 $cat >>try.c <<'EOCP'
18578 check("18446744073709551615", 18446744073709551615UL, 0);
18579 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18580 #if 0 /* strtoul() for /^-/ strings is undefined. */
18581 check("-1", 18446744073709551615UL, 0);
18582 check("-18446744073709551614", 2, 0);
18583 check("-18446744073709551615", 1, 0);
18584 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18585 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18590 $cat >>try.c <<'EOCP'
18591 check("4294967295", 4294967295UL, 0);
18592 check("4294967296", 4294967295UL, ERANGE);
18593 #if 0 /* strtoul() for /^-/ strings is undefined. */
18594 check("-1", 4294967295UL, 0);
18595 check("-4294967294", 2, 0);
18596 check("-4294967295", 1, 0);
18597 check("-4294967296", 4294967295UL, ERANGE);
18598 check("-4294967297", 4294967295UL, ERANGE);
18603 : Should we write these tests to be more portable by sprintf-ing
18604 : ~0 and then manipulating that char string as input for strtol?
18607 $cat >>try.c <<'EOCP'
18614 if eval $compile; then
18615 case "`$run ./try`" in
18616 ok) echo "Your strtoul() seems to be working okay." ;;
18618 Your strtoul() doesn't seem to be working okay.
18624 echo "(I can't seem to compile the test program--assuming it doesn't)"
18630 : see if strtoull exists
18631 set strtoull d_strtoull
18634 case "$d_longlong-$d_strtoull" in
18637 Checking whether your strtoull() works okay...
18639 $cat >try.c <<'EOCP'
18642 #define strtoull __strtoull
18645 extern unsigned long long int strtoull(char *s, char **, int);
18646 static int bad = 0;
18647 int check(char *s, long long eull, int een) {
18650 gull = strtoull(s, 0, 10);
18651 if (!((gull == eull) && (errno == een)))
18655 check(" 1", 1LL, 0);
18656 check(" 0", 0LL, 0);
18657 check("18446744073709551615", 18446744073709551615ULL, 0);
18658 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18659 #if 0 /* strtoull() for /^-/ strings is undefined. */
18660 check("-1", 18446744073709551615ULL, 0);
18661 check("-18446744073709551614", 2LL, 0);
18662 check("-18446744073709551615", 1LL, 0);
18663 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18664 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18671 if eval $compile; then
18672 case "`$run ./try`" in
18673 ok) echo "Your strtoull() seems to be working okay." ;;
18675 Your strtoull() doesn't seem to be working okay.
18677 d_strtoull="$undef"
18681 echo "(I can't seem to compile the test program--assuming it doesn't)"
18682 d_strtoull="$undef"
18687 : see if strtouq exists
18688 set strtouq d_strtouq
18691 case "$d_strtouq" in
18694 Checking whether your strtouq() works okay...
18696 $cat >try.c <<'EOCP'
18699 extern unsigned long long int strtouq(char *s, char **, int);
18700 static int bad = 0;
18701 void check(char *s, unsigned long long eull, int een) {
18702 unsigned long long gull;
18704 gull = strtouq(s, 0, 10);
18705 if (!((gull == eull) && (errno == een)))
18709 check(" 1", 1LL, 0);
18710 check(" 0", 0LL, 0);
18711 check("18446744073709551615", 18446744073709551615ULL, 0);
18712 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18713 #if 0 /* strtouq() for /^-/ strings is undefined. */
18714 check("-1", 18446744073709551615ULL, 0);
18715 check("-18446744073709551614", 2LL, 0);
18716 check("-18446744073709551615", 1LL, 0);
18717 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18718 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18726 if eval $compile; then
18727 case "`$run ./try`" in
18728 ok) echo "Your strtouq() seems to be working okay." ;;
18730 Your strtouq() doesn't seem to be working okay.
18736 echo "(I can't seem to compile the test program--assuming it doesn't)"
18742 : see if strxfrm exists
18743 set strxfrm d_strxfrm
18746 : see if symlink exists
18747 set symlink d_symlink
18750 : see if syscall exists
18751 set syscall d_syscall
18754 : see if prototype for syscall is available
18756 set d_syscallproto syscall $i_unistd unistd.h
18759 : see if sysconf exists
18760 set sysconf d_sysconf
18763 : see if system exists
18764 set system d_system
18767 : see if tcgetpgrp exists
18768 set tcgetpgrp d_tcgetpgrp
18771 : see if tcsetpgrp exists
18772 set tcsetpgrp d_tcsetpgrp
18775 : see if prototype for telldir is available
18777 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18780 : see if time exists
18782 if test "X$d_time" = X -o X"$timetype" = X; then
18783 if set time val -f d_time; eval $csym; $val; then
18784 echo 'time() found.' >&4
18786 rp="What is the type returned by time() on this system?"
18787 set time_t timetype long stdio.h sys/types.h
18790 echo 'time() not found, hope that will do.' >&4
18798 : see if timegm exists
18799 set timegm d_timegm
18802 : see if this is a sys/times.h system
18803 set sys/times.h i_systimes
18806 : see if times exists
18808 if set times val -f d_times; eval $csym; $val; then
18809 echo 'times() found.' >&4
18812 case "$i_systimes" in
18813 "$define") inc='sys/times.h';;
18815 rp="What is the type returned by times() on this system?"
18816 set clock_t clocktype long stdio.h sys/types.h $inc
18819 echo 'times() NOT found, hope that will do.' >&4
18824 : see if tmpnam_r exists
18825 set tmpnam_r d_tmpnam_r
18827 case "$d_tmpnam_r" in
18829 hdrs="$i_systypes sys/types.h define stdio.h "
18830 case "$d_tmpnam_r_proto:$usethreads" in
18831 ":define") d_tmpnam_r_proto=define
18832 set d_tmpnam_r_proto tmpnam_r $hdrs
18836 case "$d_tmpnam_r_proto" in
18838 case "$tmpnam_r_proto" in
18839 ''|0) try='char* tmpnam_r(char*);'
18840 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18842 case "$tmpnam_r_proto" in
18843 ''|0) d_tmpnam_r=undef
18845 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18846 * ) case "$tmpnam_r_proto" in
18847 REENTRANT_PROTO*) ;;
18848 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18850 echo "Prototype: $try" ;;
18853 *) case "$usethreads" in
18854 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18861 *) tmpnam_r_proto=0
18865 : see if truncate exists
18866 set truncate d_truncate
18869 : see if ttyname_r exists
18870 set ttyname_r d_ttyname_r
18872 case "$d_ttyname_r" in
18874 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18875 case "$d_ttyname_r_proto:$usethreads" in
18876 ":define") d_ttyname_r_proto=define
18877 set d_ttyname_r_proto ttyname_r $hdrs
18881 case "$d_ttyname_r_proto" in
18883 case "$ttyname_r_proto" in
18884 ''|0) try='int ttyname_r(int, char*, size_t);'
18885 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18887 case "$ttyname_r_proto" in
18888 ''|0) try='int ttyname_r(int, char*, int);'
18889 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18891 case "$ttyname_r_proto" in
18892 ''|0) try='char* ttyname_r(int, char*, int);'
18893 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18895 case "$ttyname_r_proto" in
18896 ''|0) d_ttyname_r=undef
18898 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18899 * ) case "$ttyname_r_proto" in
18900 REENTRANT_PROTO*) ;;
18901 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18903 echo "Prototype: $try" ;;
18906 *) case "$usethreads" in
18907 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18914 *) ttyname_r_proto=0
18918 : see if tzname[] exists
18920 if set tzname val -a d_tzname; eval $csym; $val; then
18922 echo 'tzname[] found.' >&4
18925 echo 'tzname[] NOT found.' >&4
18930 : Check if is a multiplatform env
18932 darwin) multiarch="$define" ;;
18934 case "$multiarch" in
18935 ''|[nN]*) multiarch="$undef" ;;
18938 : check for ordering of bytes in a UV
18940 case "$multiarch" in
18943 You seem to be doing a multiarchitecture build,
18944 skipping the byteorder check.
18950 case "$byteorder" in
18953 In the following, larger digits indicate more significance. A big-endian
18954 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18955 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18956 machines may have weird orders like 3412. A Cray will report 87654321,
18957 an Alpha will report 12345678. If the test program works the default is
18959 I'm now running the test program...
18963 #$i_stdlib I_STDLIB
18965 #include <stdlib.h>
18967 #include <sys/types.h>
18968 typedef $uvtype UV;
18978 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18980 u.l = (UV)0x04030201;
18981 for (i = 0; i < $uvsize; i++)
18982 printf("%c", u.c[i]+'0');
18989 if eval $compile && $run ./try > /dev/null; then
18992 [1-4][1-4][1-4][1-4]|12345678|87654321)
18993 echo "(The test program ran ok.)"
18994 echo "byteorder=$dflt"
18997 ????|????????) echo "(The test program ran ok.)" ;;
18998 *) echo "(The test program didn't run right for some reason.)" ;;
19003 (I can't seem to compile the test program. Guessing big-endian...)
19006 case "$xxx_prompt" in
19008 rp="What is the order of bytes in $uvtype?"
19021 : Checking 32bit alignedness
19024 Checking to see whether you can access character data unalignedly...
19026 case "$d_u32align" in
19027 '') $cat >try.c <<EOCP
19029 #$i_stdlib I_STDLIB
19031 #include <stdlib.h>
19033 #define U32 $u32type
19034 #define BYTEORDER 0x$byteorder
19036 #include <signal.h>
19038 $signal_t bletch(int s) { exit(4); }
19041 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19042 volatile U8 buf[8];
19046 if (sizeof(U32) != 4) {
19047 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19054 signal(SIGBUS, bletch);
19066 for (i = 0; i < 4; i++) {
19067 up = (U32*)(buf + i);
19068 if (! ((*up == 1 << (8*i)) || /* big-endian */
19069 (*up == 1 << (8*(3-i))) /* little-endian */
19073 printf("read failed (%x)\n", *up);
19079 for (i = 0; i < 4; i++) {
19080 up = (U32*)(buf + i);
19082 if (*up != 0xBeef) {
19083 printf("write failed (%x)\n", *up);
19097 if eval $compile_ok; then
19098 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19099 $run ./try 2>&1 >/dev/null
19102 You can access character data pretty unalignedly.
19104 d_u32align="$undef"
19107 It seems that you must access character data in an aligned manner.
19109 d_u32align="$define"
19113 rp='Can you access character data at unaligned addresses?'
19117 [yY]*) d_u32align="$undef" ;;
19118 *) d_u32align="$define" ;;
19125 : see if ualarm exists
19126 set ualarm d_ualarm
19129 : see if umask exists
19133 : see if unordered exists
19134 set unordered d_unordered
19137 : see if unsetenv exists
19138 set unsetenv d_unsetenv
19141 : see if usleep exists
19142 set usleep d_usleep
19145 : see if prototype for usleep is available
19147 set d_usleepproto usleep $i_unistd unistd.h
19150 : see if ustat exists
19154 : see if closedir exists
19155 set closedir d_closedir
19158 case "$d_closedir" in
19161 echo "Checking whether closedir() returns a status..." >&4
19163 #$i_dirent I_DIRENT /**/
19164 #$i_sysdir I_SYS_DIR /**/
19165 #$i_sysndir I_SYS_NDIR /**/
19166 #$i_systypes I_SYS_TYPES /**/
19168 #if defined(I_SYS_TYPES)
19169 #include <sys/types.h>
19171 #if defined(I_DIRENT)
19172 #include <dirent.h>
19175 #include <sys/ndir.h>
19179 #include <ndir.h> /* may be wrong in the future */
19181 #include <sys/dir.h>
19186 int main() { return closedir(opendir(".")); }
19189 if eval $compile_ok; then
19190 if $run ./try > /dev/null 2>&1 ; then
19191 echo "Yes, it does."
19194 echo "No, it doesn't."
19198 echo "(I can't seem to compile the test program--assuming it doesn't)"
19206 set d_void_closedir
19210 : see if there is a wait4
19214 : see if waitpid exists
19215 set waitpid d_waitpid
19220 $cat >try.c <<'EOCP'
19226 return (wcscmp (s, s) ? 1 : 0);
19231 if eval $compile; then
19234 0) echo "A working wcscmp() found." >&4
19236 *) echo "wcscmp() found, but it doesn't work" >&4
19240 echo "wcscmp() NOT found." >&4
19246 : see if wcstombs exists
19247 set wcstombs d_wcstombs
19252 $cat >try.c <<'EOCP'
19257 wchar_t dst[4], *src = L" ";
19259 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19264 if eval $compile; then
19267 0) echo "A working wcsxfrm() found." >&4
19269 *) echo "wcsxfrm() found, but it doesn't work" >&4
19273 echo "wcsxfrm() NOT found." >&4
19279 : see if wctomb exists
19280 set wctomb d_wctomb
19283 : see if writev exists
19284 set writev d_writev
19287 : check for alignment requirements
19289 case "$alignbytes" in
19290 '') echo "Checking alignment constraints..." >&4
19291 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19292 $cat >try.c <<'EOCP'
19293 typedef long double NV;
19296 $cat >try.c <<'EOCP'
19300 $cat >>try.c <<'EOCP'
19308 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19313 if eval $compile_ok; then
19317 echo "(I can't seem to compile the test program...)"
19319 case "$multiarch" in
19321 : The usual safe value is 8, but Darwin with -Duselongdouble
19322 : needs 16. Hence, we will take 8 as a minimum, but allow
19323 : Configure to pick a larger value if needed.
19324 if $test "$dflt" -lt 8; then
19326 echo "Setting alignment to 8 for multiarch support.">&4
19331 *) dflt="$alignbytes"
19334 rp="Doubles must be aligned on a how-many-byte boundary?"
19339 : set the base revision
19342 : length of character in bytes. Is always 1, otherwise it is not C
19343 : This used to be a test using sizeof
19346 : Check for the number of bits in a character
19347 case "$charbits" in
19348 '') echo "Checking how long a character is (in bits)..." >&4
19355 for (c = 1, n = 0; c; c <<= 1, n++) ;
19356 printf ("%d\n", n);
19361 if eval $compile_ok; then
19365 echo "(I can't seem to compile the test program. Guessing...)"
19372 rp="What is the length of a character (in bits)?"
19376 case "$charbits" in
19379 Your system has an unsigned character size of $charbits bits, which
19380 is rather unusual (normally it is 8 bits). Perl likely will not work
19381 correctly on your system, with subtle bugs in various places.
19383 rp='Do you really want to continue?'
19387 [yY]) echo >&4 "Okay, continuing." ;;
19392 : how do we concatenate cpp tokens here?
19394 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19395 $cat >cpp_stuff.c <<'EOCP'
19396 #define RCAT(a,b)a/**/b
19397 #define ACAT(a,b)a ## b
19401 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19402 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19403 echo "Oh! Smells like ANSI's been here." >&4
19404 echo "We can catify or stringify, separately or together!"
19406 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19407 echo "Ah, yes! The good old days!" >&4
19408 echo "However, in the good old days we don't know how to stringify and"
19409 echo "catify at the same time."
19413 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19414 You're going to have to edit the values of CAT[2-5] in config.h...
19416 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19420 : see if this is a db.h system
19426 : Check db version.
19428 echo "Checking Berkeley DB version ..." >&4
19434 #include <sys/types.h>
19436 #$i_stdlib I_STDLIB
19438 #include <stdlib.h>
19441 int main(int argc, char *argv[])
19443 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19444 int Major, Minor, Patch ;
19445 unsigned long Version ;
19446 (void)db_version(&Major, &Minor, &Patch) ;
19448 printf("%d %d %d %d %d %d\n",
19449 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19450 Major, Minor, Patch);
19453 printf("You have Berkeley DB Version 2 or greater.\n");
19455 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19456 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19457 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19458 Major, Minor, Patch) ;
19460 /* check that db.h & libdb are compatible */
19461 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19462 printf("db.h and libdb are incompatible.\n") ;
19466 printf("db.h and libdb are compatible.\n") ;
19468 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19469 + DB_VERSION_PATCH ;
19471 /* needs to be >= 2.3.4 */
19472 if (Version < 2003004) {
19473 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19474 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19480 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19485 printf("You have Berkeley DB Version 1.\n");
19486 exit(0); /* DB version < 2: the coast is clear. */
19488 exit(1); /* <db.h> not Berkeley DB? */
19494 if eval $compile_ok && $run ./try; then
19495 echo 'Looks OK.' >&4
19497 db_version_major=$1
19498 db_version_minor=$2
19499 db_version_patch=$3
19501 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19505 : Remove db from list of libraries to use
19506 echo "Removing unusable -ldb from library list" >&4
19507 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19510 echo "libs = $libs" >&4
19520 : Check the return type needed for hash
19522 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19528 #include <sys/types.h>
19531 #ifndef DB_VERSION_MAJOR
19532 u_int32_t hash_cb (const void* ptr, size_t size)
19538 info.hash = hash_cb;
19542 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19543 if $contains warning try.out >>/dev/null 2>&1 ; then
19546 db_hashtype='u_int32_t'
19549 : XXX Maybe we should just give up here.
19550 db_hashtype=u_int32_t
19552 echo "Help: I can't seem to compile the db test program." >&4
19553 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19556 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19558 *) db_hashtype=u_int32_t
19563 : Check the return type needed for prefix
19565 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19571 #include <sys/types.h>
19574 #ifndef DB_VERSION_MAJOR
19575 size_t prefix_cb (const DBT *key1, const DBT *key2)
19581 info.prefix = prefix_cb;
19585 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19586 if $contains warning try.out >>/dev/null 2>&1 ; then
19587 db_prefixtype='int'
19589 db_prefixtype='size_t'
19592 db_prefixtype='size_t'
19593 : XXX Maybe we should just give up here.
19595 echo "Help: I can't seem to compile the db test program." >&4
19596 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19599 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19601 *) db_prefixtype='size_t'
19605 : How can we generate normalized random numbers ?
19607 echo "Using our internal random number implementation..." >&4
19610 *-Dmy_rand=*|*-Dmy_srand=*)
19611 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19612 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19613 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19614 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19618 randfunc=Perl_drand48
19619 drand01="Perl_drand48()"
19620 seedfunc="Perl_drand48_init"
19624 : Determine if this is an EBCDIC system
19626 echo "Determining whether or not we are on an EBCDIC system..." >&4
19627 $cat >try.c <<'EOM'
19630 if ('M'==0xd4) return 0;
19637 if eval $compile_ok; then
19638 if $run ./try; then
19639 echo "You seem to speak EBCDIC." >&4
19642 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19645 echo "I'm unable to compile the test program." >&4
19646 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19652 : Check how to flush
19655 Checking how to flush all pending stdio output...
19657 # I only know how to find the first 32 possibly open files on SunOS.
19658 # See also hints/sunos_4_1.sh and util.c --AD
19660 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19662 $cat >>try.c <<EOCP
19664 #$i_stdlib I_STDLIB
19666 #include <stdlib.h>
19668 #$i_unistd I_UNISTD
19670 # include <unistd.h>
19672 #$d_sysconf HAS_SYSCONF
19673 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19674 #ifdef HAS_STDIO_STREAM_ARRAY
19675 # define STDIO_STREAM_ARRAY $stdio_stream_array
19680 p = fopen("try.out", "w");
19684 # ifdef TRY_FPRINTF
19688 #ifdef TRY_FFLUSH_NULL
19691 #ifdef TRY_FFLUSH_ALL
19693 long open_max = -1;
19694 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19695 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19697 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19698 open_max = sysconf(_SC_OPEN_MAX);
19701 open_max = FOPEN_MAX;
19704 open_max = OPEN_MAX;
19713 # ifdef HAS_STDIO_STREAM_ARRAY
19714 if (open_max > 0) {
19716 for (i = 0; i < open_max; i++)
19717 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19718 STDIO_STREAM_ARRAY[i]._file < open_max &&
19719 STDIO_STREAM_ARRAY[i]._flag)
19720 fflush(&STDIO_STREAM_ARRAY[i]);
19728 : first we have to find out how _not_ to flush
19730 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19732 set try -DTRY_FPUTC
19733 if eval $compile; then
19734 $run ./try 2>/dev/null
19737 if $test ! -s try.out -a "X$code" = X42; then
19743 set try -DTRY_FPRINTF
19744 if eval $compile; then
19745 $run ./try 2>/dev/null
19748 if $test ! -s try.out -a "X$code" = X42; then
19749 output=-DTRY_FPRINTF
19755 : check for fflush NULL behavior
19756 case "$fflushNULL" in
19757 '') set try -DTRY_FFLUSH_NULL $output
19758 if eval $compile; then
19759 $run ./try 2>/dev/null
19762 if $test -s try.out -a "X$code" = X42; then
19763 fflushNULL="`$cat try.out`"
19765 if $test "X$code" != X42; then
19767 (If this test failed, don't worry, we'll try another method shortly.)
19772 $rm -f core try.core core.try.*
19773 case "$fflushNULL" in
19775 Your fflush(NULL) works okay for output streams.
19776 Let's see if it clobbers input pipes...
19778 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19779 # bug that improperly flushes the input end of pipes. So we avoid the
19780 # autoflush on fork/system/exec support for now. :-(
19781 $cat >tryp.c <<EOCP
19784 main(int argc, char **argv)
19790 while ((i = getc(stdin)) != -1
19791 && (*bp++ = i) != '\n'
19792 && bp < &buf[1024])
19795 fprintf(stdout, "%s", buf);
19803 fflushNULL="$define"
19805 if eval $compile; then
19807 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19808 if $test "X$targethost" != X; then
19811 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19813 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19815 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19817 fflush(NULL) seems to behave okay with input streams.
19819 fflushNULL="$define"
19822 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19824 fflushNULL="$undef"
19827 $rm -f core tryp.c tryp.core core.tryp.*
19830 Your fflush(NULL) isn't working (contrary to ANSI C).
19832 fflushNULL="$undef"
19835 Cannot figure out whether your fflush(NULL) works or not.
19836 I'm assuming it doesn't (contrary to ANSI C).
19838 fflushNULL="$undef"
19842 $define|true|[yY]*)
19843 fflushNULL="$define"
19846 fflushNULL="$undef"
19849 : check explicit looping only if NULL did not work, and if the pipe
19850 : bug does not show up on an explicit flush too
19851 case "$fflushNULL" in
19853 $cat >tryp.c <<EOCP
19856 main(int argc, char **argv)
19862 while ((i = getc(stdin)) != -1
19863 && (*bp++ = i) != '\n'
19864 && bp < &buf[1024])
19867 fprintf(stdout, "%s", buf);
19876 if eval $compile; then
19878 if $test "X$targethost" != X; then
19881 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19883 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19885 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19887 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19889 : now check for fflushall behaviour
19890 case "$fflushall" in
19891 '') set try -DTRY_FFLUSH_ALL $output
19892 if eval $compile; then
19894 (Now testing the other method--but note that this also may fail.)
19896 $run ./try 2>/dev/null
19899 if $test -s try.out -a "X$code" = X42; then
19900 fflushall="`$cat try.out`"
19904 case "$fflushall" in
19906 Whew. Flushing explicitly all the stdio streams works.
19908 fflushall="$define"
19911 Sigh. Flushing explicitly all the stdio streams doesn't work.
19916 Cannot figure out whether flushing stdio streams explicitly works or not.
19917 I'm assuming it doesn't.
19923 "$define"|true|[yY]*)
19924 fflushall="$define"
19932 All is futile. Even fflush(stdin) clobbers input pipes!
19939 $rm -f core tryp.c tryp.core core.tryp.*
19941 *) fflushall="$undef"
19945 case "$fflushNULL$fflushall" in
19948 OK, I give up. I cannot figure out how to flush pending stdio output.
19949 We won't be flushing handles at all before fork/exec/popen.
19955 : Store the full pathname to the ar program for use in the C program
19956 : Respect a hint or command line value for full_ar.
19961 : Store the full pathname to the sed program for use in the C program
19964 : see what type gids are declared as in the kernel
19966 echo "Looking for the type for group ids returned by getgid()."
19967 set gid_t gidtype xxx stdio.h sys/types.h
19971 xxx=`./findhdr sys/user.h`
19972 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19974 unsigned) dflt="$1 $2" ;;
19978 *) dflt="$gidtype";;
19981 gid_t) echo "gid_t found." ;;
19982 *) rp="What is the type for group ids returned by getgid()?"
19988 : Check the size of GID
19991 *_t) zzz="$gidtype" ;;
19994 echo "Checking the size of $zzz..." >&4
19996 #include <sys/types.h>
19998 #$i_stdlib I_STDLIB
20000 #include <stdlib.h>
20003 printf("%d\n", (int)sizeof($gidtype));
20008 if eval $compile_ok; then
20012 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20015 echo "Your $zzz is $gidsize bytes long."
20020 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20024 : Check if GID is signed
20027 *_t) zzz="$gidtype" ;;
20030 echo "Checking the sign of $zzz..." >&4
20032 #include <sys/types.h>
20043 if eval $compile; then
20047 echo "(I can't execute the test program--guessing unsigned.)" >&4
20051 1) echo "Your $zzz is unsigned." ;;
20052 -1) echo "Your $zzz is signed." ;;
20058 echo "(I can't compile the test program--guessing unsigned.)" >&4
20062 : Check 64bit sizes
20065 if $test X"$quadtype" != X; then
20067 echo "Checking how to print 64-bit integers..." >&4
20069 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20070 $cat >try.c <<'EOCP'
20071 #include <sys/types.h>
20074 int q = 12345678901;
20075 printf("%ld\n", q);
20079 if eval $compile; then
20083 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20084 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20085 echo "We will use %d."
20091 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20092 $cat >try.c <<'EOCP'
20093 #include <sys/types.h>
20096 long q = 12345678901;
20097 printf("%ld\n", q);
20101 if eval $compile; then
20105 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20106 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20107 echo "We will use %ld."
20113 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20114 $cat >try.c <<'EOCP'
20115 #include <sys/types.h>
20116 #include <inttypes.h>
20119 int64_t q = 12345678901;
20120 printf("%" PRId64 "\n", q);
20124 if eval $compile; then
20128 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20129 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20130 echo "We will use the C9X style."
20136 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20138 #include <sys/types.h>
20141 $quadtype q = 12345678901;
20142 printf("%Ld\n", q);
20146 if eval $compile; then
20150 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20151 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20152 echo "We will use %Ld."
20158 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20159 $cat >try.c <<'EOCP'
20160 #include <sys/types.h>
20163 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20164 printf("%lld\n", q);
20168 if eval $compile; then
20172 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20173 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20174 echo "We will use the %lld style."
20180 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20182 #include <sys/types.h>
20185 $quadtype q = 12345678901;
20186 printf("%qd\n", q);
20190 if eval $compile; then
20194 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20195 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20196 echo "We will use %qd."
20202 if $test X"$sPRId64" = X; then
20203 echo "Cannot figure out how to print 64-bit integers." >&4
20210 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20211 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20213 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20214 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20218 : Check format strings for internal types
20220 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20222 if $test X"$ivsize" = X8; then
20223 ivdformat="$sPRId64"
20224 uvuformat="$sPRIu64"
20225 uvoformat="$sPRIo64"
20226 uvxformat="$sPRIx64"
20227 uvXUformat="$sPRIXU64"
20229 if $test X"$ivsize" = X"$longsize"; then
20236 if $test X"$ivsize" = X"$intsize"; then
20244 if $test X"$ivsize" = X"$shortsize"; then
20255 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20256 nveformat="$sPRIeldbl"
20257 nvfformat="$sPRIfldbl"
20258 nvgformat="$sPRIgldbl"
20259 nvEUformat="$sPRIEUldbl"
20260 nvFUformat="$sPRIFUldbl"
20261 nvGUformat="$sPRIGUldbl"
20271 case "$ivdformat" in
20272 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20277 : Check format string for GID
20280 $echo "Checking the format string to be used for gids..." >&4
20283 -1) if $test X"$gidsize" = X"$ivsize"; then
20284 gidformat="$ivdformat"
20286 if $test X"$gidsize" = X"$longsize"; then
20289 if $test X"$gidsize" = X"$intsize"; then
20292 if $test X"$gidsize" = X"$shortsize"; then
20299 *) if $test X"$gidsize" = X"$uvsize"; then
20300 gidformat="$uvuformat"
20302 if $test X"$gidsize" = X"$longsize"; then
20305 if $test X"$gidsize" = X"$intsize"; then
20308 if $test X"$gidsize" = X"$shortsize"; then
20317 : see if getgroups exists
20318 set getgroups d_getgrps
20321 : see if setgroups exists
20322 set setgroups d_setgrps
20325 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20327 case "$d_getgrps$d_setgrps" in
20329 case "$groupstype" in
20330 '') dflt="$gidtype" ;;
20331 *) dflt="$groupstype" ;;
20334 What type of pointer is the second argument to getgroups() and setgroups()?
20335 Usually this is the same as group ids, $gidtype, but not always.
20338 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20342 *) groupstype="$gidtype";;
20345 : check whether make sets MAKE
20347 echo "Checking if your $make program sets \$(MAKE)..." >&4
20348 case "$make_set_make" in
20350 $sed 's/^X //' > testmake.mak << 'EOF'
20352 X @echo 'maketemp="$(MAKE)"'
20354 case "`$make -f testmake.mak 2>/dev/null`" in
20355 *maketemp=*) make_set_make='#' ;;
20356 *) make_set_make="MAKE=$make" ;;
20358 $rm -f testmake.mak
20361 case "$make_set_make" in
20362 '#') echo "Yup, it does.";;
20363 *) echo "Nope, it doesn't.";;
20366 : see what type is used for mode_t
20367 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20368 set mode_t modetype int stdio.h sys/types.h
20371 : see if we need va_copy
20373 case "$i_stdarg" in
20376 #include <stdarg.h>
20378 #$i_stdlib I_STDLIB
20380 #include <stdlib.h>
20382 #include <signal.h>
20385 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20387 return vfprintf(f, fmt, *valp);
20391 myvfprintf(FILE *f, const char *fmt, va_list val)
20393 return ivfprintf(f, fmt, &val);
20397 myprintf(char *fmt, ...)
20400 va_start(val, fmt);
20401 return myvfprintf(stdout, fmt, val);
20405 main(int ac, char **av)
20407 signal(SIGSEGV, exit);
20409 myprintf("%s%cs all right, then\n", "that", '\'');
20414 if eval $compile && $run ./try 2>&1 >/dev/null; then
20415 case "`$run ./try`" in
20416 "that's all right, then")
20422 yes) echo "It seems that you don't need va_copy()." >&4
20423 need_va_copy="$undef"
20425 *) echo "It seems that va_copy() or similar will be needed." >&4
20426 need_va_copy="$define"
20431 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20432 need_va_copy="$undef"
20436 : see what type is used for size_t
20437 rp="What is the type used for the length parameter for string functions?"
20438 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20441 : check for type of arguments to gethostbyaddr.
20442 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20443 case "$d_gethbyaddr" in
20447 Checking to see what type of arguments are accepted by gethostbyaddr().
20449 hdrs="$define sys/types.h
20450 $d_socket sys/socket.h
20451 $i_niin netinet/in.h
20453 $i_unistd unistd.h"
20454 : The first arg can 'char *' or 'void *'
20455 : The second arg is some of integral type
20456 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20457 for yyy in size_t long int; do
20458 case "$netdb_host_type" in
20459 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20460 if ./protochk "$try" $hdrs; then
20461 echo "Your system accepts $xxx for the first arg."
20462 echo "...and $yyy for the second arg."
20463 netdb_host_type="$xxx"
20464 netdb_hlen_type="$yyy"
20470 : In case none of those worked, prompt the user.
20471 case "$netdb_host_type" in
20472 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20475 netdb_host_type=$ans
20476 rp='What is the type for the 2nd argument to gethostbyaddr?'
20479 netdb_hlen_type=$ans
20483 *) : no gethostbyaddr, so pick harmless defaults
20484 netdb_host_type='char *'
20485 netdb_hlen_type="$sizetype"
20488 # Remove the "const" if needed. -- but then we'll have a
20490 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20493 : check for type of argument to gethostbyname.
20494 if test "X$netdb_name_type" = X ; then
20495 case "$d_gethbyname" in
20499 Checking to see what type of argument is accepted by gethostbyname().
20501 hdrs="$define sys/types.h
20502 $d_socket sys/socket.h
20503 $i_niin netinet/in.h
20505 $i_unistd unistd.h"
20506 for xxx in "const char *" "char *"; do
20507 case "$netdb_name_type" in
20508 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20509 if ./protochk "$try" $hdrs; then
20510 echo "Your system accepts $xxx."
20511 netdb_name_type="$xxx"
20516 : In case none of those worked, prompt the user.
20517 case "$netdb_name_type" in
20518 '') rp='What is the type for the 1st argument to gethostbyname?'
20521 netdb_name_type=$ans
20525 *) : no gethostbyname, so pick harmless default
20526 netdb_name_type='char *'
20531 : check for type of 1st argument to getnetbyaddr.
20532 if test "X$netdb_net_type" = X ; then
20533 case "$d_getnbyaddr" in
20537 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20539 hdrs="$define sys/types.h
20540 $d_socket sys/socket.h
20541 $i_niin netinet/in.h
20543 $i_unistd unistd.h"
20544 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20545 case "$netdb_net_type" in
20546 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20547 if ./protochk "$try" $hdrs; then
20548 echo "Your system accepts $xxx."
20549 netdb_net_type="$xxx"
20554 : In case none of those worked, prompt the user.
20555 case "$netdb_net_type" in
20556 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20559 netdb_net_type=$ans
20563 *) : no getnetbyaddr, so pick harmless default
20564 netdb_net_type='long'
20568 : locate the preferred pager for this system
20575 [a-zA-Z]:/*) dflt=$pg;;
20579 [a-zA-Z]:/*) dflt=$more;;
20583 [a-zA-Z]:/*) dflt=$less;;
20586 '') dflt=/usr/ucb/more;;
20594 rp='What pager is used on your system?'
20598 : see what type pids are declared as in the kernel
20599 rp="What is the type of process ids on this system?"
20600 set pid_t pidtype int stdio.h sys/types.h
20603 : see if ar generates random libraries by itself
20605 echo "Checking how to generate random libraries on your machine..." >&4
20606 echo 'int bar1() { return bar2(); }' > bar1.c
20607 echo 'int bar2() { return 2; }' > bar2.c
20609 #$i_stdlib I_STDLIB
20611 #include <stdlib.h>
20613 int main() { printf("%d\n", bar1()); exit(0); }
20615 $cc $ccflags -c bar1.c >/dev/null 2>&1
20616 $cc $ccflags -c bar2.c >/dev/null 2>&1
20617 $cc $ccflags -c foo.c >/dev/null 2>&1
20618 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20619 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20620 $run ./foobar >/dev/null 2>&1; then
20621 echo "$ar appears to generate random libraries itself."
20623 if [ "X$ranlib" = "X" ]; then
20626 elif $ar s bar$_a >/dev/null 2>&1 &&
20627 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20628 $run ./foobar >/dev/null 2>&1; then
20629 echo "a table of contents needs to be added with '$ar s'."
20632 elif $ar ts bar$_a >/dev/null 2>&1 &&
20633 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20634 $run ./foobar >/dev/null 2>&1; then
20635 echo "a table of contents needs to be added with '$ar ts'."
20642 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20643 $test -f $ranlib || ranlib=''
20646 if $test -n "$ranlib"; then
20647 echo "your system has '$ranlib'; we'll use that."
20650 echo "your system doesn't seem to support random libraries"
20651 echo "so we'll use lorder and tsort to order the libraries."
20658 : see if this is a values.h system
20659 set values.h i_values
20662 : Check the max offset that gmtime and localtime accept
20663 echo "Checking max offsets that gmtime () accepts"
20666 define) yyy="#include <values.h>" ;;
20670 case "$sGMTIME_min/$sGMTIME_max" in
20673 #include <sys/types.h>
20682 void gm_check (time_t t, int min_year, int max_year)
20685 if ( tmp == NULL ||
20686 /* Check tm_year overflow */
20687 tmp->tm_year < min_year || tmp->tm_year > max_year)
20698 gm_check (MAXLONG, 69, 0x7fffffff);
20700 if (tmp == NULL || tmp->tm_year < 0) {
20701 for (i = 63; i >= 0; i--) {
20702 time_t x = pt | ((time_t)1 << i);
20703 if (x < 0 || x < pt) continue;
20704 gm_check (x, 69, 0x7fffffff);
20707 printf ("sGMTIME_max=%ld\n", pt);
20716 gm_check (MINLONG, -1900, 70);
20719 for (i = 36; i >= 0; i--) {
20720 time_t x = pt - ((time_t)1 << i);
20721 if (x > 0) continue;
20722 gm_check (x, -1900, 70);
20725 printf ("sGMTIME_min=%ld\n", pt);
20729 int main (int argc, char *argv[])
20731 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20738 if eval $compile; then
20741 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20747 echo "Checking max offsets that localtime () accepts"
20749 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20752 #include <sys/types.h>
20761 void local_check (time_t t, int min_year, int max_year)
20763 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20766 tmp = localtime (&t);
20767 if ( tmp == NULL ||
20768 /* Check tm_year overflow */
20769 tmp->tm_year < min_year || tmp->tm_year > max_year)
20773 } /* local_check */
20780 local_check (MAXLONG, 69, 0x7fffffff);
20782 if (tmp == NULL || tmp->tm_year < 0) {
20783 for (i = 63; i >= 0; i--) {
20784 time_t x = pt | ((time_t)1 << i);
20785 if (x < 0 || x < pt) continue;
20786 local_check (x, 69, 0x7fffffff);
20789 printf ("sLOCALTIME_max=%ld\n", pt);
20798 local_check (MINLONG, -1900, 70);
20801 for (i = 36; i >= 0; i--) {
20802 time_t x = pt - ((time_t)1 << i);
20803 if (x > 0) continue;
20804 local_check (x, -1900, 70);
20807 printf ("sLOCALTIME_min=%ld\n", pt);
20811 int main (int argc, char *argv[])
20819 if eval $compile; then
20822 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20828 : check for type of arguments to select.
20829 case "$selecttype" in
20830 '') case "$d_select" in
20834 Checking to see what type of arguments are accepted by select().
20836 hdrs="$define sys/types.h
20837 $i_systime sys/time.h
20838 $i_sysselct sys/select.h
20839 $d_socket sys/socket.h"
20840 : The first arg can be int, unsigned, or size_t
20841 : The last arg may or may not be 'const'
20843 : void pointer has been seen but using that
20844 : breaks the selectminbits test
20845 for xxx in 'fd_set *' 'int *'; do
20846 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20847 for tmo in 'struct timeval *' 'const struct timeval *'; do
20849 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20850 if ./protochk "$try" $hdrs; then
20851 echo "Your system accepts $xxx."
20860 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20861 case "$d_fd_set" in
20862 $define) dflt="fd_set *" ;;
20871 *) : no select, so pick a harmless default
20878 : check for the select 'width'
20879 case "$selectminbits" in
20880 '') safebits=`expr $ptrsize \* 8`
20881 case "$d_select" in
20885 Checking to see on how many bits at a time your select() operates...
20888 #include <sys/types.h>
20890 #$i_systime I_SYS_TIME
20891 #$i_systimek I_SYS_TIME_KERNEL
20896 # ifdef I_SYS_TIME_KERNEL
20899 # include <sys/time.h>
20900 # ifdef I_SYS_TIME_KERNEL
20904 #$i_sysselct I_SYS_SELECT
20905 #ifdef I_SYS_SELECT
20906 #include <sys/select.h>
20908 #$d_socket HAS_SOCKET
20910 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20913 #$i_stdlib I_STDLIB
20915 #include <stdlib.h>
20918 #define S sizeof(*(b))
20920 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20921 #define NBITS (NBYTES * 8)
20923 char *s = (char *)malloc(NBYTES);
20932 fp = fopen("try.c", "r");
20938 b = ($selecttype)s;
20939 for (i = 0; i < NBITS; i++)
20943 select(fd + 1, b, 0, 0, &t);
20944 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20946 printf("%d\n", i + 1);
20951 if eval $compile_ok; then
20952 selectminbits=`$run ./try`
20953 case "$selectminbits" in
20955 Cannot figure out on how many bits at a time your select() operates.
20956 I'll play safe and guess it is $safebits bits.
20958 selectminbits=$safebits
20959 bits="$safebits bits"
20962 *) bits="$selectminbits bits" ;;
20964 echo "Your select() operates on $bits at a time." >&4
20966 rp='What is the minimum number of bits your select() operates on?'
20967 case "$byteorder" in
20968 12345678) dflt=64 ;;
20974 selectminbits="$val"
20978 *) : no select, so pick a harmless default
20979 selectminbits=$safebits
20985 : Trace out the files included by signal.h, then look for SIGxxx names.
20986 if [ "X$fieldn" = X ]; then
20987 : Just make some guesses. We check them later.
20988 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
20990 xxx=`echo '#include <signal.h>' |
20991 $cppstdin $cppminus $cppflags 2>/dev/null |
20992 $grep '^[ ]*#.*include' |
20993 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20994 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20997 for xx in $xxx /dev/null ; do
20998 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21000 case "$xxxfiles" in
21001 '') xxxfiles=`./findhdr signal.h` ;;
21004 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21005 print substr($2, 4, 20)
21007 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21008 print substr($3, 4, 20)
21010 : Append some common names just in case the awk scan failed.
21011 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21012 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21013 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21014 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21015 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21017 : generate a few handy files for later
21018 $cat > signal.c <<EOCP
21019 #include <sys/types.h>
21020 #include <signal.h>
21021 #$i_stdlib I_STDLIB
21023 #include <stdlib.h>
21028 /* Strange style to avoid deeply-nested #if/#else/#endif */
21031 # define NSIG (_NSIG)
21037 # define NSIG (SIGMAX+1)
21043 # define NSIG (SIG_MAX+1)
21049 # define NSIG (_SIG_MAX+1)
21055 # define NSIG (MAXSIG+1)
21061 # define NSIG (MAX_SIG+1)
21066 # ifdef SIGARRAYSIZE
21067 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21073 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21077 /* Default to some arbitrary number that's big enough to get most
21078 of the common signals.
21084 printf("NSIG %d\n", NSIG);
21090 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21092 printf "#ifdef SIG"; printf $1; printf "\n"
21093 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21094 printf $1; printf ");\n"
21098 printf "#endif /* JUST_NSIG */\n";
21099 printf "exit(0);\n}\n";
21102 $cat >signal.awk <<'EOP'
21103 BEGIN { ndups = 0 }
21104 $1 ~ /^NSIG$/ { nsig = $2 }
21105 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21106 if ($2 > maxsig) { maxsig = $2 }
21107 if (sig_name[$2]) {
21108 dup_name[ndups] = $1
21109 dup_num[ndups] = $2
21121 printf("NSIG %d\n", nsig);
21122 for (n = 1; n < nsig; n++) {
21124 printf("%s %d\n", sig_name[n], sig_num[n])
21127 printf("NUM%d %d\n", n, n)
21130 for (n = 0; n < ndups; n++) {
21131 printf("%s %d\n", dup_name[n], dup_num[n])
21135 $cat >signal_cmd <<EOS
21137 if $test -s signal.lst; then
21138 echo "Using your existing signal.lst file"
21143 $cat >>signal_cmd <<'EOS'
21146 if eval $compile_ok; then
21147 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21148 $uniq | $awk -f signal.awk >signal.lst
21150 echo "(I can't seem be able to compile the whole test program)" >&4
21151 echo "(I'll try it in little pieces.)" >&4
21152 set signal -DJUST_NSIG
21153 if eval $compile_ok; then
21154 $run ./signal$_exe > signal.nsg
21157 echo "I can't seem to figure out how many signals you have." >&4
21158 echo "Guessing 50." >&4
21159 echo 'NSIG 50' > signal.nsg
21161 : Now look at all the signal names, one at a time.
21162 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21163 $cat > signal.c <<EOCP
21164 #include <sys/types.h>
21165 #include <signal.h>
21168 printf("$xx %d\n", SIG${xx});
21173 if eval $compile; then
21174 echo "SIG${xx} found."
21175 $run ./signal$_exe >> signal.ls1
21177 echo "SIG${xx} NOT found."
21180 if $test -s signal.ls1; then
21181 $cat signal.nsg signal.ls1 |
21182 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21186 if $test -s signal.lst; then
21189 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21190 echo 'kill -l' >signal
21191 set X `csh -f <signal`
21195 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21197 echo $@ | $tr ' ' $trnl | \
21198 $awk '{ printf "%s %d\n", $1, ++s; }
21199 END { printf "NSIG %d\n", ++s }' >signal.lst
21201 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21203 chmod a+x signal_cmd
21204 $eunicefix signal_cmd
21206 : generate list of signal names
21208 case "$sig_name_init" in
21210 *) case "$sig_num_init" in
21211 ''|*,*) doinit=yes ;;
21216 echo "Generating a list of signal names and numbers..." >&4
21218 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21219 sig_name=`$awk 'BEGIN { printf "ZERO " }
21220 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21221 sig_num=`$awk 'BEGIN { printf "0 " }
21222 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21223 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21224 !/^NSIG/ { printf "\"%s\", ", $1 }
21225 END { printf "0\n" }' signal.lst`
21226 sig_num_init=`$awk 'BEGIN { printf "0, " }
21227 !/^NSIG/ { printf "%d, ", $2}
21228 END { printf "0\n"}' signal.lst`
21231 echo "The following $sig_count signals are available:"
21233 echo $sig_name | $awk \
21234 'BEGIN { linelen = 0 }
21236 for (i = 1; i <= NF; i++) {
21237 name = "SIG" $i " "
21238 linelen = linelen + length(name)
21239 if (linelen > 70) {
21241 linelen = length(name)
21247 sig_size=`echo $sig_name | awk '{print NF}'`
21248 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21250 : Check size of size
21252 case "$sizetype" in
21253 *_t) zzz="$sizetype" ;;
21254 *) zzz="filesize" ;;
21256 echo "Checking the size of $zzz..." >&4
21258 #include <sys/types.h>
21260 #$i_stdlib I_STDLIB
21262 #include <stdlib.h>
21265 printf("%d\n", (int)sizeof($sizetype));
21270 if eval $compile_ok; then
21274 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21277 echo "Your $zzz size is $sizesize bytes."
21282 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21286 : check for socklen_t
21288 echo "Checking to see if you have socklen_t..." >&4
21290 #include <sys/types.h>
21291 #$d_socket HAS_SOCKET
21293 #include <sys/socket.h>
21295 int main() { socklen_t x = 16; }
21298 if eval $compile; then
21300 echo "You have socklen_t."
21303 echo "You do not have socklen_t."
21304 case "$sizetype" in
21305 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21312 : see if this is a socks.h system
21313 set socks.h i_socks
21316 : check for type of the size argument to socket calls
21317 case "$d_socket" in
21321 Checking to see what type is the last argument of accept().
21324 case "$d_socklen_t" in
21325 "$define") yyy="$yyy socklen_t"
21327 yyy="$yyy $sizetype int long unsigned"
21328 for xxx in $yyy; do
21329 case "$socksizetype" in
21330 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21331 case "$usesocks" in
21333 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21334 echo "Your system accepts '$xxx *' for the last argument of accept()."
21335 socksizetype="$xxx"
21338 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21339 echo "Your system accepts '$xxx *' for the last argument of accept()."
21340 socksizetype="$xxx"
21347 : In case none of those worked, prompt the user.
21348 case "$socksizetype" in
21349 '') rp='What is the type for socket address structure sizes?'
21356 *) : no sockets, so pick relatively harmless default
21361 : see what type is used for signed size_t
21362 set ssize_t ssizetype int stdio.h sys/types.h
21367 #$i_stdlib I_STDLIB
21369 #include <stdlib.h>
21371 #include <sys/types.h>
21372 #define Size_t $sizetype
21373 #define SSize_t $dflt
21376 if (sizeof(Size_t) == sizeof(SSize_t))
21378 else if (sizeof(Size_t) == sizeof(int))
21387 if eval $compile_ok && $run ./try > /dev/null; then
21388 ssizetype=`$run ./try`
21389 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21392 Help! I can't compile and run the ssize_t test program: please enlighten me!
21393 (This is probably a misconfiguration in your system or libraries, and
21394 you really ought to fix it. Still, I'll try anyway.)
21396 I need a type that is the same size as $sizetype, but is guaranteed to
21397 be signed. Common values are ssize_t, int and long.
21400 rp="What signed type is the same size as $sizetype?"
21406 : Check the size of st_ino
21408 $echo "Checking the size of st_ino..." >&4
21409 $cat > try.c <<EOCP
21410 #include <sys/stat.h>
21412 #$i_stdlib I_STDLIB
21414 #include <stdlib.h>
21418 printf("%d\n", (int)sizeof(st.st_ino));
21423 if eval $compile_ok; then
21427 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21429 *) st_ino_size=$val
21430 $echo "Your st_ino is $st_ino_size bytes long."
21435 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21439 : Check if st_ino is signed
21441 $echo "Checking the sign of st_ino..." >&4
21442 $cat > try.c <<EOCP
21443 #include <sys/stat.h>
21448 if (foo.st_ino < 0)
21455 if eval $compile; then
21459 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21461 *) st_ino_sign=$val
21462 case "$st_ino_sign" in
21463 1) $echo "Your st_ino is unsigned." ;;
21464 -1) $echo "Your st_ino is signed." ;;
21470 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21474 : see what type of char stdio uses.
21476 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21477 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21478 echo "Your stdio uses unsigned chars." >&4
21479 stdchar="unsigned char"
21481 echo "Your stdio uses signed chars." >&4
21486 : see what type uids are declared as in the kernel
21488 echo "Looking for the type for user ids returned by getuid()."
21489 set uid_t uidtype xxx stdio.h sys/types.h
21493 xxx=`./findhdr sys/user.h`
21494 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21496 unsigned) dflt="$1 $2" ;;
21500 *) dflt="$uidtype";;
21503 uid_t) echo "uid_t found." ;;
21504 *) rp="What is the type for user ids returned by getuid()?"
21510 : Check size of UID
21513 *_t) zzz="$uidtype" ;;
21516 echo "Checking the size of $zzz..." >&4
21518 #include <sys/types.h>
21520 #$i_stdlib I_STDLIB
21522 #include <stdlib.h>
21525 printf("%d\n", (int)sizeof($uidtype));
21530 if eval $compile_ok; then
21534 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21537 echo "Your $zzz is $uidsize bytes long."
21542 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21545 : Check if UID is signed
21548 *_t) zzz="$uidtype" ;;
21551 echo "Checking the sign of $zzz..." >&4
21553 #include <sys/types.h>
21564 if eval $compile; then
21568 echo "(I can't execute the test program--guessing unsigned.)" >&4
21572 1) echo "Your $zzz is unsigned." ;;
21573 -1) echo "Your $zzz is signed." ;;
21579 echo "(I can't compile the test program--guessing unsigned.)" >&4
21583 : Check format string for UID
21585 $echo "Checking the format string to be used for uids..." >&4
21588 -1) if $test X"$uidsize" = X"$ivsize"; then
21589 uidformat="$ivdformat"
21591 if $test X"$uidsize" = X"$longsize"; then
21594 if $test X"$uidsize" = X"$intsize"; then
21597 if $test X"$uidsize" = X"$shortsize"; then
21604 *) if $test X"$uidsize" = X"$uvsize"; then
21605 uidformat="$uvuformat"
21607 if $test X"$uidsize" = X"$longsize"; then
21610 if $test X"$uidsize" = X"$intsize"; then
21613 if $test X"$uidsize" = X"$shortsize"; then
21622 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21624 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21625 $cat >try.c <<'EOM'
21626 /* Intentionally a long probe as I'd like to sanity check that the exact
21627 approach is going to work, as thinking it will work, but only having it
21628 part working at runtime is worse than not having it. */
21630 #include <sys/types.h>
21631 #include <sys/sysctl.h>
21632 #include <sys/param.h>
21634 #include <string.h>
21635 #include <stdlib.h>
21636 #include <unistd.h>
21639 main(int argc, char **argv) {
21641 char *argv_leaf = strrchr(argv[0], '/');
21647 mib[1] = KERN_PROC;
21648 mib[2] = KERN_PROC_PATHNAME;
21652 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21656 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21661 if (size < strlen(argv_leaf) + 1) {
21662 fprintf(stderr, "size %lu is too short for a path\n",
21663 (unsigned long) size);
21667 if (size > MAXPATHLEN * MAXPATHLEN) {
21668 fprintf(stderr, "size %lu is too long for a path\n",
21669 (unsigned long) size);
21673 buffer = malloc(size);
21679 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21684 if (strlen(buffer) + 1 != size) {
21685 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21686 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21691 if (*buffer != '/') {
21692 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21696 if (strstr(buffer, "/./")) {
21697 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21701 if (strstr(buffer, "/../")) {
21702 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21706 buffer_leaf = strrchr(buffer, '/');
21707 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21708 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21720 if eval $compile; then
21721 if $run ./try; then
21722 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21725 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21729 echo "I'm unable to compile the test program." >&4
21730 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21734 set usekernprocpathname
21737 : Determine if we can use _NSGetExecutablePath to find executing program
21739 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21740 $cat >try.c <<'EOM'
21741 /* Intentionally a long probe as I'd like to sanity check that the exact
21742 approach is going to work, as thinking it will work, but only having it
21743 part working at runtime is worse than not having it. */
21744 #include <mach-o/dyld.h>
21746 #include <stdlib.h>
21747 #include <sys/param.h>
21748 #include <string.h>
21751 main(int argc, char **argv) {
21753 uint32_t size = sizeof(buf);
21757 char *argv_leaf = strrchr(argv[0], '/');
21761 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21765 _NSGetExecutablePath(buf, &size);
21766 if (size > MAXPATHLEN * MAXPATHLEN) {
21767 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21768 (unsigned int) size);
21772 buffer = malloc(size);
21778 result = _NSGetExecutablePath(buffer, &size);
21780 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21781 result, (unsigned int) size);
21785 tidied = realpath(buffer, NULL);
21787 perror("realpath");
21793 if (*tidied != '/') {
21794 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21798 if (strstr(tidied, "/./")) {
21799 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21803 if (strstr(tidied, "/../")) {
21804 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21808 tidied_leaf = strrchr(tidied, '/');
21809 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21810 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21822 if eval $compile; then
21823 if $run ./try; then
21824 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21827 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21830 echo "I'm unable to compile the test program." >&4
21831 echo "I'll assume no _NSGetExecutablePath here." >&4
21834 set usensgetexecutablepath
21837 : Check if site customization support was requested
21838 case "$usesitecustomize" in
21839 $define|true|[Yy]*)
21840 usesitecustomize="$define"
21843 usesitecustomize="$undef"
21847 : see if prototypes support variable argument declarations
21849 case "$prototype$i_stdarg" in
21851 echo "It appears we'll be able to prototype varargs functions." >&4
21855 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21862 : determine compiler compiler
21871 if $test -f "$byacc$_exe"; then
21873 comp="byacc or $comp"
21875 if $test -f "$bison$_exe"; then
21876 comp="$comp or bison -y"
21878 rp="Which compiler compiler ($comp) shall I use?"
21887 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21893 : see if this is a assert.h system
21894 set assert.h i_assert
21897 : see if this is a bfd.h system
21901 : see if this is an execinfo.h system
21902 set execinfo.h i_execinfo
21905 : see if this is a fp.h system
21909 : see if this is a fp_class.h system
21910 set fp_class.h i_fp_class
21913 : see if gdbm.h is available
21918 : see if gdbm_open exists
21919 set gdbm_open d_gdbm_open
21921 case "$d_gdbm_open" in
21924 echo "We won't be including <gdbm.h>"
21933 : see if this is a ieeefp.h system
21934 case "$i_ieeefp" in
21935 '' ) set ieeefp.h i_ieeefp
21940 : see if this is a libutil.h system
21941 set libutil.h i_libutil
21944 : see if mach cthreads are available
21945 if test "X$usethreads" = "X$define"; then
21946 set mach/cthreads.h i_machcthr
21949 i_machcthr="$undef"
21952 : see if this is a mntent.h system
21953 set mntent.h i_mntent
21956 : see if net/errno.h is available
21958 set net/errno.h val
21961 : Unfortunately, it causes problems on some systems. Arrgh.
21964 cat > try.c <<'EOM'
21967 #include <net/errno.h>
21973 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21974 echo "We'll be including <net/errno.h>." >&4
21976 echo "We won't be including <net/errno.h>." >&4
21985 : see if netinet/tcp.h is available
21986 set netinet/tcp.h i_netinettcp
21989 : see if this is a poll.h system
21993 : see if this is a prot.h system
21997 : Preprocessor symbols
21999 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22000 $cat <<'EOSH' > Cppsym.know
22001 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370
22002 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
22003 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
22004 ansi ANSI_C_SOURCE apollo ardent ARM32 ARM arch_ppc arch_pwr
22005 atarist att386 att3b BeOS BIG_ENDIAN BIT_MSF
22006 bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
22007 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
22008 bull byteorder byte_order c cadmus clang clipper CMU COFF COMPILER_VERSION
22009 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
22010 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
22011 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
22012 FILE_OFFSET_BITS FreeBSD FORTIFY_SOURCE
22013 GCC_NEW_VARARGS gcos gcx gimpel
22015 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
22016 H3050R H3050RX hbullx20 hcx host_mips
22017 hp200 hp300 hp700 HP700 hp800 hp9000
22018 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22019 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
22020 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
22021 IA32 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22022 INLINE_INTRINSICS INTRINSICS INT64 INTEL interdata is68k itanium ksr1
22023 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
22024 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
22025 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
22026 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
22027 M68000 m68k m88100 m88k M88KBCS_TARGET M_AMD64 M_ARM M_ARMT M_COFF
22028 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3
22029 M_SYS5 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX MACH machine MachTen
22030 MATH_HAS_NO_SIDE_EFFECTS
22031 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
22032 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
22033 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
22034 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
22035 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
22036 NetBSD news1500 news1700 news1800 news1900 news3700
22037 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
22038 ns32016 ns32332 ns32k nsc32000
22039 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22040 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
22041 pc532 pdp11 PGC PIC plexus PORTAR posix
22042 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22043 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc
22044 PROTOTYPES ppc PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
22045 riscix riscos RT S390 S390x SA110 scs SCO sequent sgi SGI_SOURCE SH SH3
22046 sinix SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
22047 sony sony_news sonyrisc sparc sparcv8 sparcv9 sparclite spectrum
22048 stardent stdc STDC_EXT stratos sun sun3 sun386
22049 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
22050 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
22051 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
22052 sysV68 sysV88 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan
22053 TM3200 TM5400 TM5600
22054 tower tower32 tower32_200 tower32_600 tower32_700
22055 tower32_800 tower32_850 tss
22056 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22057 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22058 unix UNIX95 UNIX99 unixpc unos
22059 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22060 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22061 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22063 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22064 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22065 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22068 # Maybe put other stuff here too.
22069 cat <<EOSH >>Cppsym.know
22072 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22073 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22074 $cat Cppsym.know > Cppsym.c
22075 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22076 $rm -f Cppsym.a Cppsym.b Cppsym.c
22077 cat <<EOSH > Cppsym
22079 if $test \$# -gt 0; then
22080 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22081 if $test -s Cppsym.got; then
22088 $tr " " "$trnl" | ./Cppsym.try
22094 cat <<EOSH > Cppsym.try
22096 cat <<'EOCP' > try.c
22099 #define STRINGIFY(a) "a"
22101 #if cpp_stuff == 42
22102 #define StGiFy(a) #a
22103 #define STRINGIFY(a) StGiFy(a)
22105 #if $cpp_stuff != 1 && $cpp_stuff != 42
22106 # include "Bletch: How does this C preprocessor stringify macros?"
22112 cat <<'EOSH' >> Cppsym.try
22114 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22115 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22116 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22117 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22119 echo 'return 0;}' >> try.c
22121 cat <<EOSH >> Cppsym.try
22123 case "$osname-$gccversion" in
22124 irix-) ccflags="\$ccflags -woff 1178" ;;
22125 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22127 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22129 chmod +x Cppsym.try
22130 $eunicefix Cppsym.try
22131 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22132 : Add in any Linux cpp "predefined macros":
22133 case "$osname::$gccversion" in
22134 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22136 rm -f $tHdrH'.h' $tHdrH
22138 # Filter out macro arguments, such as Linux's __INT8_C(c)
22139 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22140 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22141 if [ -s $tHdrH'_cppsym.real' ]; then
22142 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22145 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22148 : now check the C compiler for additional symbols
22149 postprocess_cc_v=''
22151 aix) postprocess_cc_v="|$tr , ' '" ;;
22158 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22161 -D*) echo "\$i" | $sed 's/^-D//';;
22162 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22167 postprocess_cc_v=''
22170 ./ccsym > ccsym1.raw
22171 if $test -s ccsym1.raw; then
22172 $sort ccsym1.raw | $uniq >ccsym.raw
22174 mv ccsym1.raw ccsym.raw
22177 $awk '/\=/ { print $0; next }
22178 { print $0"=1" }' ccsym.raw >ccsym.list
22179 $comm -13 Cppsym.true ccsym.list >ccsym.own
22180 $comm -12 Cppsym.true ccsym.list >ccsym.com
22181 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22183 if $test -z ccsym.raw; then
22184 echo "Your C compiler doesn't seem to define any symbols!" >&4
22186 echo "However, your C preprocessor defines the following symbols:"
22189 cppsymbols=`$cat Cppsym.true`
22190 cppsymbols=`echo $cppsymbols`
22191 cppccsymbols="$cppsymbols"
22193 if $test -s ccsym.com; then
22194 echo "Your C compiler and pre-processor define these symbols:"
22195 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22198 cppccsymbols=`$cat ccsym.com`
22199 cppccsymbols=`echo $cppccsymbols`
22200 $test "$silent" || sleep 1
22202 if $test -s ccsym.cpp; then
22203 $test "$also" && echo " "
22204 echo "Your C pre-processor ${also}defines the following symbols:"
22205 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22207 cppsymbols=`$cat ccsym.cpp`
22208 cppsymbols=`echo $cppsymbols`
22209 $test "$silent" || sleep 1
22211 if $test -s ccsym.own; then
22212 $test "$also" && echo " "
22213 echo "Your C compiler ${also}defines the following cpp symbols:"
22214 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22215 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22216 ccsymbols=`$cat ccsym.own`
22217 ccsymbols=`echo $ccsymbols`
22218 $test "$silent" || sleep 1
22222 : add -D_FORTIFY_SOURCE if feasible and not already there
22223 case "$gccversion" in
22224 4.*) case "$optimize$ccflags" in
22225 *-O*) case "$ccflags$cppsymbols" in
22226 *_FORTIFY_SOURCE=*) # Don't add it again.
22227 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22229 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22230 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22234 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22238 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22242 : see if this is a termio system
22246 if $test `./findhdr termios.h`; then
22247 set tcsetattr i_termios
22253 "$define") echo "You have POSIX termios.h... good!" >&4;;
22254 *) if ./Cppsym pyr; then
22255 case "`$run /bin/universe`" in
22256 ucb) if $test `./findhdr sgtty.h`; then
22258 echo "<sgtty.h> found." >&4
22260 echo "System is pyramid with BSD universe."
22261 ./warn "<sgtty.h> not found--you could have problems."
22263 *) if $test `./findhdr termio.h`; then
22265 echo "<termio.h> found." >&4
22267 echo "System is pyramid with USG universe."
22268 ./warn "<termio.h> not found--you could have problems."
22272 if $test `./findhdr termio.h`; then
22273 echo "<termio.h> found." >&4
22275 elif $test `./findhdr sgtty.h`; then
22276 echo "<sgtty.h> found." >&4
22279 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22282 if $test `./findhdr sgtty.h`; then
22283 echo "<sgtty.h> found." >&4
22285 elif $test `./findhdr termio.h`; then
22286 echo "<termio.h> found." >&4
22289 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22293 set i_termio; eval $setvar
22294 val=$val2; set i_sgtty; eval $setvar
22295 val=$val3; set i_termios; eval $setvar
22297 : see if stdbool is available
22298 : we want a real compile instead of Inhdr because some Solaris systems
22299 : have stdbool.h, but it can only be used if the compiler indicates it
22300 : is sufficiently c99-compliant.
22304 #include <stdbool.h>
22309 int main(int argc, char **argv)
22315 if eval $compile; then
22316 echo "<stdbool.h> found." >&4
22319 echo "<stdbool.h> NOT found." >&4
22326 : see if stddef is available
22327 set stddef.h i_stddef
22330 : see if sys/access.h is available
22331 set sys/access.h i_sysaccess
22334 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22335 set sys/filio.h i_sysfilio
22338 if $test `./findhdr sys/ioctl.h`; then
22340 echo '<sys/ioctl.h> found.' >&4
22343 if $test $i_sysfilio = "$define"; then
22344 echo '<sys/ioctl.h> NOT found.' >&4
22346 $test $i_sgtty = "$define" && xxx="sgtty.h"
22347 $test $i_termio = "$define" && xxx="termio.h"
22348 $test $i_termios = "$define" && xxx="termios.h"
22349 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22355 : see if socket ioctl defs are in sys/sockio.h
22357 xxx=`./findhdr sys/sockio.h`
22358 if $test "$xxx"; then
22359 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22361 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22364 echo "No socket ioctls found in <sys/sockio.h>." >&4
22369 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22375 : see if this is a syslog.h system
22376 set syslog.h i_syslog
22379 : see if this is a sys/mode.h system
22380 set sys/mode.h i_sysmode
22383 : see if there is a sys/poll.h file
22384 set sys/poll.h i_syspoll
22387 : see if sys/resource.h has to be included
22388 set sys/resource.h i_sysresrc
22391 : see if sys/security.h is available
22392 set sys/security.h i_syssecrt
22395 : see if this is a sys/statvfs.h system
22396 set sys/statvfs.h i_sysstatvfs
22399 : see if this is a sys/un.h system
22400 set sys/un.h i_sysun
22403 : see if this is a sys/utsname.h system
22404 set sys/utsname.h i_sysutsname
22407 : see if this is a syswait system
22408 set sys/wait.h i_syswait
22411 : see if this is a ustat.h system
22412 set ustat.h i_ustat
22415 : see if this is an utime system
22416 set utime.h i_utime
22419 : see if this is a vfork system
22422 set vfork.h i_vfork
22432 echo "Looking for extensions..." >&4
22433 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22434 : contain old or inaccurate or duplicate values.
22435 nonxs_extensions=''
22437 : We do not use find because it might not be available.
22438 : We do not just use MANIFEST because the user may have dropped
22439 : some additional extensions into the source tree and expect them
22442 : Function to recursively find available extensions, ignoring DynaLoader
22443 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22444 : In 5.10.1 and later, extensions are stored in directories
22445 : like File-Glob instead of the older File/Glob/.
22449 DynaLoader|dynaload) ;;
22451 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22452 case "$this_ext" in
22453 Scalar/List/Utils) this_ext="List/Util" ;;
22454 PathTools) this_ext="Cwd" ;;
22456 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22457 if $contains " $this_ext " $tdir/$$.tmp; then
22459 echo "Duplicate directories detected for extension $xxx" >&4;
22460 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22461 case "$knowitall" in
22469 echo "Ok. Stopping Configure." >&4;
22470 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22473 echo "Ok. You will need to correct config.sh before running make." >&4;
22475 $ls -1 $xxx > $tdir/$$.tmp;
22476 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22477 xs_extensions="$xs_extensions $this_ext";
22478 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22479 xs_extensions="$xs_extensions $this_ext";
22480 elif $test -d $xxx; then
22481 nonxs_extensions="$nonxs_extensions $this_ext";
22483 $rm -f $tdir/$$.tmp;
22491 eval $find_extensions
22495 eval $find_extensions
22499 eval $find_extensions
22500 set X $xs_extensions
22502 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22503 set X $nonxs_extensions
22505 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22507 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22509 : Now see which are supported on this system.
22511 for xxx in $xs_extensions ; do
22515 $define) avail_ext="$avail_ext $xxx" ;;
22518 GDBM_File|gdbm_fil)
22520 $define) avail_ext="$avail_ext $xxx" ;;
22523 I18N/Langinfo|i18n_lan)
22524 case "$i_langinfo$d_nl_langinfo" in
22525 $define$define) avail_ext="$avail_ext $xxx" ;;
22529 : XXX Do we need a useipcsysv variable here
22530 case "${d_msg}${d_sem}${d_shm}" in
22531 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22534 NDBM_File|ndbm_fil)
22537 case "$osname-$use64bitint" in
22540 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22543 *) avail_ext="$avail_ext $xxx" ;;
22548 ODBM_File|odbm_fil)
22549 case "${i_dbm}${i_rpcsvcdbm}" in
22551 case "$d_cplusplus" in
22552 define) ;; # delete as a function name will not work
22553 *) case "$osname-$use64bitint" in
22556 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22559 *) avail_ext="$avail_ext $xxx" ;;
22567 case "$useopcode" in
22568 true|define|y) avail_ext="$avail_ext $xxx" ;;
22572 case "$useposix" in
22573 true|define|y) avail_ext="$avail_ext $xxx" ;;
22577 case "$d_socket" in
22578 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22581 Sys/Syslog|sys/syslog)
22582 : XXX syslog requires socket
22583 case "$d_socket" in
22584 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22588 case "$usethreads" in
22590 case "$use5005threads" in
22591 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22595 threads|threads/shared)
22596 # threads and threads::shared are special cases.
22597 # To stop people from asking "Perl 5.8.0 was supposed
22598 # to have this new fancy threads implementation but my
22599 # perl doesn't have it" and from people trying to
22600 # (re)install the threads module using CPAN.pm and
22601 # CPAN.pm then offering to reinstall Perl 5.8.0,
22602 # the threads.pm and threads/shared.pm will always be
22603 # there, croaking informatively ("you need to rebuild
22604 # all of Perl with threads, sorry") when threads haven't
22605 # been compiled in.
22607 avail_ext="$avail_ext $xxx"
22613 cygwin) avail_ext="$avail_ext $xxx" ;;
22616 XS/APItest|xs/apitest)
22617 # This is just for testing. Skip it unless we have dynamic loading.
22620 $define) avail_ext="$avail_ext $xxx" ;;
22623 XS/Typemap|xs/typemap)
22624 # This is just for testing. Skip it unless we have dynamic loading.
22626 $define) avail_ext="$avail_ext $xxx" ;;
22629 *) avail_ext="$avail_ext $xxx"
22638 case "$onlyextensions" in
22640 *) keepextensions=''
22641 echo "You have requested that only certain extensions be included..." >&4
22642 for i in $onlyextensions; do
22643 case " $avail_ext " in
22645 echo "Keeping extension $i."
22646 keepextensions="$keepextensions $i"
22648 *) echo "Ignoring extension $i." ;;
22651 avail_ext="$keepextensions"
22655 case "$noextensions" in
22657 *) keepextensions=''
22658 echo "You have requested that certain extensions be ignored..." >&4
22659 for i in $avail_ext; do
22660 case " $noextensions " in
22661 *" $i "*) echo "Ignoring extension $i." ;;
22662 *) echo "Keeping extension $i.";
22663 keepextensions="$keepextensions $i"
22667 avail_ext="$keepextensions"
22671 : Now see which nonxs extensions are supported on this system.
22672 : For now assume all are.
22674 for xxx in $nonxs_extensions ; do
22678 *) nonxs_ext="$nonxs_ext $xxx"
22690 A number of extensions are supplied with $package. You may choose to
22691 compile these extensions for dynamic loading (the default), compile
22692 them into the $package executable (static loading), or not include
22693 them at all. Answer "none" to include no extensions.
22694 Note that DynaLoader is always built and need not be mentioned here.
22697 case "$dynamic_ext" in
22699 : Exclude those listed in static_ext
22701 for xxx in $avail_ext; do
22702 case " $static_ext " in
22704 *) dflt="$dflt $xxx" ;;
22711 *) dflt="$dynamic_ext"
22712 # Perhaps we are reusing an old out-of-date config.sh.
22715 if test X"$dynamic_ext" != X"$avail_ext"; then
22717 NOTICE: Your previous config.sh list may be incorrect.
22718 The extensions now available to you are
22720 but the default list from your previous config.sh is
22732 rp="What extensions do you wish to load dynamically?"
22735 none) dynamic_ext=' ' ;;
22736 *) dynamic_ext="$ans" ;;
22739 case "$static_ext" in
22741 : Exclude those already listed in dynamic linking
22743 for xxx in $avail_ext; do
22744 case " $dynamic_ext " in
22746 *) dflt="$dflt $xxx" ;;
22753 *) dflt="$static_ext"
22760 rp="What extensions do you wish to load statically?"
22763 none) static_ext=' ' ;;
22764 *) static_ext="$ans" ;;
22769 A number of extensions are supplied with $package. Answer "none"
22770 to include no extensions.
22771 Note that DynaLoader is always built and need not be mentioned here.
22774 case "$static_ext" in
22775 '') dflt="$avail_ext" ;;
22776 *) dflt="$static_ext"
22777 # Perhaps we are reusing an old out-of-date config.sh.
22780 if test X"$static_ext" != X"$avail_ext"; then
22782 NOTICE: Your previous config.sh list may be incorrect.
22783 The extensions now available to you are
22785 but the default list from your previous config.sh is
22794 : Exclude those that are not xs extensions
22798 rp="What extensions do you wish to include?"
22801 none) static_ext=' ' ;;
22802 *) static_ext="$ans" ;;
22807 # Encode is a special case. If we are building Encode as a static
22808 # extension, we need to explicitly list its subextensions as well.
22809 # For other nested extensions, this is handled automatically by
22810 # the appropriate Makefile.PL.
22811 case " $static_ext " in
22812 *" Encode "*) # Add the subextensions of Encode
22814 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22815 static_ext="$static_ext Encode/$xxx"
22816 known_extensions="$known_extensions Encode/$xxx"
22822 set X $dynamic_ext $static_ext $nonxs_ext
22826 # Sanity check: We require an extension suitable for use with
22827 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22828 # should show up as failures in the test suite, but it's helpful to
22829 # catch them now.) The 'extensions' list is normally sorted
22830 # alphabetically, so we need to accept either
22831 # DB_File ... Fcntl ... IO ....
22832 # or something like
22833 # Fcntl ... NDBM_File ... IO ....
22834 case " $extensions" in
22835 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22836 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22837 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22838 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22839 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22843 : Remove libraries needed only for extensions
22844 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22845 : The exception is SunOS 4.x, which needs them.
22846 case "${osname}X${osvers}" in
22850 *) case "$usedl" in
22851 $define|true|[yY]*)
22852 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22856 *) perllibs="$libs"
22862 : Remove build directory name from cppstdin so it can be used from
22863 : either the present location or the final installed location.
22865 : Get out of the UU directory to get correct path name.
22867 case "$cppstdin" in
22869 echo "Stripping down cppstdin path name"
22875 : end of configuration questions
22877 echo "End of configuration questions."
22880 : back to where it started
22881 if test -d ../UU; then
22885 : configuration may be unconditionally patched via a 'config.arch' file
22886 if $test -f config.arch; then
22887 echo "I see a config.arch file, loading it." >&4
22891 : configuration may be patched via a 'config.over' file
22892 if $test -f config.over; then
22895 rp='I see a config.over file. Do you wish to load it?'
22898 n*) echo "OK, I'll ignore it.";;
22900 echo "Configuration override changes have been loaded."
22905 : in case they want portability, strip down executable paths
22906 case "$d_portable" in
22909 echo "Stripping down executable paths..." >&4
22910 for file in $loclist $trylist; do
22912 eval $file=`basename $temp`
22917 : create config.sh file
22919 echo "Creating config.sh..." >&4
22920 $spitshell <<EOT >config.sh
22923 # This file was produced by running the Configure script. It holds all the
22924 # definitions figured out by Configure. Should you modify one of these values,
22925 # do not forget to propagate your changes by running "Configure -der". You may
22926 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22929 # Package name : $package
22930 # Source directory : $src
22931 # Configuration time: $cf_time
22932 # Configured by : $cf_by
22933 # Target system : $myuname
22936 : Add in command line options if available
22937 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22939 $spitshell <<EOT >>config.sh
22948 Revision='$Revision'
22956 alignbytes='$alignbytes'
22957 ansi2knr='$ansi2knr'
22958 aphostname='$aphostname'
22959 api_revision='$api_revision'
22960 api_subversion='$api_subversion'
22961 api_version='$api_version'
22962 api_versionstring='$api_versionstring'
22965 archlibexp='$archlibexp'
22966 archname64='$archname64'
22967 archname='$archname'
22968 archobjs='$archobjs'
22969 asctime_r_proto='$asctime_r_proto'
22978 byteorder='$byteorder'
22980 castflags='$castflags'
22983 cccdlflags='$cccdlflags'
22984 ccdlflags='$ccdlflags'
22986 ccflags_uselargefiles='$ccflags_uselargefiles'
22988 ccsymbols='$ccsymbols'
22989 ccversion='$ccversion'
22991 cf_email='$cf_email'
22993 charbits='$charbits'
22994 charsize='$charsize'
22998 clocktype='$clocktype'
23000 compress='$compress'
23001 contains='$contains'
23005 cpp_stuff='$cpp_stuff'
23006 cppccsymbols='$cppccsymbols'
23007 cppflags='$cppflags'
23009 cppminus='$cppminus'
23011 cppstdin='$cppstdin'
23012 cppsymbols='$cppsymbols'
23013 crypt_r_proto='$crypt_r_proto'
23014 cryptlib='$cryptlib'
23016 ctermid_r_proto='$ctermid_r_proto'
23017 ctime_r_proto='$ctime_r_proto'
23018 d_Gconvert='$d_Gconvert'
23019 d_PRIEUldbl='$d_PRIEUldbl'
23020 d_PRIFUldbl='$d_PRIFUldbl'
23021 d_PRIGUldbl='$d_PRIGUldbl'
23022 d_PRIXU64='$d_PRIXU64'
23023 d_PRId64='$d_PRId64'
23024 d_PRIeldbl='$d_PRIeldbl'
23025 d_PRIfldbl='$d_PRIfldbl'
23026 d_PRIgldbl='$d_PRIgldbl'
23027 d_PRIi64='$d_PRIi64'
23028 d_PRIo64='$d_PRIo64'
23029 d_PRIu64='$d_PRIu64'
23030 d_PRIx64='$d_PRIx64'
23031 d_SCNfldbl='$d_SCNfldbl'
23032 d__fwalk='$d__fwalk'
23033 d_access='$d_access'
23034 d_accessx='$d_accessx'
23037 d_archlib='$d_archlib'
23038 d_asctime64='$d_asctime64'
23039 d_asctime_r='$d_asctime_r'
23042 d_attribute_deprecated='$d_attribute_deprecated'
23043 d_attribute_format='$d_attribute_format'
23044 d_attribute_malloc='$d_attribute_malloc'
23045 d_attribute_nonnull='$d_attribute_nonnull'
23046 d_attribute_noreturn='$d_attribute_noreturn'
23047 d_attribute_pure='$d_attribute_pure'
23048 d_attribute_unused='$d_attribute_unused'
23049 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23050 d_backtrace='$d_backtrace'
23054 d_bsdgetpgrp='$d_bsdgetpgrp'
23055 d_bsdsetpgrp='$d_bsdsetpgrp'
23056 d_builtin_choose_expr='$d_builtin_choose_expr'
23057 d_builtin_expect='$d_builtin_expect'
23059 d_c99_variadic_macros='$d_c99_variadic_macros'
23060 d_casti32='$d_casti32'
23061 d_castneg='$d_castneg'
23062 d_charvspr='$d_charvspr'
23064 d_chroot='$d_chroot'
23065 d_chsize='$d_chsize'
23067 d_clearenv='$d_clearenv'
23068 d_closedir='$d_closedir'
23069 d_cmsghdr_s='$d_cmsghdr_s'
23071 d_copysignl='$d_copysignl'
23072 d_cplusplus='$d_cplusplus'
23074 d_crypt_r='$d_crypt_r'
23076 d_ctermid='$d_ctermid'
23077 d_ctermid_r='$d_ctermid_r'
23078 d_ctime64='$d_ctime64'
23079 d_ctime_r='$d_ctime_r'
23080 d_cuserid='$d_cuserid'
23081 d_dbl_dig='$d_dbl_dig'
23082 d_dbminitproto='$d_dbminitproto'
23083 d_difftime64='$d_difftime64'
23084 d_difftime='$d_difftime'
23085 d_dir_dd_fd='$d_dir_dd_fd'
23087 d_dirnamlen='$d_dirnamlen'
23088 d_dladdr='$d_dladdr'
23089 d_dlerror='$d_dlerror'
23090 d_dlopen='$d_dlopen'
23091 d_dlsymun='$d_dlsymun'
23092 d_dosuid='$d_dosuid'
23093 d_drand48_r='$d_drand48_r'
23094 d_drand48proto='$d_drand48proto'
23096 d_eaccess='$d_eaccess'
23097 d_endgrent='$d_endgrent'
23098 d_endgrent_r='$d_endgrent_r'
23099 d_endhent='$d_endhent'
23100 d_endhostent_r='$d_endhostent_r'
23101 d_endnent='$d_endnent'
23102 d_endnetent_r='$d_endnetent_r'
23103 d_endpent='$d_endpent'
23104 d_endprotoent_r='$d_endprotoent_r'
23105 d_endpwent='$d_endpwent'
23106 d_endpwent_r='$d_endpwent_r'
23107 d_endsent='$d_endsent'
23108 d_endservent_r='$d_endservent_r'
23109 d_eofnblk='$d_eofnblk'
23110 d_eunice='$d_eunice'
23111 d_faststdio='$d_faststdio'
23112 d_fchdir='$d_fchdir'
23113 d_fchmod='$d_fchmod'
23114 d_fchown='$d_fchown'
23116 d_fcntl_can_lock='$d_fcntl_can_lock'
23117 d_fd_macros='$d_fd_macros'
23118 d_fd_set='$d_fd_set'
23119 d_fds_bits='$d_fds_bits'
23120 d_fgetpos='$d_fgetpos'
23121 d_finite='$d_finite'
23122 d_finitel='$d_finitel'
23123 d_flexfnam='$d_flexfnam'
23125 d_flockproto='$d_flockproto'
23127 d_fp_class='$d_fp_class'
23128 d_fpathconf='$d_fpathconf'
23129 d_fpclass='$d_fpclass'
23130 d_fpclassify='$d_fpclassify'
23131 d_fpclassl='$d_fpclassl'
23132 d_fpos64_t='$d_fpos64_t'
23133 d_frexpl='$d_frexpl'
23134 d_fs_data_s='$d_fs_data_s'
23135 d_fseeko='$d_fseeko'
23136 d_fsetpos='$d_fsetpos'
23137 d_fstatfs='$d_fstatfs'
23138 d_fstatvfs='$d_fstatvfs'
23140 d_ftello='$d_ftello'
23142 d_futimes='$d_futimes'
23143 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23144 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23145 d_getaddrinfo='$d_getaddrinfo'
23146 d_getcwd='$d_getcwd'
23147 d_getespwnam='$d_getespwnam'
23148 d_getfsstat='$d_getfsstat'
23149 d_getgrent='$d_getgrent'
23150 d_getgrent_r='$d_getgrent_r'
23151 d_getgrgid_r='$d_getgrgid_r'
23152 d_getgrnam_r='$d_getgrnam_r'
23153 d_getgrps='$d_getgrps'
23154 d_gethbyaddr='$d_gethbyaddr'
23155 d_gethbyname='$d_gethbyname'
23156 d_gethent='$d_gethent'
23157 d_gethname='$d_gethname'
23158 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23159 d_gethostbyname_r='$d_gethostbyname_r'
23160 d_gethostent_r='$d_gethostent_r'
23161 d_gethostprotos='$d_gethostprotos'
23162 d_getitimer='$d_getitimer'
23163 d_getlogin='$d_getlogin'
23164 d_getlogin_r='$d_getlogin_r'
23165 d_getmnt='$d_getmnt'
23166 d_getmntent='$d_getmntent'
23167 d_getnameinfo='$d_getnameinfo'
23168 d_getnbyaddr='$d_getnbyaddr'
23169 d_getnbyname='$d_getnbyname'
23170 d_getnent='$d_getnent'
23171 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23172 d_getnetbyname_r='$d_getnetbyname_r'
23173 d_getnetent_r='$d_getnetent_r'
23174 d_getnetprotos='$d_getnetprotos'
23175 d_getpagsz='$d_getpagsz'
23176 d_getpbyname='$d_getpbyname'
23177 d_getpbynumber='$d_getpbynumber'
23178 d_getpent='$d_getpent'
23179 d_getpgid='$d_getpgid'
23180 d_getpgrp2='$d_getpgrp2'
23181 d_getpgrp='$d_getpgrp'
23182 d_getppid='$d_getppid'
23183 d_getprior='$d_getprior'
23184 d_getprotobyname_r='$d_getprotobyname_r'
23185 d_getprotobynumber_r='$d_getprotobynumber_r'
23186 d_getprotoent_r='$d_getprotoent_r'
23187 d_getprotoprotos='$d_getprotoprotos'
23188 d_getprpwnam='$d_getprpwnam'
23189 d_getpwent='$d_getpwent'
23190 d_getpwent_r='$d_getpwent_r'
23191 d_getpwnam_r='$d_getpwnam_r'
23192 d_getpwuid_r='$d_getpwuid_r'
23193 d_getsbyname='$d_getsbyname'
23194 d_getsbyport='$d_getsbyport'
23195 d_getsent='$d_getsent'
23196 d_getservbyname_r='$d_getservbyname_r'
23197 d_getservbyport_r='$d_getservbyport_r'
23198 d_getservent_r='$d_getservent_r'
23199 d_getservprotos='$d_getservprotos'
23200 d_getspnam='$d_getspnam'
23201 d_getspnam_r='$d_getspnam_r'
23202 d_gettimeod='$d_gettimeod'
23203 d_gmtime64='$d_gmtime64'
23204 d_gmtime_r='$d_gmtime_r'
23205 d_gnulibc='$d_gnulibc'
23206 d_grpasswd='$d_grpasswd'
23207 d_hasmntopt='$d_hasmntopt'
23209 d_ilogbl='$d_ilogbl'
23210 d_inc_version_list='$d_inc_version_list'
23212 d_inetaton='$d_inetaton'
23213 d_inetntop='$d_inetntop'
23214 d_inetpton='$d_inetpton'
23215 d_int64_t='$d_int64_t'
23216 d_ip_mreq='$d_ip_mreq'
23217 d_ip_mreq_source='$d_ip_mreq_source'
23218 d_ipv6_mreq='$d_ipv6_mreq'
23219 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23220 d_isascii='$d_isascii'
23221 d_isblank='$d_isblank'
23222 d_isfinite='$d_isfinite'
23225 d_isnanl='$d_isnanl'
23226 d_killpg='$d_killpg'
23227 d_lchown='$d_lchown'
23228 d_ldbl_dig='$d_ldbl_dig'
23229 d_libm_lib_version='$d_libm_lib_version'
23230 d_libname_unique='$d_libname_unique'
23232 d_localtime64='$d_localtime64'
23233 d_localtime_r='$d_localtime_r'
23234 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23235 d_locconv='$d_locconv'
23237 d_longdbl='$d_longdbl'
23238 d_longlong='$d_longlong'
23239 d_lseekproto='$d_lseekproto'
23241 d_madvise='$d_madvise'
23242 d_malloc_good_size='$d_malloc_good_size'
23243 d_malloc_size='$d_malloc_size'
23245 d_mbstowcs='$d_mbstowcs'
23246 d_mbtowc='$d_mbtowc'
23247 d_memchr='$d_memchr'
23248 d_memcmp='$d_memcmp'
23249 d_memcpy='$d_memcpy'
23250 d_memmove='$d_memmove'
23251 d_memset='$d_memset'
23253 d_mkdtemp='$d_mkdtemp'
23254 d_mkfifo='$d_mkfifo'
23255 d_mkstemp='$d_mkstemp'
23256 d_mkstemps='$d_mkstemps'
23257 d_mktime64='$d_mktime64'
23258 d_mktime='$d_mktime'
23261 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23262 d_modflproto='$d_modflproto'
23263 d_mprotect='$d_mprotect'
23265 d_msg_ctrunc='$d_msg_ctrunc'
23266 d_msg_dontroute='$d_msg_dontroute'
23267 d_msg_oob='$d_msg_oob'
23268 d_msg_peek='$d_msg_peek'
23269 d_msg_proxy='$d_msg_proxy'
23270 d_msgctl='$d_msgctl'
23271 d_msgget='$d_msgget'
23272 d_msghdr_s='$d_msghdr_s'
23273 d_msgrcv='$d_msgrcv'
23274 d_msgsnd='$d_msgsnd'
23276 d_munmap='$d_munmap'
23277 d_mymalloc='$d_mymalloc'
23279 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23281 d_nl_langinfo='$d_nl_langinfo'
23282 d_nv_preserves_uv='$d_nv_preserves_uv'
23283 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23284 d_off64_t='$d_off64_t'
23285 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23286 d_oldpthreads='$d_oldpthreads'
23287 d_oldsock='$d_oldsock'
23289 d_pathconf='$d_pathconf'
23291 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23292 d_phostname='$d_phostname'
23295 d_portable='$d_portable'
23297 d_prctl_set_name='$d_prctl_set_name'
23298 d_printf_format_null='$d_printf_format_null'
23299 d_procselfexe='$d_procselfexe'
23300 d_pseudofork='$d_pseudofork'
23301 d_pthread_atfork='$d_pthread_atfork'
23302 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23303 d_pthread_yield='$d_pthread_yield'
23304 d_ptrdiff_t='$d_ptrdiff_t'
23306 d_pwchange='$d_pwchange'
23307 d_pwclass='$d_pwclass'
23308 d_pwcomment='$d_pwcomment'
23309 d_pwexpire='$d_pwexpire'
23310 d_pwgecos='$d_pwgecos'
23311 d_pwpasswd='$d_pwpasswd'
23312 d_pwquota='$d_pwquota'
23315 d_random_r='$d_random_r'
23316 d_readdir64_r='$d_readdir64_r'
23317 d_readdir='$d_readdir'
23318 d_readdir_r='$d_readdir_r'
23319 d_readlink='$d_readlink'
23321 d_recvmsg='$d_recvmsg'
23322 d_rename='$d_rename'
23323 d_rewinddir='$d_rewinddir'
23325 d_safebcpy='$d_safebcpy'
23326 d_safemcpy='$d_safemcpy'
23327 d_sanemcmp='$d_sanemcmp'
23328 d_sbrkproto='$d_sbrkproto'
23329 d_scalbnl='$d_scalbnl'
23330 d_sched_yield='$d_sched_yield'
23331 d_scm_rights='$d_scm_rights'
23332 d_seekdir='$d_seekdir'
23333 d_select='$d_select'
23335 d_semctl='$d_semctl'
23336 d_semctl_semid_ds='$d_semctl_semid_ds'
23337 d_semctl_semun='$d_semctl_semun'
23338 d_semget='$d_semget'
23340 d_sendmsg='$d_sendmsg'
23341 d_setegid='$d_setegid'
23342 d_seteuid='$d_seteuid'
23343 d_setgrent='$d_setgrent'
23344 d_setgrent_r='$d_setgrent_r'
23345 d_setgrps='$d_setgrps'
23346 d_sethent='$d_sethent'
23347 d_sethostent_r='$d_sethostent_r'
23348 d_setitimer='$d_setitimer'
23349 d_setlinebuf='$d_setlinebuf'
23350 d_setlocale='$d_setlocale'
23351 d_setlocale_r='$d_setlocale_r'
23352 d_setnent='$d_setnent'
23353 d_setnetent_r='$d_setnetent_r'
23354 d_setpent='$d_setpent'
23355 d_setpgid='$d_setpgid'
23356 d_setpgrp2='$d_setpgrp2'
23357 d_setpgrp='$d_setpgrp'
23358 d_setprior='$d_setprior'
23359 d_setproctitle='$d_setproctitle'
23360 d_setprotoent_r='$d_setprotoent_r'
23361 d_setpwent='$d_setpwent'
23362 d_setpwent_r='$d_setpwent_r'
23363 d_setregid='$d_setregid'
23364 d_setresgid='$d_setresgid'
23365 d_setresuid='$d_setresuid'
23366 d_setreuid='$d_setreuid'
23367 d_setrgid='$d_setrgid'
23368 d_setruid='$d_setruid'
23369 d_setsent='$d_setsent'
23370 d_setservent_r='$d_setservent_r'
23371 d_setsid='$d_setsid'
23372 d_setvbuf='$d_setvbuf'
23375 d_shmatprototype='$d_shmatprototype'
23376 d_shmctl='$d_shmctl'
23378 d_shmget='$d_shmget'
23379 d_sigaction='$d_sigaction'
23380 d_signbit='$d_signbit'
23381 d_sigprocmask='$d_sigprocmask'
23382 d_sigsetjmp='$d_sigsetjmp'
23383 d_sin6_scope_id='$d_sin6_scope_id'
23384 d_sitearch='$d_sitearch'
23385 d_snprintf='$d_snprintf'
23386 d_sockaddr_in6='$d_sockaddr_in6'
23387 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23388 d_sockatmark='$d_sockatmark'
23389 d_sockatmarkproto='$d_sockatmarkproto'
23390 d_socket='$d_socket'
23391 d_socklen_t='$d_socklen_t'
23392 d_sockpair='$d_sockpair'
23393 d_socks5_init='$d_socks5_init'
23394 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23396 d_srand48_r='$d_srand48_r'
23397 d_srandom_r='$d_srandom_r'
23398 d_sresgproto='$d_sresgproto'
23399 d_sresuproto='$d_sresuproto'
23400 d_statblks='$d_statblks'
23401 d_statfs_f_flags='$d_statfs_f_flags'
23402 d_statfs_s='$d_statfs_s'
23403 d_static_inline='$d_static_inline'
23404 d_statvfs='$d_statvfs'
23405 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23406 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23407 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23408 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23409 d_stdio_stream_array='$d_stdio_stream_array'
23410 d_stdiobase='$d_stdiobase'
23411 d_stdstdio='$d_stdstdio'
23412 d_strchr='$d_strchr'
23413 d_strcoll='$d_strcoll'
23414 d_strctcpy='$d_strctcpy'
23415 d_strerrm='$d_strerrm'
23416 d_strerror='$d_strerror'
23417 d_strerror_r='$d_strerror_r'
23418 d_strftime='$d_strftime'
23419 d_strlcat='$d_strlcat'
23420 d_strlcpy='$d_strlcpy'
23421 d_strtod='$d_strtod'
23422 d_strtol='$d_strtol'
23423 d_strtold='$d_strtold'
23424 d_strtoll='$d_strtoll'
23425 d_strtoq='$d_strtoq'
23426 d_strtoul='$d_strtoul'
23427 d_strtoull='$d_strtoull'
23428 d_strtouq='$d_strtouq'
23429 d_strxfrm='$d_strxfrm'
23430 d_suidsafe='$d_suidsafe'
23431 d_symlink='$d_symlink'
23432 d_syscall='$d_syscall'
23433 d_syscallproto='$d_syscallproto'
23434 d_sysconf='$d_sysconf'
23435 d_sysernlst='$d_sysernlst'
23436 d_syserrlst='$d_syserrlst'
23437 d_system='$d_system'
23438 d_tcgetpgrp='$d_tcgetpgrp'
23439 d_tcsetpgrp='$d_tcsetpgrp'
23440 d_telldir='$d_telldir'
23441 d_telldirproto='$d_telldirproto'
23443 d_timegm='$d_timegm'
23445 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23446 d_tm_tm_zone='$d_tm_tm_zone'
23447 d_tmpnam_r='$d_tmpnam_r'
23448 d_truncate='$d_truncate'
23449 d_ttyname_r='$d_ttyname_r'
23450 d_tzname='$d_tzname'
23451 d_u32align='$d_u32align'
23452 d_ualarm='$d_ualarm'
23455 d_union_semun='$d_union_semun'
23456 d_unordered='$d_unordered'
23457 d_unsetenv='$d_unsetenv'
23458 d_usleep='$d_usleep'
23459 d_usleepproto='$d_usleepproto'
23461 d_vendorarch='$d_vendorarch'
23462 d_vendorbin='$d_vendorbin'
23463 d_vendorlib='$d_vendorlib'
23464 d_vendorscript='$d_vendorscript'
23466 d_void_closedir='$d_void_closedir'
23467 d_voidsig='$d_voidsig'
23468 d_voidtty='$d_voidtty'
23469 d_volatile='$d_volatile'
23470 d_vprintf='$d_vprintf'
23471 d_vsnprintf='$d_vsnprintf'
23473 d_waitpid='$d_waitpid'
23474 d_wcscmp='$d_wcscmp'
23475 d_wcstombs='$d_wcstombs'
23476 d_wcsxfrm='$d_wcsxfrm'
23477 d_wctomb='$d_wctomb'
23478 d_writev='$d_writev'
23481 db_hashtype='$db_hashtype'
23482 db_prefixtype='$db_prefixtype'
23483 db_version_major='$db_version_major'
23484 db_version_minor='$db_version_minor'
23485 db_version_patch='$db_version_patch'
23486 direntrytype='$direntrytype'
23489 doublesize='$doublesize'
23491 drand48_r_proto='$drand48_r_proto'
23493 dynamic_ext='$dynamic_ext'
23499 endgrent_r_proto='$endgrent_r_proto'
23500 endhostent_r_proto='$endhostent_r_proto'
23501 endnetent_r_proto='$endnetent_r_proto'
23502 endprotoent_r_proto='$endprotoent_r_proto'
23503 endpwent_r_proto='$endpwent_r_proto'
23504 endservent_r_proto='$endservent_r_proto'
23505 eunicefix='$eunicefix'
23508 extensions='$extensions'
23509 extern_C='$extern_C'
23511 fflushNULL='$fflushNULL'
23512 fflushall='$fflushall'
23514 firstmakefile='$firstmakefile'
23516 fpossize='$fpossize'
23517 fpostype='$fpostype'
23518 freetype='$freetype'
23521 full_csh='$full_csh'
23522 full_sed='$full_sed'
23523 gccansipedantic='$gccansipedantic'
23524 gccosandvers='$gccosandvers'
23525 gccversion='$gccversion'
23526 getgrent_r_proto='$getgrent_r_proto'
23527 getgrgid_r_proto='$getgrgid_r_proto'
23528 getgrnam_r_proto='$getgrnam_r_proto'
23529 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23530 gethostbyname_r_proto='$gethostbyname_r_proto'
23531 gethostent_r_proto='$gethostent_r_proto'
23532 getlogin_r_proto='$getlogin_r_proto'
23533 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23534 getnetbyname_r_proto='$getnetbyname_r_proto'
23535 getnetent_r_proto='$getnetent_r_proto'
23536 getprotobyname_r_proto='$getprotobyname_r_proto'
23537 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23538 getprotoent_r_proto='$getprotoent_r_proto'
23539 getpwent_r_proto='$getpwent_r_proto'
23540 getpwnam_r_proto='$getpwnam_r_proto'
23541 getpwuid_r_proto='$getpwuid_r_proto'
23542 getservbyname_r_proto='$getservbyname_r_proto'
23543 getservbyport_r_proto='$getservbyport_r_proto'
23544 getservent_r_proto='$getservent_r_proto'
23545 getspnam_r_proto='$getspnam_r_proto'
23546 gidformat='$gidformat'
23552 gmtime_r_proto='$gmtime_r_proto'
23553 gnulibc_version='$gnulibc_version'
23555 groupcat='$groupcat'
23556 groupstype='$groupstype'
23559 h_sysfile='$h_sysfile'
23562 hostgenerate='$hostgenerate'
23563 hostosname='$hostosname'
23564 hostperl='$hostperl'
23565 html1dir='$html1dir'
23566 html1direxp='$html1direxp'
23567 html3dir='$html3dir'
23568 html3direxp='$html3direxp'
23577 i_arpainet='$i_arpainet'
23578 i_assert='$i_assert'
23580 i_bsdioctl='$i_bsdioctl'
23584 i_dirent='$i_dirent'
23586 i_execinfo='$i_execinfo'
23590 i_fp_class='$i_fp_class'
23592 i_gdbm_ndbm='$i_gdbm_ndbm'
23593 i_gdbmndbm='$i_gdbmndbm'
23595 i_ieeefp='$i_ieeefp'
23596 i_inttypes='$i_inttypes'
23597 i_langinfo='$i_langinfo'
23598 i_libutil='$i_libutil'
23599 i_limits='$i_limits'
23600 i_locale='$i_locale'
23601 i_machcthr='$i_machcthr'
23602 i_malloc='$i_malloc'
23603 i_mallocmalloc='$i_mallocmalloc'
23605 i_memory='$i_memory'
23606 i_mntent='$i_mntent'
23609 i_neterrno='$i_neterrno'
23610 i_netinettcp='$i_netinettcp'
23614 i_pthread='$i_pthread'
23616 i_rpcsvcdbm='$i_rpcsvcdbm'
23618 i_shadow='$i_shadow'
23620 i_stdarg='$i_stdarg'
23621 i_stdbool='$i_stdbool'
23622 i_stddef='$i_stddef'
23623 i_stdlib='$i_stdlib'
23624 i_string='$i_string'
23625 i_sunmath='$i_sunmath'
23626 i_sysaccess='$i_sysaccess'
23627 i_sysdir='$i_sysdir'
23628 i_sysfile='$i_sysfile'
23629 i_sysfilio='$i_sysfilio'
23631 i_sysioctl='$i_sysioctl'
23632 i_syslog='$i_syslog'
23633 i_sysmman='$i_sysmman'
23634 i_sysmode='$i_sysmode'
23635 i_sysmount='$i_sysmount'
23636 i_sysndir='$i_sysndir'
23637 i_sysparam='$i_sysparam'
23638 i_syspoll='$i_syspoll'
23639 i_sysresrc='$i_sysresrc'
23640 i_syssecrt='$i_syssecrt'
23641 i_sysselct='$i_sysselct'
23642 i_syssockio='$i_syssockio'
23643 i_sysstat='$i_sysstat'
23644 i_sysstatfs='$i_sysstatfs'
23645 i_sysstatvfs='$i_sysstatvfs'
23646 i_systime='$i_systime'
23647 i_systimek='$i_systimek'
23648 i_systimes='$i_systimes'
23649 i_systypes='$i_systypes'
23650 i_sysuio='$i_sysuio'
23652 i_sysutsname='$i_sysutsname'
23653 i_sysvfs='$i_sysvfs'
23654 i_syswait='$i_syswait'
23655 i_termio='$i_termio'
23656 i_termios='$i_termios'
23658 i_unistd='$i_unistd'
23661 i_values='$i_values'
23662 i_varargs='$i_varargs'
23663 i_varhdr='$i_varhdr'
23665 ignore_versioned_solibs='$ignore_versioned_solibs'
23666 inc_version_list='$inc_version_list'
23667 inc_version_list_init='$inc_version_list_init'
23671 initialinstalllocation='$initialinstalllocation'
23672 installarchlib='$installarchlib'
23673 installbin='$installbin'
23674 installhtml1dir='$installhtml1dir'
23675 installhtml3dir='$installhtml3dir'
23676 installman1dir='$installman1dir'
23677 installman3dir='$installman3dir'
23678 installprefix='$installprefix'
23679 installprefixexp='$installprefixexp'
23680 installprivlib='$installprivlib'
23681 installscript='$installscript'
23682 installsitearch='$installsitearch'
23683 installsitebin='$installsitebin'
23684 installsitehtml1dir='$installsitehtml1dir'
23685 installsitehtml3dir='$installsitehtml3dir'
23686 installsitelib='$installsitelib'
23687 installsiteman1dir='$installsiteman1dir'
23688 installsiteman3dir='$installsiteman3dir'
23689 installsitescript='$installsitescript'
23690 installstyle='$installstyle'
23691 installusrbinperl='$installusrbinperl'
23692 installvendorarch='$installvendorarch'
23693 installvendorbin='$installvendorbin'
23694 installvendorhtml1dir='$installvendorhtml1dir'
23695 installvendorhtml3dir='$installvendorhtml3dir'
23696 installvendorlib='$installvendorlib'
23697 installvendorman1dir='$installvendorman1dir'
23698 installvendorman3dir='$installvendorman3dir'
23699 installvendorscript='$installvendorscript'
23701 issymlink='$issymlink'
23702 ivdformat='$ivdformat'
23705 known_extensions='$known_extensions'
23708 ld_can_script='$ld_can_script'
23709 lddlflags='$lddlflags'
23711 ldflags_uselargefiles='$ldflags_uselargefiles'
23712 ldlibpthname='$ldlibpthname'
23719 libsdirs='$libsdirs'
23720 libsfiles='$libsfiles'
23721 libsfound='$libsfound'
23722 libspath='$libspath'
23723 libswanted='$libswanted'
23724 libswanted_uselargefiles='$libswanted_uselargefiles'
23730 localtime_r_proto='$localtime_r_proto'
23731 locincpth='$locincpth'
23732 loclibpth='$loclibpth'
23733 longdblsize='$longdblsize'
23734 longlongsize='$longlongsize'
23735 longsize='$longsize'
23739 lseeksize='$lseeksize'
23740 lseektype='$lseektype'
23744 make_set_make='$make_set_make'
23745 mallocobj='$mallocobj'
23746 mallocsrc='$mallocsrc'
23747 malloctype='$malloctype'
23749 man1direxp='$man1direxp'
23752 man3direxp='$man3direxp'
23754 mips_type='$mips_type'
23755 mistrustnm='$mistrustnm'
23757 mmaptype='$mmaptype'
23758 modetype='$modetype'
23760 multiarch='$multiarch'
23762 myarchname='$myarchname'
23763 mydomain='$mydomain'
23764 myhostname='$myhostname'
23767 need_va_copy='$need_va_copy'
23768 netdb_hlen_type='$netdb_hlen_type'
23769 netdb_host_type='$netdb_host_type'
23770 netdb_name_type='$netdb_name_type'
23771 netdb_net_type='$netdb_net_type'
23774 nm_so_opt='$nm_so_opt'
23775 nonxs_ext='$nonxs_ext'
23777 nvEUformat='$nvEUformat'
23778 nvFUformat='$nvFUformat'
23779 nvGUformat='$nvGUformat'
23780 nv_overflows_integers_at='$nv_overflows_integers_at'
23781 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23782 nveformat='$nveformat'
23783 nvfformat='$nvfformat'
23784 nvgformat='$nvgformat'
23787 o_nonblock='$o_nonblock'
23789 old_pthread_create_joinable='$old_pthread_create_joinable'
23790 optimize='$optimize'
23791 orderlib='$orderlib'
23794 otherlibdirs='$otherlibdirs'
23798 patchlevel='$patchlevel'
23799 path_sep='$path_sep'
23802 perl_patchlevel='$perl_patchlevel'
23803 perl_static_inline='$perl_static_inline'
23804 perladmin='$perladmin'
23805 perllibs='$perllibs'
23806 perlpath='$perlpath'
23808 phostname='$phostname'
23814 prefixexp='$prefixexp'
23816 privlibexp='$privlibexp'
23817 procselfexe='$procselfexe'
23818 prototype='$prototype'
23820 quadkind='$quadkind'
23821 quadtype='$quadtype'
23822 randbits='$randbits'
23823 randfunc='$randfunc'
23824 random_r_proto='$random_r_proto'
23825 randseedtype='$randseedtype'
23827 rd_nodata='$rd_nodata'
23828 readdir64_r_proto='$readdir64_r_proto'
23829 readdir_r_proto='$readdir_r_proto'
23830 revision='$revision'
23836 sGMTIME_max='$sGMTIME_max'
23837 sGMTIME_min='$sGMTIME_min'
23838 sLOCALTIME_max='$sLOCALTIME_max'
23839 sLOCALTIME_min='$sLOCALTIME_min'
23840 sPRIEUldbl='$sPRIEUldbl'
23841 sPRIFUldbl='$sPRIFUldbl'
23842 sPRIGUldbl='$sPRIGUldbl'
23843 sPRIXU64='$sPRIXU64'
23845 sPRIeldbl='$sPRIeldbl'
23846 sPRIfldbl='$sPRIfldbl'
23847 sPRIgldbl='$sPRIgldbl'
23852 sSCNfldbl='$sSCNfldbl'
23853 sched_yield='$sched_yield'
23854 scriptdir='$scriptdir'
23855 scriptdirexp='$scriptdirexp'
23857 seedfunc='$seedfunc'
23858 selectminbits='$selectminbits'
23859 selecttype='$selecttype'
23860 sendmail='$sendmail'
23861 setgrent_r_proto='$setgrent_r_proto'
23862 sethostent_r_proto='$sethostent_r_proto'
23863 setlocale_r_proto='$setlocale_r_proto'
23864 setnetent_r_proto='$setnetent_r_proto'
23865 setprotoent_r_proto='$setprotoent_r_proto'
23866 setpwent_r_proto='$setpwent_r_proto'
23867 setservent_r_proto='$setservent_r_proto'
23870 sharpbang='$sharpbang'
23871 shmattype='$shmattype'
23872 shortsize='$shortsize'
23875 sig_count='$sig_count'
23876 sig_name='$sig_name'
23877 sig_name_init='$sig_name_init'
23879 sig_num_init='$sig_num_init'
23880 sig_size='$sig_size'
23881 signal_t='$signal_t'
23882 sitearch='$sitearch'
23883 sitearchexp='$sitearchexp'
23885 sitebinexp='$sitebinexp'
23886 sitehtml1dir='$sitehtml1dir'
23887 sitehtml1direxp='$sitehtml1direxp'
23888 sitehtml3dir='$sitehtml3dir'
23889 sitehtml3direxp='$sitehtml3direxp'
23891 sitelib_stem='$sitelib_stem'
23892 sitelibexp='$sitelibexp'
23893 siteman1dir='$siteman1dir'
23894 siteman1direxp='$siteman1direxp'
23895 siteman3dir='$siteman3dir'
23896 siteman3direxp='$siteman3direxp'
23897 siteprefix='$siteprefix'
23898 siteprefixexp='$siteprefixexp'
23899 sitescript='$sitescript'
23900 sitescriptexp='$sitescriptexp'
23901 sizesize='$sizesize'
23902 sizetype='$sizetype'
23906 sockethdr='$sockethdr'
23907 socketlib='$socketlib'
23908 socksizetype='$socksizetype'
23910 spackage='$spackage'
23911 spitshell='$spitshell'
23912 srand48_r_proto='$srand48_r_proto'
23913 srandom_r_proto='$srandom_r_proto'
23915 ssizetype='$ssizetype'
23916 st_ino_sign='$st_ino_sign'
23917 st_ino_size='$st_ino_size'
23918 startperl='$startperl'
23920 static_ext='$static_ext'
23922 stdio_base='$stdio_base'
23923 stdio_bufsiz='$stdio_bufsiz'
23924 stdio_cnt='$stdio_cnt'
23925 stdio_filbuf='$stdio_filbuf'
23926 stdio_ptr='$stdio_ptr'
23927 stdio_stream_array='$stdio_stream_array'
23928 strerror_r_proto='$strerror_r_proto'
23931 subversion='$subversion'
23936 targetarch='$targetarch'
23937 targetdir='$targetdir'
23938 targetenv='$targetenv'
23939 targethost='$targethost'
23940 targetmkdir='$targetmkdir'
23941 targetport='$targetport'
23942 targetsh='$targetsh'
23946 timeincl='$timeincl'
23947 timetype='$timetype'
23948 tmpnam_r_proto='$tmpnam_r_proto'
23954 ttyname_r_proto='$ttyname_r_proto'
23963 uidformat='$uidformat'
23969 uquadtype='$uquadtype'
23970 use5005threads='$use5005threads'
23971 use64bitall='$use64bitall'
23972 use64bitint='$use64bitint'
23973 usecbacktrace='$usecbacktrace'
23974 usecrosscompile='$usecrosscompile'
23975 usedevel='$usedevel'
23977 usedtrace='$usedtrace'
23978 usefaststdio='$usefaststdio'
23979 useithreads='$useithreads'
23980 usekernprocpathname='$usekernprocpathname'
23981 uselargefiles='$uselargefiles'
23982 uselongdouble='$uselongdouble'
23983 usemallocwrap='$usemallocwrap'
23984 usemorebits='$usemorebits'
23985 usemultiplicity='$usemultiplicity'
23986 usemymalloc='$usemymalloc'
23988 usensgetexecutablepath='$usensgetexecutablepath'
23989 useopcode='$useopcode'
23990 useperlio='$useperlio'
23991 useposix='$useposix'
23992 usereentrant='$usereentrant'
23993 userelocatableinc='$userelocatableinc'
23994 useshrplib='$useshrplib'
23995 usesitecustomize='$usesitecustomize'
23996 usesocks='$usesocks'
23997 usethreads='$usethreads'
23998 usevendorprefix='$usevendorprefix'
23999 useversionedarchname='$useversionedarchname'
24000 usevfork='$usevfork'
24003 uvXUformat='$uvXUformat'
24004 uvoformat='$uvoformat'
24007 uvuformat='$uvuformat'
24008 uvxformat='$uvxformat'
24010 vendorarch='$vendorarch'
24011 vendorarchexp='$vendorarchexp'
24012 vendorbin='$vendorbin'
24013 vendorbinexp='$vendorbinexp'
24014 vendorhtml1dir='$vendorhtml1dir'
24015 vendorhtml1direxp='$vendorhtml1direxp'
24016 vendorhtml3dir='$vendorhtml3dir'
24017 vendorhtml3direxp='$vendorhtml3direxp'
24018 vendorlib='$vendorlib'
24019 vendorlib_stem='$vendorlib_stem'
24020 vendorlibexp='$vendorlibexp'
24021 vendorman1dir='$vendorman1dir'
24022 vendorman1direxp='$vendorman1direxp'
24023 vendorman3dir='$vendorman3dir'
24024 vendorman3direxp='$vendorman3direxp'
24025 vendorprefix='$vendorprefix'
24026 vendorprefixexp='$vendorprefixexp'
24027 vendorscript='$vendorscript'
24028 vendorscriptexp='$vendorscriptexp'
24030 version_patchlevel_string='$version_patchlevel_string'
24031 versiononly='$versiononly'
24035 yaccflags='$yaccflags'
24040 : add special variables
24041 $test -f $src/patchlevel.h && \
24042 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24043 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24044 echo "PERL_CONFIG_SH=true" >>config.sh
24046 : propagate old symbols
24047 if $test -f UU/config.sh; then
24048 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24049 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24050 config.sh config.sh UU/oldconfig.sh |\
24051 $sort | $uniq -u >UU/oldsyms
24052 set X `$cat UU/oldsyms`
24058 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24060 echo ": Variables propagated from previous config.sh file." >>config.sh
24061 for sym in `$cat UU/oldsyms`; do
24062 echo " Propagating $hint variable "'$'"$sym..."
24063 eval 'tmp="$'"${sym}"'"'
24065 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24071 : preserve RCS keywords in files with variable substitution, grrr
24074 : Finish up by extracting the .SH files
24078 echo "Extraction done."
24088 If you'd like to make any changes to the config.sh file before I begin
24089 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24092 rp="Press return or use a shell escape to edit config.sh:"
24097 *) : in case they cannot read
24098 sh 1>&4 -c "$ans";;
24103 : if this fails, just run all the .SH files by hand
24112 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24119 Now you need to generate make dependencies by running "$make depend".
24120 You might prefer to run it in background: "$make depend > makedepend.out &"
24121 It can take a while, so you might not want to run it right now.
24126 rp="Run $make depend now?"
24130 $make depend && echo "Now you must run '$make'."
24133 echo "You must run '$make depend' then '$make'."
24136 elif test -f [Mm]akefile; then
24138 echo "Now you must run a $make."
24140 echo "Configure done."
24143 if $test -f Policy.sh; then
24146 If you compile $package on a different machine or from a different object
24147 directory, copy the Policy.sh file from this object directory to the
24148 new one before you run Configure -- this will help you with most of
24149 the policy defaults.
24153 if $test -f config.msg; then
24154 echo "Hmm. I also noted the following information while running:"
24156 $cat config.msg >&4
24159 $rm -f kit*isdone ark*isdone