77# Check if the C compiler understands signed types.
88AC_DEFUN ( [ PGAC_C_SIGNED] ,
99[ 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;] ) ] ,
1212[ pgac_cv_c_signed=yes] ,
1313[ pgac_cv_c_signed=no] ) ] )
1414if test x"$pgac_cv_c_signed" = xno ; then
@@ -81,7 +81,7 @@ AC_DEFUN([PGAC_TYPE_64BIT_INT],
8181[ define ( [ Ac_define] , [ translit ( [ have_$1 _64] , [ a-z *] , [ A-Z_P] ) ] ) dnl
8282define ( [ Ac_cachevar] , [ translit ( [ pgac_cv_type_$1 _64] , [ *] , [ _p] ) ] ) dnl
8383AC_CACHE_CHECK ( [ whether $1 is 64 bits] , [ Ac_cachevar] ,
84- [ AC_TRY_RUN (
84+ [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE (
8585[ typedef $1 ac_int64;
8686
8787/*
@@ -107,7 +107,7 @@ int does_int64_work()
107107}
108108main() {
109109 exit(! does_int64_work());
110- }] ,
110+ }] ) ] ,
111111[ Ac_cachevar=yes] ,
112112[ Ac_cachevar=no] ,
113113[ # If cross-compiling, check the size reported by the compiler and
@@ -169,17 +169,17 @@ fi])# PGAC_TYPE_128BIT_INT
169169# Define HAVE_FUNCNAME__FUNC or HAVE_FUNCNAME__FUNCTION accordingly.
170170AC_DEFUN ( [ PGAC_C_FUNCNAME_SUPPORT] ,
171171[ 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__);] ) ] ,
174174[ pgac_cv_funcname_func_support=yes] ,
175175[ pgac_cv_funcname_func_support=no] ) ] )
176176if test x"$pgac_cv_funcname_func_support" = xyes ; then
177177AC_DEFINE ( HAVE_FUNCNAME__FUNC , 1 ,
178178 [ Define to 1 if your compiler understands __func__.] )
179179else
180180AC_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__);] ) ] ,
183183[ pgac_cv_funcname_function_support=yes] ,
184184[ pgac_cv_funcname_function_support=no] ) ] )
185185if test x"$pgac_cv_funcname_function_support" = xyes ; then
@@ -199,8 +199,8 @@ fi])# PGAC_C_FUNCNAME_SUPPORT
199199# gcc-style compound expressions to be able to wrap the thing into macros.
200200AC_DEFUN ( [ PGAC_C_STATIC_ASSERT] ,
201201[ 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"); })] ) ] ,
204204[ pgac_cv__static_assert=yes] ,
205205[ pgac_cv__static_assert=no] ) ] )
206206if test x"$pgac_cv__static_assert" = xyes ; then
@@ -219,8 +219,8 @@ fi])# PGAC_C_STATIC_ASSERT
219219# have the former and not the latter.
220220AC_DEFUN ( [ PGAC_C_TYPES_COMPATIBLE] ,
221221[ 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)] ; ] ] ) ] ,
224224[ pgac_cv__types_compatible=yes] ,
225225[ pgac_cv__types_compatible=no] ) ] )
226226if test x"$pgac_cv__types_compatible" = xyes ; then
@@ -236,8 +236,9 @@ fi])# PGAC_C_TYPES_COMPATIBLE
236236# and define HAVE__BUILTIN_BSWAP32 if so.
237237AC_DEFUN ( [ PGAC_C_BUILTIN_BSWAP32] ,
238238[ 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+ ) ] ,
241242[ pgac_cv__builtin_bswap32=yes] ,
242243[ pgac_cv__builtin_bswap32=no] ) ] )
243244if test x"$pgac_cv__builtin_bswap32" = xyes ; then
@@ -253,8 +254,9 @@ fi])# PGAC_C_BUILTIN_BSWAP32
253254# and define HAVE__BUILTIN_CONSTANT_P if so.
254255AC_DEFUN ( [ PGAC_C_BUILTIN_CONSTANT_P] ,
255256[ 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+ ) ] ,
258260[ pgac_cv__builtin_constant_p=yes] ,
259261[ pgac_cv__builtin_constant_p=no] ) ] )
260262if test x"$pgac_cv__builtin_constant_p" = xyes ; then
@@ -274,8 +276,8 @@ fi])# PGAC_C_BUILTIN_CONSTANT_P
274276# and only a warning instead of an error would be produced.
275277AC_DEFUN ( [ PGAC_C_BUILTIN_UNREACHABLE] ,
276278[ 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();] ) ] ,
279281[ pgac_cv__builtin_unreachable=yes] ,
280282[ pgac_cv__builtin_unreachable=no] ) ] )
281283if test x"$pgac_cv__builtin_unreachable" = xyes ; then
@@ -291,10 +293,10 @@ fi])# PGAC_C_BUILTIN_UNREACHABLE
291293# and define HAVE__VA_ARGS if so.
292294AC_DEFUN ( [ PGAC_C_VA_ARGS] ,
293295[ 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>] ,
295297[ #define debug(...) fprintf(stderr, __VA_ARGS__)
296298debug("%s", "blarg");
297- ] ,
299+ ] ) ] ,
298300[ pgac_cv__va_args=yes] ,
299301[ pgac_cv__va_args=no] ) ] )
300302if test x"$pgac_cv__va_args" = xyes ; then
@@ -386,10 +388,10 @@ undefine([Ac_cachevar])dnl
386388# NB: Some platforms only do 32bit tas, others only do 8bit tas. Test both.
387389AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_CHAR_TAS] ,
388390[ 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 ( [ ] ,
390392 [ char lock = 0;
391393 __sync_lock_test_and_set(&lock, 1);
392- __sync_lock_release(&lock);] ,
394+ __sync_lock_release(&lock);] ) ] ,
393395 [ pgac_cv_gcc_sync_char_tas="yes"] ,
394396 [ pgac_cv_gcc_sync_char_tas="no"] ) ] )
395397if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
@@ -402,10 +404,10 @@ fi])# PGAC_HAVE_GCC__SYNC_CHAR_TAS
402404# and define HAVE_GCC__SYNC_INT32_TAS
403405AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT32_TAS] ,
404406[ 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 ( [ ] ,
406408 [ int lock = 0;
407409 __sync_lock_test_and_set(&lock, 1);
408- __sync_lock_release(&lock);] ,
410+ __sync_lock_release(&lock);] ) ] ,
409411 [ pgac_cv_gcc_sync_int32_tas="yes"] ,
410412 [ pgac_cv_gcc_sync_int32_tas="no"] ) ] )
411413if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
@@ -418,9 +420,9 @@ fi])# PGAC_HAVE_GCC__SYNC_INT32_TAS
418420# types, and define HAVE_GCC__SYNC_INT32_CAS if so.
419421AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT32_CAS] ,
420422[ 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 ( [ ] ,
422424 [ int val = 0;
423- __sync_val_compare_and_swap(&val, 0, 37);] ,
425+ __sync_val_compare_and_swap(&val, 0, 37);] ) ] ,
424426 [ pgac_cv_gcc_sync_int32_cas="yes"] ,
425427 [ pgac_cv_gcc_sync_int32_cas="no"] ) ] )
426428if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
@@ -433,9 +435,9 @@ fi])# PGAC_HAVE_GCC__SYNC_INT32_CAS
433435# types, and define HAVE_GCC__SYNC_INT64_CAS if so.
434436AC_DEFUN ( [ PGAC_HAVE_GCC__SYNC_INT64_CAS] ,
435437[ 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 ( [ ] ,
437439 [ 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);] ) ] ,
439441 [ pgac_cv_gcc_sync_int64_cas="yes"] ,
440442 [ pgac_cv_gcc_sync_int64_cas="no"] ) ] )
441443if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
@@ -448,10 +450,10 @@ fi])# PGAC_HAVE_GCC__SYNC_INT64_CAS
448450# types, and define HAVE_GCC__ATOMIC_INT32_CAS if so.
449451AC_DEFUN ( [ PGAC_HAVE_GCC__ATOMIC_INT32_CAS] ,
450452[ 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 ( [ ] ,
452454 [ int val = 0;
453455 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);] ) ] ,
455457 [ pgac_cv_gcc_atomic_int32_cas="yes"] ,
456458 [ pgac_cv_gcc_atomic_int32_cas="no"] ) ] )
457459if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
@@ -464,10 +466,10 @@ fi])# PGAC_HAVE_GCC__ATOMIC_INT32_CAS
464466# types, and define HAVE_GCC__ATOMIC_INT64_CAS if so.
465467AC_DEFUN ( [ PGAC_HAVE_GCC__ATOMIC_INT64_CAS] ,
466468[ 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 ( [ ] ,
468470 [ PG_INT64_TYPE val = 0;
469471 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);] ) ] ,
471473 [ pgac_cv_gcc_atomic_int64_cas="yes"] ,
472474 [ pgac_cv_gcc_atomic_int64_cas="no"] ) ] )
473475if 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
490492CFLAGS="$pgac_save_CFLAGS $1 "
491493ac_save_c_werror_flag=$ac_c_werror_flag
492494ac_c_werror_flag=yes
493- AC_TRY_LINK ( [ #include <nmmintrin.h>] ,
495+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <nmmintrin.h>] ,
494496 [ unsigned int crc = 0;
495497 crc = _mm_crc32_u8(crc, 0);
496- crc = _mm_crc32_u32(crc, 0);] ,
498+ crc = _mm_crc32_u32(crc, 0);] ) ] ,
497499 [ Ac_cachevar=yes] ,
498500 [ Ac_cachevar=no] )
499501ac_c_werror_flag=$ac_save_c_werror_flag
0 commit comments