7
7
# Check if the C compiler understands signed types.
8
8
AC_DEFUN ( [ PGAC_C_SIGNED] ,
9
9
[ AC_CACHE_CHECK ( for signed types , pgac_cv_c_signed ,
10
- [ AC_TRY_COMPILE ( [ ] ,
11
- [ signed char c; signed short s; signed int i;] ,
10
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
11
+ [ signed char c; signed short s; signed int i;] ) ] ,
12
12
[ pgac_cv_c_signed=yes] ,
13
13
[ pgac_cv_c_signed=no] ) ] )
14
14
if test x"$pgac_cv_c_signed" = xno ; then
@@ -81,7 +81,7 @@ AC_DEFUN([PGAC_TYPE_64BIT_INT],
81
81
[ define ( [ Ac_define] , [ translit ( [ have_$1 _64] , [ a-z *] , [ A-Z_P] ) ] ) dnl
82
82
define ( [ Ac_cachevar] , [ translit ( [ pgac_cv_type_$1 _64] , [ *] , [ _p] ) ] ) dnl
83
83
AC_CACHE_CHECK ( [ whether $1 is 64 bits] , [ Ac_cachevar] ,
84
- [ AC_TRY_RUN (
84
+ [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE (
85
85
[ typedef $1 ac_int64;
86
86
87
87
/*
@@ -107,7 +107,7 @@ int does_int64_work()
107
107
}
108
108
main() {
109
109
exit(! does_int64_work());
110
- }] ,
110
+ }] ) ] ,
111
111
[ Ac_cachevar=yes] ,
112
112
[ Ac_cachevar=no] ,
113
113
[ # If cross-compiling, check the size reported by the compiler and
@@ -169,17 +169,17 @@ fi])# PGAC_TYPE_128BIT_INT
169
169
# Define HAVE_FUNCNAME__FUNC or HAVE_FUNCNAME__FUNCTION accordingly.
170
170
AC_DEFUN ( [ PGAC_C_FUNCNAME_SUPPORT] ,
171
171
[ AC_CACHE_CHECK ( for __func__ , pgac_cv_funcname_func_support ,
172
- [ AC_TRY_COMPILE ( [ #include <stdio.h>] ,
173
- [ printf("%s\n", __func__);] ,
172
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>] ,
173
+ [ printf("%s\n", __func__);] ) ] ,
174
174
[ pgac_cv_funcname_func_support=yes] ,
175
175
[ pgac_cv_funcname_func_support=no] ) ] )
176
176
if test x"$pgac_cv_funcname_func_support" = xyes ; then
177
177
AC_DEFINE ( HAVE_FUNCNAME__FUNC , 1 ,
178
178
[ Define to 1 if your compiler understands __func__.] )
179
179
else
180
180
AC_CACHE_CHECK ( for __FUNCTION__ , pgac_cv_funcname_function_support ,
181
- [ AC_TRY_COMPILE ( [ #include <stdio.h>] ,
182
- [ printf("%s\n", __FUNCTION__);] ,
181
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>] ,
182
+ [ printf("%s\n", __FUNCTION__);] ) ] ,
183
183
[ pgac_cv_funcname_function_support=yes] ,
184
184
[ pgac_cv_funcname_function_support=no] ) ] )
185
185
if test x"$pgac_cv_funcname_function_support" = xyes ; then
@@ -199,8 +199,8 @@ fi])# PGAC_C_FUNCNAME_SUPPORT
199
199
# gcc-style compound expressions to be able to wrap the thing into macros.
200
200
AC_DEFUN ( [ PGAC_C_STATIC_ASSERT] ,
201
201
[ AC_CACHE_CHECK ( for _Static_assert , pgac_cv__static_assert ,
202
- [ AC_TRY_LINK ( [ ] ,
203
- [ ({ _Static_assert(1, "foo"); })] ,
202
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
203
+ [ ({ _Static_assert(1, "foo"); })] ) ] ,
204
204
[ pgac_cv__static_assert=yes] ,
205
205
[ pgac_cv__static_assert=no] ) ] )
206
206
if test x"$pgac_cv__static_assert" = xyes ; then
@@ -219,8 +219,8 @@ fi])# PGAC_C_STATIC_ASSERT
219
219
# have the former and not the latter.
220
220
AC_DEFUN ( [ PGAC_C_TYPES_COMPATIBLE] ,
221
221
[ AC_CACHE_CHECK ( for __builtin_types_compatible_p , pgac_cv__types_compatible ,
222
- [ AC_TRY_COMPILE ( [ ] ,
223
- [ int x; static int y[ __builtin_types_compatible_p(__typeof__(x), int)] ; ] ,
222
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
223
+ [ [ int x; static int y[ __builtin_types_compatible_p(__typeof__(x), int)] ; ] ] ) ] ,
224
224
[ pgac_cv__types_compatible=yes] ,
225
225
[ pgac_cv__types_compatible=no] ) ] )
226
226
if test x"$pgac_cv__types_compatible" = xyes ; then
@@ -236,8 +236,9 @@ fi])# PGAC_C_TYPES_COMPATIBLE
236
236
# and define HAVE__BUILTIN_BSWAP32 if so.
237
237
AC_DEFUN ( [ PGAC_C_BUILTIN_BSWAP32] ,
238
238
[ AC_CACHE_CHECK ( for __builtin_bswap32 , pgac_cv__builtin_bswap32 ,
239
- [ AC_TRY_COMPILE ( [ static unsigned long int x = __builtin_bswap32(0xaabbccdd);] ,
240
- [ ] ,
239
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE (
240
+ [ static unsigned long int x = __builtin_bswap32(0xaabbccdd);]
241
+ ) ] ,
241
242
[ pgac_cv__builtin_bswap32=yes] ,
242
243
[ pgac_cv__builtin_bswap32=no] ) ] )
243
244
if test x"$pgac_cv__builtin_bswap32" = xyes ; then
@@ -253,8 +254,9 @@ fi])# PGAC_C_BUILTIN_BSWAP32
253
254
# and define HAVE__BUILTIN_CONSTANT_P if so.
254
255
AC_DEFUN ( [ PGAC_C_BUILTIN_CONSTANT_P] ,
255
256
[ AC_CACHE_CHECK ( for __builtin_constant_p , pgac_cv__builtin_constant_p ,
256
- [ AC_TRY_COMPILE ( [ static int x; static int y[ __builtin_constant_p(x) ? x : 1] ;] ,
257
- [ ] ,
257
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE (
258
+ [ [ static int x; static int y[ __builtin_constant_p(x) ? x : 1] ;] ]
259
+ ) ] ,
258
260
[ pgac_cv__builtin_constant_p=yes] ,
259
261
[ pgac_cv__builtin_constant_p=no] ) ] )
260
262
if test x"$pgac_cv__builtin_constant_p" = xyes ; then
@@ -274,8 +276,8 @@ fi])# PGAC_C_BUILTIN_CONSTANT_P
274
276
# and only a warning instead of an error would be produced.
275
277
AC_DEFUN ( [ PGAC_C_BUILTIN_UNREACHABLE] ,
276
278
[ AC_CACHE_CHECK ( for __builtin_unreachable , pgac_cv__builtin_unreachable ,
277
- [ AC_TRY_LINK ( [ ] ,
278
- [ __builtin_unreachable();] ,
279
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
280
+ [ __builtin_unreachable();] ) ] ,
279
281
[ pgac_cv__builtin_unreachable=yes] ,
280
282
[ pgac_cv__builtin_unreachable=no] ) ] )
281
283
if test x"$pgac_cv__builtin_unreachable" = xyes ; then
@@ -291,10 +293,10 @@ fi])# PGAC_C_BUILTIN_UNREACHABLE
291
293
# and define HAVE__VA_ARGS if so.
292
294
AC_DEFUN ( [ PGAC_C_VA_ARGS] ,
293
295
[ AC_CACHE_CHECK ( for __VA_ARGS__ , pgac_cv__va_args ,
294
- [ AC_TRY_COMPILE ( [ #include <stdio.h>] ,
296
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>] ,
295
297
[ #define debug(...) fprintf(stderr, __VA_ARGS__)
296
298
debug("%s", "blarg");
297
- ] ,
299
+ ] ) ] ,
298
300
[ pgac_cv__va_args=yes] ,
299
301
[ pgac_cv__va_args=no] ) ] )
300
302
if test x"$pgac_cv__va_args" = xyes ; then
@@ -386,10 +388,10 @@ undefine([Ac_cachevar])dnl
386
388
# NB: Some platforms only do 32bit tas, others only do 8bit tas. Test both.
387
389
AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_CHAR_TAS] ,
388
390
[ AC_CACHE_CHECK ( for builtin __sync char locking functions , pgac_cv_gcc_sync_char_tas ,
389
- [ AC_TRY_LINK ( [ ] ,
391
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
390
392
[ char lock = 0;
391
393
__sync_lock_test_and_set(&lock, 1);
392
- __sync_lock_release(&lock);] ,
394
+ __sync_lock_release(&lock);] ) ] ,
393
395
[ pgac_cv_gcc_sync_char_tas="yes"] ,
394
396
[ pgac_cv_gcc_sync_char_tas="no"] ) ] )
395
397
if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
@@ -402,10 +404,10 @@ fi])# PGAC_HAVE_GCC__SYNC_CHAR_TAS
402
404
# and define HAVE_GCC__SYNC_INT32_TAS
403
405
AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT32_TAS] ,
404
406
[ AC_CACHE_CHECK ( for builtin __sync int32 locking functions , pgac_cv_gcc_sync_int32_tas ,
405
- [ AC_TRY_LINK ( [ ] ,
407
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
406
408
[ int lock = 0;
407
409
__sync_lock_test_and_set(&lock, 1);
408
- __sync_lock_release(&lock);] ,
410
+ __sync_lock_release(&lock);] ) ] ,
409
411
[ pgac_cv_gcc_sync_int32_tas="yes"] ,
410
412
[ pgac_cv_gcc_sync_int32_tas="no"] ) ] )
411
413
if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
@@ -418,9 +420,9 @@ fi])# PGAC_HAVE_GCC__SYNC_INT32_TAS
418
420
# types, and define HAVE_GCC__SYNC_INT32_CAS if so.
419
421
AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT32_CAS] ,
420
422
[ AC_CACHE_CHECK ( for builtin __sync int32 atomic operations , pgac_cv_gcc_sync_int32_cas ,
421
- [ AC_TRY_LINK ( [ ] ,
423
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
422
424
[ int val = 0;
423
- __sync_val_compare_and_swap(&val, 0, 37);] ,
425
+ __sync_val_compare_and_swap(&val, 0, 37);] ) ] ,
424
426
[ pgac_cv_gcc_sync_int32_cas="yes"] ,
425
427
[ pgac_cv_gcc_sync_int32_cas="no"] ) ] )
426
428
if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
@@ -433,9 +435,9 @@ fi])# PGAC_HAVE_GCC__SYNC_INT32_CAS
433
435
# types, and define HAVE_GCC__SYNC_INT64_CAS if so.
434
436
AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT64_CAS] ,
435
437
[ AC_CACHE_CHECK ( for builtin __sync int64 atomic operations , pgac_cv_gcc_sync_int64_cas ,
436
- [ AC_TRY_LINK ( [ ] ,
438
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
437
439
[ PG_INT64_TYPE lock = 0;
438
- __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);] ,
440
+ __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);] ) ] ,
439
441
[ pgac_cv_gcc_sync_int64_cas="yes"] ,
440
442
[ pgac_cv_gcc_sync_int64_cas="no"] ) ] )
441
443
if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
@@ -448,10 +450,10 @@ fi])# PGAC_HAVE_GCC__SYNC_INT64_CAS
448
450
# types, and define HAVE_GCC__ATOMIC_INT32_CAS if so.
449
451
AC_DEFUN ( [ PGAC_HAVE_GCC__ATOMIC_INT32_CAS] ,
450
452
[ AC_CACHE_CHECK ( for builtin __atomic int32 atomic operations , pgac_cv_gcc_atomic_int32_cas ,
451
- [ AC_TRY_LINK ( [ ] ,
453
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
452
454
[ int val = 0;
453
455
int expect = 0;
454
- __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);] ,
456
+ __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);] ) ] ,
455
457
[ pgac_cv_gcc_atomic_int32_cas="yes"] ,
456
458
[ pgac_cv_gcc_atomic_int32_cas="no"] ) ] )
457
459
if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
@@ -464,10 +466,10 @@ fi])# PGAC_HAVE_GCC__ATOMIC_INT32_CAS
464
466
# types, and define HAVE_GCC__ATOMIC_INT64_CAS if so.
465
467
AC_DEFUN ( [ PGAC_HAVE_GCC__ATOMIC_INT64_CAS] ,
466
468
[ AC_CACHE_CHECK ( for builtin __atomic int64 atomic operations , pgac_cv_gcc_atomic_int64_cas ,
467
- [ AC_TRY_LINK ( [ ] ,
469
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ,
468
470
[ PG_INT64_TYPE val = 0;
469
471
PG_INT64_TYPE expect = 0;
470
- __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);] ,
472
+ __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);] ) ] ,
471
473
[ pgac_cv_gcc_atomic_int64_cas="yes"] ,
472
474
[ pgac_cv_gcc_atomic_int64_cas="no"] ) ] )
473
475
if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
@@ -490,10 +492,10 @@ AC_CACHE_CHECK([for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=$1], [Ac_cachevar
490
492
CFLAGS="$pgac_save_CFLAGS $1 "
491
493
ac_save_c_werror_flag=$ac_c_werror_flag
492
494
ac_c_werror_flag=yes
493
- AC_TRY_LINK ( [ #include <nmmintrin.h>] ,
495
+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <nmmintrin.h>] ,
494
496
[ unsigned int crc = 0;
495
497
crc = _mm_crc32_u8(crc, 0);
496
- crc = _mm_crc32_u32(crc, 0);] ,
498
+ crc = _mm_crc32_u32(crc, 0);] ) ] ,
497
499
[ Ac_cachevar=yes] ,
498
500
[ Ac_cachevar=no] )
499
501
ac_c_werror_flag=$ac_save_c_werror_flag
0 commit comments