3120
3231
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3233
if test -n "$ac_tool_prefix"; then
3234
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3235
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3236
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3237
$as_echo_n "checking for $ac_word... " >&6; }
3238
if test "${ac_cv_prog_RANLIB+set}" = set; then :
3239
$as_echo_n "(cached) " >&6
3241
if test -n "$RANLIB"; then
3242
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3244
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3248
test -z "$as_dir" && as_dir=.
3249
for ac_exec_ext in '' $ac_executable_extensions; do
3250
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3251
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3252
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3261
RANLIB=$ac_cv_prog_RANLIB
3262
if test -n "$RANLIB"; then
3263
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
3264
$as_echo "$RANLIB" >&6; }
3266
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3267
$as_echo "no" >&6; }
3272
if test -z "$ac_cv_prog_RANLIB"; then
3273
ac_ct_RANLIB=$RANLIB
3274
# Extract the first word of "ranlib", so it can be a program name with args.
3275
set dummy ranlib; ac_word=$2
3276
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3277
$as_echo_n "checking for $ac_word... " >&6; }
3278
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
3279
$as_echo_n "(cached) " >&6
3281
if test -n "$ac_ct_RANLIB"; then
3282
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3284
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3288
test -z "$as_dir" && as_dir=.
3289
for ac_exec_ext in '' $ac_executable_extensions; do
3290
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3291
ac_cv_prog_ac_ct_RANLIB="ranlib"
3292
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3301
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3302
if test -n "$ac_ct_RANLIB"; then
3303
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
3304
$as_echo "$ac_ct_RANLIB" >&6; }
3306
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3307
$as_echo "no" >&6; }
3310
if test "x$ac_ct_RANLIB" = x; then
3313
case $cross_compiling:$ac_tool_warned in
3315
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3316
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3317
ac_tool_warned=yes ;;
3319
RANLIB=$ac_ct_RANLIB
3322
RANLIB="$ac_cv_prog_RANLIB"
3325
if test -n "$ac_tool_prefix"; then
3326
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3327
set dummy ${ac_tool_prefix}ar; ac_word=$2
3328
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3329
$as_echo_n "checking for $ac_word... " >&6; }
3330
if test "${ac_cv_prog_AR+set}" = set; then :
3331
$as_echo_n "(cached) " >&6
3333
if test -n "$AR"; then
3334
ac_cv_prog_AR="$AR" # Let the user override the test.
3336
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3340
test -z "$as_dir" && as_dir=.
3341
for ac_exec_ext in '' $ac_executable_extensions; do
3342
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3343
ac_cv_prog_AR="${ac_tool_prefix}ar"
3344
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3354
if test -n "$AR"; then
3355
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
3356
$as_echo "$AR" >&6; }
3358
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3359
$as_echo "no" >&6; }
3364
if test -z "$ac_cv_prog_AR"; then
3366
# Extract the first word of "ar", so it can be a program name with args.
3367
set dummy ar; ac_word=$2
3368
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3369
$as_echo_n "checking for $ac_word... " >&6; }
3370
if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
3371
$as_echo_n "(cached) " >&6
3373
if test -n "$ac_ct_AR"; then
3374
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3376
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3380
test -z "$as_dir" && as_dir=.
3381
for ac_exec_ext in '' $ac_executable_extensions; do
3382
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3383
ac_cv_prog_ac_ct_AR="ar"
3384
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3393
ac_ct_AR=$ac_cv_prog_ac_ct_AR
3394
if test -n "$ac_ct_AR"; then
3395
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
3396
$as_echo "$ac_ct_AR" >&6; }
3398
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3399
$as_echo "no" >&6; }
3402
if test "x$ac_ct_AR" = x; then
3405
case $cross_compiling:$ac_tool_warned in
3407
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3408
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3409
ac_tool_warned=yes ;;
3417
if test -z "$AR"; then
3418
as_fn_error $? "cannot find ar" "$LINENO" 5
3124
3422
# The later defininition of _XOPEN_SOURCE disables certain features
3954
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C99 vsnprintf" >&5
3955
$as_echo_n "checking for C99 vsnprintf... " >&6; }
3956
if test "${ccache_cv_HAVE_C99_VSNPRINTF+set}" = set; then :
3957
$as_echo_n "(cached) " >&6
3960
if test "$cross_compiling" = yes; then :
3961
ccache_cv_HAVE_C99_VSNPRINTF=cross
3963
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3964
/* end confdefs.h. */
3966
#include <sys/types.h>
4338
# $Id: snprintf.m4,v 1.1.1.1 2008/01/06 03:24:00 holger Exp $
4340
# Copyright (c) 2008 Holger Weiss <holger@jhweiss.de>.
4342
# This code may freely be used, modified and/or redistributed for any purpose.
4343
# It would be nice if additions and fixes to this file (including trivial code
4344
# cleanups) would be sent back in order to let me include them in the version
4345
# available at <http://www.jhweiss.de/software/snprintf.html>. However, this is
4346
# not a requirement for using or redistributing (possibly modified) versions of
4347
# this file, nor is leaving this notice intact mandatory.
4349
# HW_HEADER_STDARG_H
4350
# ------------------
4351
# Define HAVE_STDARG_H to 1 if <stdarg.h> is available.
4352
# HW_HEADER_STDARG_H
4354
# HW_HEADER_VARARGS_H
4355
# -------------------
4356
# Define HAVE_VARARGS_H to 1 if <varargs.h> is available.
4357
# HW_HEADER_VARARGS_H
4361
# Set $hw_cv_func_va_copy to "yes" or "no". Define HAVE_VA_COPY to 1 if
4362
# $hw_cv_func_va_copy is set to "yes". Note that it's "unspecified whether
4363
# va_copy and va_end are macros or identifiers declared with external linkage."
4364
# (C99: 7.15.1, 1) Therefore, the presence of va_copy(3) cannot simply "be
4365
# tested with #ifdef", as suggested by the Autoconf manual (5.5.1).
4370
# Set $hw_cv_func___va_copy to "yes" or "no". Define HAVE___VA_COPY to 1 if
4371
# $hw_cv_func___va_copy is set to "yes".
4376
# Set $hw_cv_func_vsnprintf and $hw_cv_func_vsnprintf_c99 to "yes" or "no",
4377
# respectively. Define HAVE_VSNPRINTF to 1 only if $hw_cv_func_vsnprintf_c99
4378
# is set to "yes". Otherwise, define vsnprintf to rpl_vsnprintf and make sure
4379
# the replacement function will be built.
4384
# Set $hw_cv_func_snprintf and $hw_cv_func_snprintf_c99 to "yes" or "no",
4385
# respectively. Define HAVE_SNPRINTF to 1 only if $hw_cv_func_snprintf_c99
4386
# is set to "yes". Otherwise, define snprintf to rpl_snprintf and make sure
4387
# the replacement function will be built.
4392
# Set $hw_cv_func_vasprintf to "yes" or "no". Define HAVE_VASPRINTF to 1 if
4393
# $hw_cv_func_vasprintf is set to "yes". Otherwise, define vasprintf to
4394
# rpl_vasprintf and make sure the replacement function will be built.
4399
# Set $hw_cv_func_asprintf to "yes" or "no". Define HAVE_ASPRINTF to 1 if
4400
# $hw_cv_func_asprintf is set to "yes". Otherwise, define asprintf to
4401
# rpl_asprintf and make sure the replacement function will be built.
4404
# _HW_FUNC_XPRINTF_REPLACE
4405
# ------------------------
4406
# Arrange for building snprintf.c. Must be called if one or more of the
4407
# functions provided by snprintf.c are needed.
4408
# _HW_FUNC_XPRINTF_REPLACE
4414
for ac_header in $ac_header_list
4416
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
4417
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
4419
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
4420
cat >>confdefs.h <<_ACEOF
4421
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
4434
ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
4435
if test "x$ac_cv_func_vsnprintf" = x""yes; then :
4436
hw_cv_func_vsnprintf=yes
4438
hw_cv_func_vsnprintf=no
4441
if test "$hw_cv_func_vsnprintf" = yes; then :
4442
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf is C99 compliant" >&5
4443
$as_echo_n "checking whether vsnprintf is C99 compliant... " >&6; }
4444
if test "${hw_cv_func_vsnprintf_c99+set}" = set; then :
4445
$as_echo_n "(cached) " >&6
4447
if test "$cross_compiling" = yes; then :
4448
hw_cv_func_vsnprintf_c99=no
4450
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4451
/* end confdefs.h. */
4456
static int testprintf(char *buf, size_t size, const char *format, ...)
4460
va_start(ap, format);
4461
result = vsnprintf(buf, size, format, ap);
4469
if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
4470
testprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
4471
buf[0] != 'T' || buf[3] != '\0')
4477
if ac_fn_c_try_run "$LINENO"; then :
4478
hw_cv_func_vsnprintf_c99=yes
4480
hw_cv_func_vsnprintf_c99=no
4482
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
4483
conftest.$ac_objext conftest.beam conftest.$ac_ext
4487
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_vsnprintf_c99" >&5
4488
$as_echo "$hw_cv_func_vsnprintf_c99" >&6; }
4490
hw_cv_func_snprintf_c99=no
4492
if test "$hw_cv_func_vsnprintf_c99" = yes; then :
4494
$as_echo "#define HAVE_VSNPRINTF 1" >>confdefs.h
4497
for ac_header in inttypes.h locale.h stddef.h stdint.h
4499
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
4500
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
4501
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
4502
cat >>confdefs.h <<_ACEOF
4503
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
4510
ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
4512
if test "x$ac_cv_member_struct_lconv_decimal_point" = x""yes; then :
4514
cat >>confdefs.h <<_ACEOF
4515
#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
4520
ac_fn_c_check_member "$LINENO" "struct lconv" "thousands_sep" "ac_cv_member_struct_lconv_thousands_sep" "#include <locale.h>
4522
if test "x$ac_cv_member_struct_lconv_thousands_sep" = x""yes; then :
4524
cat >>confdefs.h <<_ACEOF
4525
#define HAVE_STRUCT_LCONV_THOUSANDS_SEP 1
4532
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
4533
$as_echo_n "checking for long long int... " >&6; }
4534
if test "${ac_cv_type_long_long_int+set}" = set; then :
4535
$as_echo_n "(cached) " >&6
4537
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4538
/* end confdefs.h. */
4540
/* For now, do not test the preprocessor; as of 2007 there are too many
4541
implementations with broken preprocessors. Perhaps this can
4542
be revisited in 2012. In the meantime, code should not expect
4543
#if to work with literals wider than 32 bits. */
4544
/* Test literals. */
4545
long long int ll = 9223372036854775807ll;
4546
long long int nll = -9223372036854775807LL;
4547
unsigned long long int ull = 18446744073709551615ULL;
4548
/* Test constant expressions. */
4549
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
4551
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
4557
/* Test availability of runtime routines for shift and division. */
4558
long long int llmax = 9223372036854775807ll;
4559
unsigned long long int ullmax = 18446744073709551615ull;
4560
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
4561
| (llmax / ll) | (llmax % ll)
4562
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
4563
| (ullmax / ull) | (ullmax % ull));
4569
if ac_fn_c_try_link "$LINENO"; then :
4570
if test "$cross_compiling" = yes; then :
4571
ac_cv_type_long_long_int=yes
4573
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4574
/* end confdefs.h. */
4578
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
4579
# define LLONG_MAX (HALF - 1 + HALF)
4584
long long int n = 1;
4588
long long int m = n << i;
4591
if (LLONG_MAX / 2 < m)
4599
if ac_fn_c_try_run "$LINENO"; then :
4600
ac_cv_type_long_long_int=yes
4602
ac_cv_type_long_long_int=no
4604
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
4605
conftest.$ac_objext conftest.beam conftest.$ac_ext
4609
ac_cv_type_long_long_int=no
4611
rm -f core conftest.err conftest.$ac_objext \
4612
conftest$ac_exeext conftest.$ac_ext
4614
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
4615
$as_echo "$ac_cv_type_long_long_int" >&6; }
4616
if test $ac_cv_type_long_long_int = yes; then
4618
$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
4623
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
4624
$as_echo_n "checking for unsigned long long int... " >&6; }
4625
if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then :
4626
$as_echo_n "(cached) " >&6
4628
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4629
/* end confdefs.h. */
4631
/* For now, do not test the preprocessor; as of 2007 there are too many
4632
implementations with broken preprocessors. Perhaps this can
4633
be revisited in 2012. In the meantime, code should not expect
4634
#if to work with literals wider than 32 bits. */
4635
/* Test literals. */
4636
long long int ll = 9223372036854775807ll;
4637
long long int nll = -9223372036854775807LL;
4638
unsigned long long int ull = 18446744073709551615ULL;
4639
/* Test constant expressions. */
4640
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
4642
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
4648
/* Test availability of runtime routines for shift and division. */
4649
long long int llmax = 9223372036854775807ll;
4650
unsigned long long int ullmax = 18446744073709551615ull;
4651
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
4652
| (llmax / ll) | (llmax % ll)
4653
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
4654
| (ullmax / ull) | (ullmax % ull));
4660
if ac_fn_c_try_link "$LINENO"; then :
4661
ac_cv_type_unsigned_long_long_int=yes
4663
ac_cv_type_unsigned_long_long_int=no
4665
rm -f core conftest.err conftest.$ac_objext \
4666
conftest$ac_exeext conftest.$ac_ext
4668
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
4669
$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
4670
if test $ac_cv_type_unsigned_long_long_int = yes; then
4672
$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
4676
ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
4677
if test "x$ac_cv_type_size_t" = x""yes; then :
4681
cat >>confdefs.h <<_ACEOF
4682
#define size_t unsigned int
4689
ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default"
4690
if test "x$ac_cv_type_intmax_t" = x""yes; then :
4692
$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
4695
test $ac_cv_type_long_long_int = yes \
4696
&& ac_type='long long int' \
4697
|| ac_type='long int'
4699
cat >>confdefs.h <<_ACEOF
4700
#define intmax_t $ac_type
4708
ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default"
4709
if test "x$ac_cv_type_uintmax_t" = x""yes; then :
4711
$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h
4714
test $ac_cv_type_unsigned_long_long_int = yes \
4715
&& ac_type='unsigned long long int' \
4716
|| ac_type='unsigned long int'
4718
cat >>confdefs.h <<_ACEOF
4719
#define uintmax_t $ac_type
4726
ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
4727
if test "x$ac_cv_type_uintptr_t" = x""yes; then :
4729
$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
4732
for ac_type in 'unsigned int' 'unsigned long int' \
4733
'unsigned long long int'; do
4734
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4735
/* end confdefs.h. */
4736
$ac_includes_default
4740
static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
4747
if ac_fn_c_try_compile "$LINENO"; then :
4749
cat >>confdefs.h <<_ACEOF
4750
#define uintptr_t $ac_type
4755
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4756
test -z "$ac_type" && break
4761
ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
4762
if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
4764
cat >>confdefs.h <<_ACEOF
4765
#define HAVE_PTRDIFF_T 1
4771
for ac_func in localeconv
4773
ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv"
4774
if test "x$ac_cv_func_localeconv" = x""yes; then :
4775
cat >>confdefs.h <<_ACEOF
4776
#define HAVE_LOCALECONV 1
4783
if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
4784
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
4785
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
4786
if test "${ac_cv_c_const+set}" = set; then :
4787
$as_echo_n "(cached) " >&6
4789
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4790
/* end confdefs.h. */
4795
/* FIXME: Include the comments suggested by Paul. */
4797
/* Ultrix mips cc rejects this. */
4798
typedef int charset[2];
4800
/* SunOS 4.1.1 cc rejects this. */
4801
char const *const *pcpcc;
4803
/* NEC SVR4.0.2 mips cc rejects this. */
4804
struct point {int x, y;};
4805
static struct point const zero = {0,0};
4806
/* AIX XL C 1.02.0.0 rejects this.
4807
It does not let you subtract one const X* pointer from another in
4808
an arm of an if-expression whose if-part is not a constant
4810
const char *g = "string";
4811
pcpcc = &g + (g ? g-g : 0);
4812
/* HPUX 7.0 cc rejects these. */
4814
ppc = (char**) pcpcc;
4815
pcpcc = (char const *const *) ppc;
4816
{ /* SCO 3.2v4 cc rejects this. */
4818
char const *s = 0 ? (char *) 0 : (char const *) 0;
4823
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
4825
const int *foo = &x[0];
4828
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4829
typedef const int *iptr;
4833
{ /* AIX XL C 1.02.0.0 rejects this saying
4834
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4835
struct s { int j; const int *ap[3]; };
4836
struct s *b; b->j = 5;
4838
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4842
return !cs[0] && !zero.x;
4849
if ac_fn_c_try_compile "$LINENO"; then :
4854
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4856
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
4857
$as_echo "$ac_cv_c_const" >&6; }
4858
if test $ac_cv_c_const = no; then
4860
$as_echo "#define const /**/" >>confdefs.h
4867
case " $LIBOBJS " in
4868
*" snprintf.$ac_objext "* ) ;;
4869
*) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
4873
_hw_cv_func_xprintf_replace_done=yes
4879
ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
4880
if test "x$ac_cv_func_snprintf" = x""yes; then :
4881
hw_cv_func_snprintf=yes
4883
hw_cv_func_snprintf=no
4886
if test "$hw_cv_func_snprintf" = yes; then :
4887
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf is C99 compliant" >&5
4888
$as_echo_n "checking whether snprintf is C99 compliant... " >&6; }
4889
if test "${hw_cv_func_snprintf_c99+set}" = set; then :
4890
$as_echo_n "(cached) " >&6
4892
if test "$cross_compiling" = yes; then :
4893
hw_cv_func_snprintf_c99=no
4895
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4896
/* end confdefs.h. */
3968
4897
#include <stdio.h>
3969
void foo(const char *format, ...) {
3974
va_start(ap, format);
3975
len = vsnprintf(0, 0, format, ap);
3977
if (len != 5) exit(1);
3979
if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
3983
main() { foo("hello"); }
3986
if ac_fn_c_try_run "$LINENO"; then :
3987
ccache_cv_HAVE_C99_VSNPRINTF=yes
3989
ccache_cv_HAVE_C99_VSNPRINTF=no
3991
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3992
conftest.$ac_objext conftest.beam conftest.$ac_ext
3996
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ccache_cv_HAVE_C99_VSNPRINTF" >&5
3997
$as_echo "$ccache_cv_HAVE_C99_VSNPRINTF" >&6; }
3998
if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
4000
$as_echo "#define HAVE_C99_VSNPRINTF 1" >>confdefs.h
4902
if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
4903
snprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
4904
buf[0] != 'T' || buf[3] != '\0')
4910
if ac_fn_c_try_run "$LINENO"; then :
4911
hw_cv_func_snprintf_c99=yes
4913
hw_cv_func_snprintf_c99=no
4915
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
4916
conftest.$ac_objext conftest.beam conftest.$ac_ext
4920
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_snprintf_c99" >&5
4921
$as_echo "$hw_cv_func_snprintf_c99" >&6; }
4923
hw_cv_func_snprintf_c99=no
4925
if test "$hw_cv_func_snprintf_c99" = yes; then :
4927
$as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h
4931
if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
4932
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
4933
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
4934
if test "${ac_cv_c_const+set}" = set; then :
4935
$as_echo_n "(cached) " >&6
4937
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4938
/* end confdefs.h. */
4943
/* FIXME: Include the comments suggested by Paul. */
4945
/* Ultrix mips cc rejects this. */
4946
typedef int charset[2];
4948
/* SunOS 4.1.1 cc rejects this. */
4949
char const *const *pcpcc;
4951
/* NEC SVR4.0.2 mips cc rejects this. */
4952
struct point {int x, y;};
4953
static struct point const zero = {0,0};
4954
/* AIX XL C 1.02.0.0 rejects this.
4955
It does not let you subtract one const X* pointer from another in
4956
an arm of an if-expression whose if-part is not a constant
4958
const char *g = "string";
4959
pcpcc = &g + (g ? g-g : 0);
4960
/* HPUX 7.0 cc rejects these. */
4962
ppc = (char**) pcpcc;
4963
pcpcc = (char const *const *) ppc;
4964
{ /* SCO 3.2v4 cc rejects this. */
4966
char const *s = 0 ? (char *) 0 : (char const *) 0;
4971
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
4973
const int *foo = &x[0];
4976
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4977
typedef const int *iptr;
4981
{ /* AIX XL C 1.02.0.0 rejects this saying
4982
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4983
struct s { int j; const int *ap[3]; };
4984
struct s *b; b->j = 5;
4986
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4990
return !cs[0] && !zero.x;
4997
if ac_fn_c_try_compile "$LINENO"; then :
5002
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5004
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
5005
$as_echo "$ac_cv_c_const" >&6; }
5006
if test $ac_cv_c_const = no; then
5008
$as_echo "#define const /**/" >>confdefs.h
5015
case " $LIBOBJS " in
5016
*" snprintf.$ac_objext "* ) ;;
5017
*) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
5021
_hw_cv_func_xprintf_replace_done=yes
5032
for ac_func in vasprintf
5034
ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
5035
if test "x$ac_cv_func_vasprintf" = x""yes; then :
5036
cat >>confdefs.h <<_ACEOF
5037
#define HAVE_VASPRINTF 1
5039
hw_cv_func_vasprintf=yes
5041
hw_cv_func_vasprintf=no
5045
if test "$hw_cv_func_vasprintf" = no; then :
5046
for ac_header in stdlib.h
5048
ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
5049
if test "x$ac_cv_header_stdlib_h" = x""yes; then :
5050
cat >>confdefs.h <<_ACEOF
5051
#define HAVE_STDLIB_H 1
5059
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
5060
$as_echo_n "checking for va_copy... " >&6; }
5061
if test "${hw_cv_func_va_copy+set}" = set; then :
5062
$as_echo_n "(cached) " >&6
5064
if test "$cross_compiling" = yes; then :
5065
hw_cv_func_va_copy=no
5067
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5068
/* end confdefs.h. */
5071
#elif HAVE_VARARGS_H
5072
#include <varargs.h>
5077
va_list ap, aq; va_copy(aq, ap);
5082
if ac_fn_c_try_run "$LINENO"; then :
5083
hw_cv_func_va_copy=yes
5085
hw_cv_func_va_copy=no
5087
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5088
conftest.$ac_objext conftest.beam conftest.$ac_ext
5092
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_va_copy" >&5
5093
$as_echo "$hw_cv_func_va_copy" >&6; }
5094
if test "$hw_cv_func_va_copy" = yes; then :
5096
$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h
5100
if test "$hw_cv_func_va_copy" = no; then :
5102
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5
5103
$as_echo_n "checking for __va_copy... " >&6; }
5104
if test "${hw_cv_func___va_copy+set}" = set; then :
5105
$as_echo_n "(cached) " >&6
5107
if test "$cross_compiling" = yes; then :
5108
hw_cv_func___va_copy=no
5110
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5111
/* end confdefs.h. */
5114
#elif HAVE_VARARGS_H
5115
#include <varargs.h>
5120
va_list ap, aq; __va_copy(aq, ap);
5125
if ac_fn_c_try_run "$LINENO"; then :
5126
hw_cv_func___va_copy=yes
5128
hw_cv_func___va_copy=no
5130
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5131
conftest.$ac_objext conftest.beam conftest.$ac_ext
5135
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func___va_copy" >&5
5136
$as_echo "$hw_cv_func___va_copy" >&6; }
5137
if test "$hw_cv_func___va_copy" = yes; then :
5139
$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h
5145
if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
5146
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
5147
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
5148
if test "${ac_cv_c_const+set}" = set; then :
5149
$as_echo_n "(cached) " >&6
5151
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5152
/* end confdefs.h. */
5157
/* FIXME: Include the comments suggested by Paul. */
5159
/* Ultrix mips cc rejects this. */
5160
typedef int charset[2];
5162
/* SunOS 4.1.1 cc rejects this. */
5163
char const *const *pcpcc;
5165
/* NEC SVR4.0.2 mips cc rejects this. */
5166
struct point {int x, y;};
5167
static struct point const zero = {0,0};
5168
/* AIX XL C 1.02.0.0 rejects this.
5169
It does not let you subtract one const X* pointer from another in
5170
an arm of an if-expression whose if-part is not a constant
5172
const char *g = "string";
5173
pcpcc = &g + (g ? g-g : 0);
5174
/* HPUX 7.0 cc rejects these. */
5176
ppc = (char**) pcpcc;
5177
pcpcc = (char const *const *) ppc;
5178
{ /* SCO 3.2v4 cc rejects this. */
5180
char const *s = 0 ? (char *) 0 : (char const *) 0;
5185
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
5187
const int *foo = &x[0];
5190
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5191
typedef const int *iptr;
5195
{ /* AIX XL C 1.02.0.0 rejects this saying
5196
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5197
struct s { int j; const int *ap[3]; };
5198
struct s *b; b->j = 5;
5200
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5204
return !cs[0] && !zero.x;
5211
if ac_fn_c_try_compile "$LINENO"; then :
5216
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5218
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
5219
$as_echo "$ac_cv_c_const" >&6; }
5220
if test $ac_cv_c_const = no; then
5222
$as_echo "#define const /**/" >>confdefs.h
5229
case " $LIBOBJS " in
5230
*" snprintf.$ac_objext "* ) ;;
5231
*) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
5235
_hw_cv_func_xprintf_replace_done=yes
5241
for ac_func in asprintf
5243
ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf"
5244
if test "x$ac_cv_func_asprintf" = x""yes; then :
5245
cat >>confdefs.h <<_ACEOF
5246
#define HAVE_ASPRINTF 1
5248
hw_cv_func_asprintf=yes
5250
hw_cv_func_asprintf=no
5254
if test "$hw_cv_func_asprintf" = no; then :
5256
if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
5257
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
5258
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
5259
if test "${ac_cv_c_const+set}" = set; then :
5260
$as_echo_n "(cached) " >&6
5262
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5263
/* end confdefs.h. */
5268
/* FIXME: Include the comments suggested by Paul. */
5270
/* Ultrix mips cc rejects this. */
5271
typedef int charset[2];
5273
/* SunOS 4.1.1 cc rejects this. */
5274
char const *const *pcpcc;
5276
/* NEC SVR4.0.2 mips cc rejects this. */
5277
struct point {int x, y;};
5278
static struct point const zero = {0,0};
5279
/* AIX XL C 1.02.0.0 rejects this.
5280
It does not let you subtract one const X* pointer from another in
5281
an arm of an if-expression whose if-part is not a constant
5283
const char *g = "string";
5284
pcpcc = &g + (g ? g-g : 0);
5285
/* HPUX 7.0 cc rejects these. */
5287
ppc = (char**) pcpcc;
5288
pcpcc = (char const *const *) ppc;
5289
{ /* SCO 3.2v4 cc rejects this. */
5291
char const *s = 0 ? (char *) 0 : (char const *) 0;
5296
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
5298
const int *foo = &x[0];
5301
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5302
typedef const int *iptr;
5306
{ /* AIX XL C 1.02.0.0 rejects this saying
5307
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5308
struct s { int j; const int *ap[3]; };
5309
struct s *b; b->j = 5;
5311
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5315
return !cs[0] && !zero.x;
5322
if ac_fn_c_try_compile "$LINENO"; then :
5327
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5329
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
5330
$as_echo "$ac_cv_c_const" >&6; }
5331
if test $ac_cv_c_const = no; then
5333
$as_echo "#define const /**/" >>confdefs.h
5340
case " $LIBOBJS " in
5341
*" snprintf.$ac_objext "* ) ;;
5342
*) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
5346
_hw_cv_func_xprintf_replace_done=yes
4004
5352
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib >= 1.2.3" >&5
4005
5353
$as_echo_n "checking for zlib >= 1.2.3... " >&6; }