AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
AC_MSG_CHECKING(for $1)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <inttypes.h>
#elif HAVE_STDINT_H
#include <stdint.h>
-#endif],
-[if (($1 *) 0)
+#endif]],
+[[if (($1 *) 0)
return 0;
if (sizeof ($1))
return 0;
-],[
+]])],[
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
AC_MSG_RESULT(yes)
-], AC_MSG_RESULT(no)
-)dnl
+], [AC_MSG_RESULT(no)
+])dnl
])
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
dnl test whether double cast to long preserves least significant bits
AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <limits.h>
int main()
}
exit(1);
}
-], [
+]])], [
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
AC_MSG_RESULT(yes)
], [
dnl this also does the logarithmic test for ZEND_MM.
AC_MSG_CHECKING(for MM alignment and log values)
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
typedef union _mm_align_test {
exit(0);
}
-], [
+]])], [
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
LIBZEND_MM_ALIGN_LOG2=`cat conftest.zend | cut -d ' ' -f 2`
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, $LIBZEND_MM_ALIGN, [ ])
dnl test for memory allocation using mmap(MAP_ANON)
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
}
return 0;
}
-], [
+]])], [
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
AC_MSG_RESULT(yes)
], [
dnl test for memory allocation using mmap("/dev/zero")
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
}
return 0;
}
-], [
+]])], [
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
AC_MSG_RESULT(yes)
], [
])
AC_MSG_CHECKING(for global register variables support)
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if defined(__GNUC__)
# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#else
FP = orig_fp;
IP = orig_ip;
}
- ], [
- ], [
+ ]], [[
+ ]])], [
ZEND_GCC_GLOBAL_REGS=yes
], [
ZEND_GCC_GLOBAL_REGS=no
dnl Check if atof() accepts NAN
dnl
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
{
return zend_isnan(atof("NAN")) ? 0 : 1;
}
-],[
+]])],[
ac_cv_atof_accept_nan=yes
],[
ac_cv_atof_accept_nan=no
dnl Check if atof() accepts INF
dnl
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
{
return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
}
-],[
+]])],[
ac_cv_atof_accept_inf=yes
],[
ac_cv_atof_accept_inf=no
dnl Check if HUGE_VAL == INF
dnl
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
{
return zend_isinf(HUGE_VAL) ? 0 : 1;
}
-],[
+]])],[
ac_cv_huge_val_inf=yes
],[
ac_cv_huge_val_inf=no
dnl Check if HUGE_VAL + -HUGEVAL == NAN
dnl
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
#endif
}
-],[
+]])],[
ac_cv_huge_val_nan=yes
],[
ac_cv_huge_val_nan=no
AC_DEFUN([ZEND_FP_EXCEPT],[
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <floatingpoint.h>
-],[
+]],[[
fp_except x = (fp_except) 0;
-],[
+]])],[
ac_cv_type_fp_except=yes
],[
ac_cv_type_fp_except=no
-],[
- ac_cv_type_fp_except=no
])])
if test "$ac_cv_type_fp_except" = "yes"; then
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
dnl
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
ac_cv_broken_sprintf=no
],[
ac_cv_broken_sprintf=yes
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
[
ac_cv_c_bigendian_php=unknown
- AC_TRY_RUN(
- [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
short one = 1;
return(1);
}
}
- ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
+ ]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
])
if test $ac_cv_c_bigendian_php = yes; then
AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if processor uses big-endian word])
dnl See: http://wiki.php.net/rfc/rounding
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
AC_MSG_CHECKING([for usable _FPU_SETCW])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <fpu_control.h>
- ],[
+ ]],[[
fpu_control_t fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
_FPU_SETCW(fpu_cw);
result = a / b;
_FPU_SETCW(fpu_oldcw);
- ], [ac_cfp_have__fpu_setcw=yes], [ac_cfp_have__fpu_setcw=no])
+ ]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING([for usable fpsetprec])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <machine/ieeefp.h>
- ],[
+ ]],[[
fp_prec_t fpu_oldprec;
volatile double result;
double a = 2877.0;
fpsetprec(FP_PD);
result = a / b;
fpsetprec(fpu_oldprec);
- ], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
+ ]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING([for usable _controlfp])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
- ],[
+ ]],[[
unsigned int fpu_oldcw;
volatile double result;
double a = 2877.0;
_controlfp(_PC_53, _MCW_PC);
result = a / b;
_controlfp(fpu_oldcw, _MCW_PC);
- ], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
+ ]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
if test "$ac_cfp_have__controlfp" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING([for usable _controlfp_s])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
- ],[
+ ]],[[
unsigned int fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
result = a / b;
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
- ], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
+ ]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
/* nothing */
- ],[
+ ]],[[
unsigned int oldcw, cw;
volatile double result;
double a = 2877.0;
result = a / b;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
- ], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
+ ]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
AC_MSG_RESULT(yes)
AC_CACHE_VAL(php_cv_cc_dashr,[
SAVE_LIBS=$LIBS
LIBS="-R /usr/$PHP_LIBDIR $LIBS"
- AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_dashr=yes],[php_cv_cc_dashr=no])
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$php_cv_cc_dashr])
if test $php_cv_cc_dashr = "yes"; then
AC_CACHE_VAL(php_cv_cc_rpath,[
SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
- AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_rpath=yes],[php_cv_cc_rpath=no])
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$php_cv_cc_rpath])
if test $php_cv_cc_rpath = "yes"; then
LIBS=
old_LDFLAGS=$LDFLAGS
LDFLAGS=
- AC_TRY_RUN([#include <stdio.h>
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
fprintf(fp, "%d\n", sizeof($1));
return(0);
}
- ], [
+ ]])], [
eval $php_cache_value=`cat conftestval`
], [
eval $php_cache_value=0
dnl
AC_DEFUN([PHP_TIME_R_TYPE],[
AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <time.h>
main() {
if (r == s && s == 0) return (0);
return (1);
}
-],[
+]])],[
ac_cv_time_r_type=hpux
],[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <time.h>
main() {
struct tm t, *s;
if (p == buf && s == &t) return (0);
return (1);
}
- ],[
+ ]])],[
ac_cv_time_r_type=irix
],[
ac_cv_time_r_type=POSIX
dnl PHP_DOES_PWRITE_WORK
dnl internal
AC_DEFUN([PHP_DOES_PWRITE_WORK],[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
exit(0);
}
- ],[
+ ]])],[
ac_cv_pwrite=yes
],[
ac_cv_pwrite=no
dnl internal
AC_DEFUN([PHP_DOES_PREAD_WORK],[
echo test > conftest_in
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
exit(0);
}
- ],[
+ ]])],[
ac_cv_pread=yes
],[
ac_cv_pread=no
dnl
AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
AC_MSG_CHECKING([for missing declarations of reentrant functions])
- AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = localtime_r]])],[
:
],[
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
])
- AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = gmtime_r]])],[
:
],[
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
])
- AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = asctime_r]])],[
:
],[
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
])
- AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = ctime_r]])],[
:
],[
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
])
- AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char *(*func)() = strtok_r]])],[
:
],[
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no)
if test "$ac_cv_func_readdir_r" = "yes"; then
AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define _REENTRANT
#include <sys/types.h>
#include <dirent.h>
close(dir);
exit(1);
}
- ],[
+ ]])],[
ac_cv_what_readdir_r=POSIX
],[
AC_PREPROC_IFELSE([
dnl
AC_DEFUN([PHP_TM_GMTOFF],[
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
- ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <$ac_cv_struct_tm>]], [[struct tm tm; tm.tm_gmtoff;]])],
+ [ac_cv_struct_tm_gmtoff=yes], [ac_cv_struct_tm_gmtoff=no])])
if test "$ac_cv_struct_tm_gmtoff" = yes; then
AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm])
dnl
AC_DEFUN([PHP_STRUCT_FLOCK],[
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
#include <fcntl.h>
- ],
- [struct flock x;],
- [
+ ]], [[struct flock x;]])],[
ac_cv_struct_flock=yes
],[
ac_cv_struct_flock=no
dnl
AC_DEFUN([PHP_SOCKLEN_T],[
AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
-],[
+]],[[
socklen_t x;
-],[
+]])],[
ac_cv_socklen_t=yes
],[
ac_cv_socklen_t=no
dnl
AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[
AC_MSG_CHECKING([for fclose declaration])
- AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[int (*func)() = fclose]])],[
AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
AC_MSG_RESULT([ok])
],[
dnl
AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
ac_cv_broken_sprintf=no
],[
ac_cv_broken_sprintf=yes
dnl
AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[
AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define NULL (0L)
main() {
char buf[20];
res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);
exit(res);
}
- ],[
+ ]])],[
ac_cv_broken_snprintf=no
],[
ac_cv_broken_snprintf=yes
AC_DEFUN([PHP_SOCKADDR_CHECKS], [
dnl Check for struct sockaddr_storage exists
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage,
- [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
- [struct sockaddr_storage s; s],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>]],
+ [[struct sockaddr_storage s; s]])],
[ac_cv_sockaddr_storage=yes], [ac_cv_sockaddr_storage=no])
])
if test "$ac_cv_sockaddr_storage" = "yes"; then
fi
dnl Check if field sa_len exists in struct sockaddr
AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[
- AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
- [static struct sockaddr sa; int n = (int) sa.sa_len; return n;],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>]], [[static struct sockaddr sa; int n = (int) sa.sa_len; return n;]])],
[ac_cv_sockaddr_sa_len=yes], [ac_cv_sockaddr_sa_len=no])
])
if test "$ac_cv_sockaddr_sa_len" = "yes"; then
dnl
AC_DEFUN([PHP_DECLARED_TIMEZONE],[
AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-],[
+]],[[
time_t foo = (time_t) timezone;
-],[
+]])],[
ac_cv_declared_timezone=yes
],[
ac_cv_declared_timezone=no
dnl
AC_DEFUN([PHP_EBCDIC], [
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
- AC_TRY_RUN( [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void) {
return (unsigned char)'A' != (unsigned char)0xC1;
}
-],[
+]])],[
ac_cv_ebcdic=yes
],[
ac_cv_ebcdic=no
AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [
AC_MSG_CHECKING([for broken libc stdio])
AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
int main(int argc, char *argv[])
{
return 1;
return 0;
}
-],
+]])],
[_cv_have_broken_glibc_fopen_append=no],
-[_cv_have_broken_glibc_fopen_append=yes ],
-[AC_TRY_COMPILE([
+[_cv_have_broken_glibc_fopen_append=yes],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <features.h>
-],[
+]], [[
#if !__GLIBC_PREREQ(2,2)
choke me
#endif
-],
+]])],
[_cv_have_broken_glibc_fopen_append=yes],
-[_cv_have_broken_glibc_fopen_append=no ])]
-)])
+[_cv_have_broken_glibc_fopen_append=no])
+])])
if test "$_cv_have_broken_glibc_fopen_append" = "yes"; then
AC_MSG_RESULT(yes)
dnl this comes in two flavors:
dnl newer glibcs (since 2.1.2 ? )
dnl have a type called cookie_io_functions_t
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <stdio.h>
-], [cookie_io_functions_t cookie;], [have_cookie_io_functions_t=yes], [])
+]], [[cookie_io_functions_t cookie;]])],[have_cookie_io_functions_t=yes],[])
if test "$have_cookie_io_functions_t" = "yes"; then
cookie_io_functions_t=cookie_io_functions_t
have_fopen_cookie=yes
dnl even newer glibcs have a different seeker definition...
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define _GNU_SOURCE
#include <stdio.h>
exit(1);
}
-], [
+]])], [
cookie_io_functions_use_off64_t=yes
], [
cookie_io_functions_use_off64_t=no
dnl older glibc versions (up to 2.1.2 ?)
dnl call it _IO_cookie_io_functions_t
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <stdio.h>
-], [ _IO_cookie_io_functions_t cookie; ], [have_IO_cookie_io_functions_t=yes], [])
+]], [[_IO_cookie_io_functions_t cookie;]])], [have_IO_cookie_io_functions_t=yes], [])
if test "$have_cookie_io_functions_t" = "yes" ; then
cookie_io_functions_t=_IO_cookie_io_functions_t
have_fopen_cookie=yes
if test "$found" = "yes"; then
ac_libs=$LIBS
LIBS="$LIBS -l$2"
- AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[main() { return (0); }]])],[found=yes],[found=no],[found=no])
LIBS=$ac_libs
fi
AC_DEFUN([PHP_TEST_BUILD], [
old_LIBS=$LIBS
LIBS="$4 $LIBS"
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
$5
char $1();
int main() {
$1();
return 0;
}
- ], [
+ ]])],[
LIBS=$old_LIBS
$2
],[
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
[
ac_cv_c_bigendian_php=unknown
- AC_TRY_RUN(
- [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
short one = 1;
return(1);
}
}
- ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
+ ]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
])
if test $ac_cv_c_bigendian_php = yes; then
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
[
AC_CACHE_CHECK([which data struct is used by crypt_r], php_cv_crypt_r_style,[
php_cv_crypt_r_style=none
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _REENTRANT 1
#include <crypt.h>
-],[
+]], [[
CRYPTD buffer;
crypt_r("passwd", "hash", &buffer);
-],
-php_cv_crypt_r_style=cryptd)
+]])],[php_cv_crypt_r_style=cryptd],[])
if test "$php_cv_crypt_r_style" = "none"; then
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _REENTRANT 1
#include <crypt.h>
-],[
+]],[[
struct crypt_data buffer;
crypt_r("passwd", "hash", &buffer);
-],
-php_cv_crypt_r_style=struct_crypt_data)
+]])],[php_cv_crypt_r_style=struct_crypt_data],[])
fi
if test "$php_cv_crypt_r_style" = "none"; then
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _REENTRANT 1
#define _GNU_SOURCE
#include <crypt.h>
-],[
+]],[[
struct crypt_data buffer;
crypt_r("passwd", "hash", &buffer);
-],
-php_cv_crypt_r_style=struct_crypt_data_gnu_source)
+]])],[php_cv_crypt_r_style=struct_crypt_data_gnu_source],[])
fi
])
dnl
AC_DEFUN([PHP_TEST_WRITE_STDOUT],[
AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
n = write(1, TEXT, sizeof(TEXT)-1);
return (!(n == sizeof(TEXT)-1));
}
- ],[
+ ]])],[
ac_cv_write_stdout=yes
],[
ac_cv_write_stdout=no
AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
AC_MSG_CHECKING([for __builtin_expect])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_expect(1,1) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_expect=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
AC_MSG_CHECKING([for __builtin_clz])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_clz(1) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_clz=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
AC_MSG_CHECKING([for __builtin_ctzl])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_ctzl(2L) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_ctzl=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
AC_MSG_CHECKING([for __builtin_ctzll])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_ctzll(2LL) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_ctzll=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_SMULL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_smull_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long tmpvar;
return __builtin_smull_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_smull_overflow=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_SMULLL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_smulll_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long long tmpvar;
return __builtin_smulll_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_smulll_overflow=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_SADDL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_saddl_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long tmpvar;
return __builtin_saddl_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_saddl_overflow=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_SADDLL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_saddll_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long long tmpvar;
return __builtin_saddll_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_saddll_overflow=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_SSUBL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_ssubl_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long tmpvar;
return __builtin_ssubl_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_ssubl_overflow=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_ssubll_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long long tmpvar;
return __builtin_ssubll_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_ssubll_overflow=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_CPU_INIT], [
AC_MSG_CHECKING([for __builtin_cpu_init])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_cpu_init()? 1 : 0;
- ], [
+ ]])], [
have_builtin_cpu_init=1
AC_MSG_RESULT([yes])
], [
AC_DEFUN([PHP_CHECK_BUILTIN_CPU_SUPPORTS], [
AC_MSG_CHECKING([for __builtin_cpu_supports])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_cpu_supports("sse")? 1 : 0;
- ], [
+ ]])], [
have_builtin_cpu_supports=1
AC_MSG_RESULT([yes])
], [
have_ext_instructions=0
if test $have_builtin_cpu_supports = 1; then
AC_MSG_CHECKING([for $1 instructions supports])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main() {
return __builtin_cpu_supports("$1")? 0 : 1;
}
- ], [
+ ]])], [
have_ext_instructions=1
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
- ])
+ ], [])
fi
AC_DEFINE_UNQUOTED(AS_TR_CPP([PHP_HAVE_$1_INSTRUCTIONS]),
[$have_ext_instructions], [Whether the compiler supports $1 instructions])
PHP_AUTOCONF ?= 'autoconf'
PHP_AUTOHEADER ?= 'autoheader'
-SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used)'||true)
+SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_RUN_IFELSE called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used)'||true)
all: $(targets)
RE2C_FLAGS=""
else
AC_MSG_CHECKING([whether re2c -g works])
- AC_TRY_COMPILE([],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
int main(int argc, const char **argv)
{
argc = argc;
goto *adr[0];
return 0;
}
- ],[
+ ]])],[
RE2C_FLAGS=""
AC_MSG_RESULT([no])
],[
dnl Check for IPv6 support
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
-[AC_TRY_LINK([ #include <sys/types.h>
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
-#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
+#include <netinet/in.h>]], [[struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;]])],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
dnl Checks for library functions.
dnl Check for getaddrinfo, should be a better way, but...
dnl Also check for working getaddrinfo
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
-[AC_TRY_LINK([#include <netdb.h>],
- [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
- [AC_TRY_RUN([
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
+ [[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <netdb.h>
#include <sys/types.h>
#ifndef AF_INET
freeaddrinfo(ai);
exit(0);
}
- ],ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no, ac_cv_func_getaddrinfo=no)],
-ac_cv_func_getaddrinfo=no)])
+ ]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
+[ac_cv_func_getaddrinfo=no])])
if test "$ac_cv_func_getaddrinfo" = yes; then
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
fi
dnl Check for the __sync_fetch_and_add builtin
AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
-[AC_TRY_LINK([],[int x;__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[int x;__sync_fetch_and_add(&x,1);]])],[ac_cv_func_sync_fetch_and_add=yes],[ac_cv_func_sync_fetch_and_add=no])])
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])
fi
dnl Check for asm goto support
AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,
-[AC_TRY_RUN([
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void) {
__asm__ goto("jmp %l0\n" :::: end);
end:
return 0;
}
- ],ac_cv__asm_goto=yes, ac_cv__asm_goto=no, ac_cv__asm_goto=no)])
+ ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no], [ac_cv__asm_goto=no])])
if test "$ac_cv__asm_goto" = yes; then
AC_DEFINE(HAVE_ASM_GOTO,1,[Define if asm goto support])
dnl Check for variable length array support
AC_CACHE_CHECK([whether compiler supports VLA], ac_cv__compiler_c99_vla,
-[AC_TRY_RUN([
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
int main(void) {
int i[rand()%10];
return 0;
}
- ],ac_cv__compiler_c99_vla=yes, ac_cv__compiler_c99_vla=no, ac_cv__compiler_c99_vla=no)])
+ ]])],[ac_cv__compiler_c99_vla=yes], [ac_cv__compiler_c99_vla=no], [ac_cv__compiler_c99_vla=no])])
if test "$ac_cv__compiler_c99_vla" = yes; then
AC_DEFINE(HAVE_COMPILER_C99_VLA, 1, [Compiler supports VLA])
AC_PROG_CPP
AC_MSG_CHECKING([for openssl support in libcurl])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <strings.h>
#include <curl/curl.h>
}
return 1;
}
- ],[
+ ]])],[
AC_MSG_RESULT([yes])
AC_CHECK_HEADERS([openssl/crypto.h], [
AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
])
AC_MSG_CHECKING([for gnutls support in libcurl])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <strings.h>
#include <curl/curl.h>
}
return 1;
}
-], [
+]])], [
AC_MSG_RESULT([yes])
AC_CHECK_HEADER([gcrypt.h], [
AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
lib_found="";
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include "$THIS_INCLUDE"
- ],[
+ ]],[[
$3;
- ],[
+ ]])],[
AC_EGREP_CPP(yes,[
#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR == $1 || ($1 == 4 && DB_VERSION_MAJOR == 5)
THIS_LIBS=$LIB
lib_found=1
])
- ])
+ ],[])
])
if test -n "$lib_found"; then
lib_found="";
AC_MSG_RESULT([$THIS_INCLUDE])
if test -n "$THIS_INCLUDE"; then
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$THIS_LIBS,[
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include "$THIS_INCLUDE"
- ],[
+ ]],[[
DB * dbp = dbopen("", 0, 0, DB_HASH, 0);
- ],[
+ ]])],[
AC_DEFINE_UNQUOTED(DB1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_DB1, 1, [ ])
THIS_RESULT=yes
libmagic/buffer.c"
AC_MSG_CHECKING([for strcasestr])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <strings.h>
#include <stdlib.h>
return !(NULL != ret);
}
- ],[
+ ]])],[
dnl using the platform implementation
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
AC_MSG_NOTICE(using libmagic strcasestr implementation)
libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
- ])
+ ],[])
PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
fi
AC_MSG_CHECKING([if iconv is glibc's])
- AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],
- [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnu/libc-version.h>]], [[gnu_get_libc_version();]])],[
AC_MSG_RESULT(yes)
iconv_impl_name="glibc"
],[
AC_MSG_CHECKING([if using GNU libiconv])
php_iconv_old_ld="$LDFLAGS"
LDFLAGS="-liconv $LDFLAGS"
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <$PHP_ICONV_H_PATH>
int main() {
printf("%d", _libiconv_version);
return 0;
}
- ],[
+ ]])],[
AC_MSG_RESULT(yes)
iconv_impl_name="gnu_libiconv"
],[
if test -z "$iconv_impl_name"; then
AC_MSG_CHECKING([if iconv is Konstantin Chuguev's])
- AC_TRY_LINK([#include <iconv.h>],[iconv_ccs_init(NULL, NULL);],
- [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iconv.h>]], [[iconv_ccs_init(NULL, NULL);]])],[
AC_MSG_RESULT(yes)
iconv_impl_name="bsd"
],[
AC_MSG_CHECKING([if using IBM iconv])
php_iconv_old_ld="$LDFLAGS"
LDFLAGS="-liconv $LDFLAGS"
- AC_TRY_LINK([#include <iconv.h>],[cstoccsid("");],
- [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iconv.h>]], [[cstoccsid("");]])],[
AC_MSG_RESULT(yes)
iconv_impl_name="ibm"
],[
esac
AC_MSG_CHECKING([if iconv supports errno])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <$PHP_ICONV_H_PATH>
#include <errno.h>
iconv_close( cd );
return 2;
}
- ],[
+ ]])],[
AC_MSG_RESULT(yes)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1,[ext/iconv])
AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
])
AC_MSG_CHECKING([if iconv supports //IGNORE])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <$PHP_ICONV_H_PATH>
#include <stdlib.h>
}
return 0;
}
- ],[
+ ]])],[
AC_MSG_RESULT(yes)
PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv])
AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE])
])
AC_MSG_CHECKING([if your cpp allows macro usage in include lines])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define FOO <$PHP_ICONV_H_PATH>
#include FOO
- ], [], [
+ ]], [])], [
AC_MSG_RESULT([yes])
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv])
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
old_CFLAGS=$CFLAGS
CFLAGS="-I$IMAP_INC_DIR"
AC_CACHE_CHECK(for utf8_mime2text signature, ac_cv_utf8_mime2text,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <c-client.h>
- ],[
+ ]],[[
SIZEDTEXT *src, *dst;
utf8_mime2text(src, dst);
- ],[
+ ]])],[
ac_cv_utf8_mime2text=old
],[
ac_cv_utf8_mime2text=new
old_CFLAGS=$CFLAGS
CFLAGS="-I$IMAP_INC_DIR"
AC_CACHE_CHECK(for U8T_DECOMPOSE, ac_cv_u8t_decompose,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <c-client.h>
- ],[
+ ]],[[
int i = U8T_CANONICAL;
- ],[
+ ]])],[
ac_cv_u8t_decompose=yes
],[
ac_cv_u8t_decompose=no
dnl Check for 3 arg ldap_set_rebind_proc
AC_CACHE_CHECK([for 3 arg ldap_set_rebind_proc], ac_cv_3arg_setrebindproc,
- [AC_TRY_COMPILE([#include <ldap.h>], [ldap_set_rebind_proc(0,0,0)],
- ac_cv_3arg_setrebindproc=yes, ac_cv_3arg_setrebindproc=no)])
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ldap.h>]], [[ldap_set_rebind_proc(0,0,0)]])],
+ [ac_cv_3arg_setrebindproc=yes], [ac_cv_3arg_setrebindproc=no])])
if test "$ac_cv_3arg_setrebindproc" = yes; then
AC_DEFINE(HAVE_3ARG_SETREBINDPROC,1,[Whether 3 arg set_rebind_proc()])
fi
fi
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, php_cv_mbstring_stdarg, [
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
int foo(int x, ...) {
va_list va;
return 0;
}
int main() { return foo(10, "", 3.14); }
- ], [php_cv_mbstring_stdarg=yes], [php_cv_mbstring_stdarg=no], [
+ ]])], [php_cv_mbstring_stdarg=yes], [php_cv_mbstring_stdarg=no], [
php_cv_mbstring_stdarg=no
])
])
save_old_LDFLAGS=$LDFLAGS
PHP_EVAL_LIBLINE([$MBSTRING_SHARED_LIBADD], LDFLAGS)
AC_MSG_CHECKING([if oniguruma has an invalid entry for KOI8 encoding])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <oniguruma.h>
- ], [
+ ]], [[
return (int)(ONIG_ENCODING_KOI8 + 1);
- ], [
+ ]])], [
AC_MSG_RESULT([no])
], [
AC_MSG_RESULT([yes])
AC_CHECK_HEADERS([unistd.h sys/uio.h])
AC_MSG_CHECKING(for sysvipc shared memory support)
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ipc.h>
}
return 0;
}
-],dnl
+]])],[dnl
AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
- msg=yes,msg=no,msg=no)
+ msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
}
return 0;
}
-],dnl
+]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
- msg=yes,msg=no,msg=no)
+ msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
}
return 0;
}
-],dnl
+]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support])
- msg=yes,msg=no,msg=no)
+ msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using shm_open() shared memory support)
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
}
return 0;
}
-],dnl
+]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
- msg=yes,msg=no,msg=no)
+ msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using regular file shared memory support)
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
}
return 0;
}
-],dnl
+]])],[dnl
AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support])
- msg=yes,msg=no,msg=no)
+ msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
flock_type=unknown
AC_MSG_CHECKING("whether flock struct is linux ordered")
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5 };
int main() {
}
return 1;
}
-], [
+]])], [
flock_type=linux
AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
AC_MSG_RESULT("yes")
-], AC_MSG_RESULT("no") )
+], [AC_MSG_RESULT("no")], [])
AC_MSG_CHECKING("whether flock struct is BSD ordered")
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5 };
int main() {
}
return 1;
}
-], [
+]])], [
flock_type=bsd
AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
AC_MSG_RESULT("yes")
-], AC_MSG_RESULT("no") )
+], [AC_MSG_RESULT("no")], [])
if test "$flock_type" = "unknown"; then
AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
AC_CHECK_FUNCS([getpriority setpriority wait3 wait4 sigprocmask sigwaitinfo sigtimedwait])
AC_MSG_CHECKING([for siginfo_t])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <signal.h>
#ifdef HAVE_SIGINFO_H
#include <siginfo.h>
#endif
- ],[
+ ]],[[
siginfo_t info;
- ],[
+ ]])],[
AC_MSG_RESULT([yes])
PCNTL_CFLAGS="-DHAVE_STRUCT_SIGINFO_T"
], [
AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod setrlimit getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r)
AC_MSG_CHECKING([for working ttyname_r() implementation])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
int main(int argc, char *argv[])
return !ttyname_r(0, buf, 64);
}
- ],[
+ ]])],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_TTYNAME_R, 1, [Whether you have a working ttyname_r])
],[
])
AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <sys/utsname.h>
- ],[
+ ]],[[
return sizeof(((struct utsname *)0)->domainname);
- ],[
+ ]])],[
ac_cv_have_utsname_domainname=yes
],[
ac_cv_have_utsname_domainname=no
old_LIBS=$LIBS
LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB"
LIBS="$LIBS -lrecode"
- AC_TRY_LINK(
- [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
char *program_name;
- ],[
+ ]],[[
recode_format_table();
- ],[
+ ]])],[
PHP_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
AC_DEFINE(HAVE_BROKEN_RECODE, 1, [Whether we have librecode 3.5])
],[
dnl Check for struct cmsghdr
AC_CACHE_CHECK([for struct cmsghdr], ac_cv_cmsghdr,
[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
-#include <sys/socket.h>], [struct cmsghdr s; s], ac_cv_cmsghdr=yes, ac_cv_cmsghdr=no)
+#include <sys/socket.h>]], [[struct cmsghdr s; s]])], [ac_cv_cmsghdr=yes], [ac_cv_cmsghdr=no])
])
if test "$ac_cv_cmsghdr" = yes; then
AC_CHECK_FUNCS([hstrerror socketpair if_nametoindex if_indextoname])
AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h sys/sockio.h errno.h])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
- ], [static struct msghdr tp; int n = (int) tp.msg_flags; return n],[],
+ ]], [[static struct msghdr tp; int n = (int) tp.msg_flags; return n]])],[],
[AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])]
)
AC_DEFINE([HAVE_SOCKETS], 1, [ ])
dnl Check for fied ss_family in sockaddr_storage (missing in AIX until 5.3)
AC_CACHE_CHECK([for field ss_family in struct sockaddr_storage], ac_cv_ss_family,
[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
- ], [struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;],
- ac_cv_ss_family=yes, ac_cv_ss_family=no)
+ ]], [[struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;]])],
+ [ac_cv_ss_family=yes], [ac_cv_ss_family=no])
])
if test "$ac_cv_ss_family" = yes; then
dnl Check for AI_V4MAPPED flag
AC_CACHE_CHECK([if getaddrinfo supports AI_V4MAPPED],[ac_cv_gai_ai_v4mapped],
[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <netdb.h>
- ], [int flag = AI_V4MAPPED;],
- ac_cv_gai_ai_v4mapped=yes, ac_cv_gai_ai_v4mapped=no)
+ ]], [[int flag = AI_V4MAPPED;]])],
+ [ac_cv_gai_ai_v4mapped=yes], [ac_cv_gai_ai_v4mapped=no])
])
if test "$ac_cv_gai_ai_v4mapped" = yes; then
dnl Check for AI_ALL flag
AC_CACHE_CHECK([if getaddrinfo supports AI_ALL],[ac_cv_gai_ai_all],
[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <netdb.h>
- ], [int flag = AI_ALL;],
- ac_cv_gai_ai_all=yes, ac_cv_gai_ai_all=no)
+ ]], [[int flag = AI_ALL;]])],
+ [ac_cv_gai_ai_all=yes], [ac_cv_gai_ai_all=no])
])
if test "$ac_cv_gai_ai_all" = yes; then
dnl Check for AI_IDN flag
AC_CACHE_CHECK([if getaddrinfo supports AI_IDN],[ac_cv_gai_ai_idn],
[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <netdb.h>
- ], [int flag = AI_IDN;],
- ac_cv_gai_ai_idn=yes, ac_cv_gai_ai_idn=no)
+ ]], [[int flag = AI_IDN;]])],
+ [ac_cv_gai_ai_idn=yes], [ac_cv_gai_ai_idn=no])
])
if test "$ac_cv_gai_ai_idn" = yes; then
dnl Check if flush should be called explicitly after buffered io
dnl
AC_CACHE_CHECK([whether flush should be called explicitly after a buffered io], ac_cv_flush_io,[
-AC_TRY_RUN( [
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdlib.h>
exit(result);
}
-],[
+]])],[
ac_cv_flush_io=no
],[
ac_cv_flush_io=yes
fi
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
exit(1);
#endif
-}],[
+}]])],[
ac_cv_crypt_des=yes
],[
ac_cv_crypt_des=no
])])
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
exit(1);
#endif
-}],[
+}]])],[
ac_cv_crypt_ext_des=yes
],[
ac_cv_crypt_ext_des=no
])])
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
exit(1);
#endif
-}],[
+}]])],[
ac_cv_crypt_md5=yes
],[
ac_cv_crypt_md5=no
])])
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
exit(1);
#endif
-}],[
+}]])],[
ac_cv_crypt_blowfish=yes
],[
ac_cv_crypt_blowfish=no
])])
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_sha512,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
exit(1);
#endif
-}],[
+}]])],[
ac_cv_crypt_sha512=yes
],[
ac_cv_crypt_sha512=no
])])
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_sha256,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
exit(1);
#endif
-}],[
+}]])],[
ac_cv_crypt_sha256=yes
],[
ac_cv_crypt_sha256=no
dnl Check for __alignof__ support in the compiler
dnl
AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[
- AC_TRY_COMPILE([
- ],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ ]],[[
int align = __alignof__(int);
- ],[
+ ]])],[
ac_cv_alignof_exists=yes
],[
ac_cv_alignof_exists=no
dnl Check for __attribute__ ((__aligned__)) support in the compiler
dnl
AC_CACHE_CHECK(whether the compiler supports aligned attribute, ac_cv_attribute_aligned,[
-AC_TRY_COMPILE([
-],[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+]],[[
unsigned char test[32] __attribute__ ((__aligned__ (__alignof__ (int))));
-],[
+]])],[
ac_cv_attribute_aligned=yes
],[
ac_cv_attribute_aligned=no
dnl Check for strptime()
dnl
AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <time.h>
-],[
+]],[[
#ifndef HAVE_STRPTIME
#error no strptime() on this platform
#else
/* use invalid strptime() declaration to see if it fails to compile */
int strptime(const char *s, const char *format, struct tm *tm);
#endif
-],[
+]])],[
ac_cv_strptime_decl_fails=no
],[
ac_cv_strptime_decl_fails=yes
AC_CHECK_HEADERS([wchar.h])
AC_CHECK_FUNCS([mblen mbrlen mbsinit])
AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],[
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_WCHAR_H
# include <wchar.h>
#endif
-],[
+]],[[
mbstate_t a;
-],[
+]])],[
ac_cv_type_mbstate_t=yes
],[
ac_cv_type_mbstate_t=no
])
AC_CHECK_HEADERS([netdb.h])
AC_MSG_CHECKING([for usable getifaddrs])
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <ifaddrs.h>
-],[
+]],[[
struct ifaddrs *interfaces;
if (!getifaddrs(&interfaces)) {
freeifaddrs(interfaces);
}
-], [ac_have_getifaddrs=yes], [ac_have_getifaddrs=no])
+]])], [ac_have_getifaddrs=yes], [ac_have_getifaddrs=no])
if test "$ac_have_getifaddrs" = "yes" ; then
AC_DEFINE(HAVE_GETIFADDRS, 1, [whether getifaddrs is present and usable])
AC_MSG_RESULT(yes)
PHP_NEW_EXTENSION(sysvsem, sysvsem.c, $ext_shared)
AC_DEFINE(HAVE_SYSVSEM, 1, [ ])
AC_CACHE_CHECK(for union semun,php_cv_semun,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
- ],
- [union semun x;],
- [
+ ]], [[union semun x;]])],[
php_cv_semun=yes
],[
php_cv_semun=no
AC_CHECK_HEADERS([sys/pstat.h])
AC_CACHE_CHECK([for PS_STRINGS], [cli_cv_var_PS_STRINGS],
-[AC_TRY_LINK(
-[#include <machine/vmparam.h>
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <machine/vmparam.h>
#include <sys/exec.h>
-],
-[PS_STRINGS->ps_nargvstr = 1;
-PS_STRINGS->ps_argvstr = "foo";],
+]],
+[[PS_STRINGS->ps_nargvstr = 1;
+PS_STRINGS->ps_argvstr = "foo";]])],
[cli_cv_var_PS_STRINGS=yes],
[cli_cv_var_PS_STRINGS=no])])
if test "$cli_cv_var_PS_STRINGS" = yes ; then
[
AC_MSG_CHECKING([for prctl])
- AC_TRY_COMPILE([ #include <sys/prctl.h> ], [prctl(0, 0, 0, 0, 0);], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/prctl.h>]], [[prctl(0, 0, 0, 0, 0);]])], [
AC_DEFINE([HAVE_PRCTL], 1, [do we have prctl?])
AC_MSG_RESULT([yes])
], [
AC_MSG_CHECKING([for clock_gettime])
- AC_TRY_LINK([ #include <time.h> ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);]])], [
have_clock_gettime=yes
AC_MSG_RESULT([yes])
], [
SAVED_LIBS="$LIBS"
LIBS="$LIBS -lrt"
- AC_TRY_LINK([ #include <time.h> ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);]])], [
have_clock_gettime=yes
AC_MSG_RESULT([yes])
], [
if test "$have_clock_gettime" = "no"; then
AC_MSG_CHECKING([for clock_get_time])
- AC_TRY_RUN([ #include <mach/mach.h>
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach_error.h>
return 0;
}
- ], [
+ ]])], [
have_clock_get_time=yes
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
- ])
+ ], [])
fi
if test "$have_clock_get_time" = "yes"; then
AC_MSG_CHECKING([for ptrace])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
- #include <sys/ptrace.h> ], [ptrace(0, 0, (void *) 0, 0);], [
+ #include <sys/ptrace.h> ]], [[ptrace(0, 0, (void *) 0, 0);]])], [
have_ptrace=yes
AC_MSG_RESULT([yes])
], [
if test "$have_ptrace" = "yes"; then
AC_MSG_CHECKING([whether ptrace works])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
return 0;
}
}
- ], [
+ ]])], [
AC_MSG_RESULT([yes])
], [
have_ptrace=no
if test "$have_broken_ptrace" = "yes"; then
AC_MSG_CHECKING([for mach_vm_read])
- AC_TRY_COMPILE([ #include <mach/mach.h>
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach.h>
#include <mach/mach_vm.h>
- ], [
+ ]], [[
mach_vm_read((vm_map_t)0, (mach_vm_address_t)0, (mach_vm_size_t)0, (vm_offset_t *)0, (mach_msg_type_number_t*)0);
- ], [
+ ]])], [
have_mach_vm_read=yes
AC_MSG_RESULT([yes])
], [
if test -n "$proc_mem_file" ; then
AC_MSG_CHECKING([for proc mem file])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdint.h>
close(fd);
return v1 != v2;
}
- ], [
+ ]])], [
AC_MSG_RESULT([$proc_mem_file])
], [
proc_mem_file=""
AC_DEFUN([AC_FPM_BUILTIN_ATOMIC],
[
AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap])
- AC_TRY_LINK(,
- [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
int variable = 1;
return (__sync_bool_compare_and_swap(&variable, 1, 2)
&& __sync_add_and_fetch(&variable, 1)) ? 1 : 0;
- ],
- [
+ ]])], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.])
- ],
- [
+ ], [
AC_MSG_RESULT([no])
])
])
AC_MSG_CHECKING([for TCP_INFO])
- AC_TRY_COMPILE([ #include <netinet/tcp.h> ], [struct tcp_info ti; int x = TCP_INFO;], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_info ti; int x = TCP_INFO;]])], [
have_lq=tcp_info
AC_MSG_RESULT([yes])
], [
if test "$have_lq" = "no" ; then
AC_MSG_CHECKING([for SO_LISTENQLEN])
- AC_TRY_COMPILE([ #include <sys/socket.h> ], [int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;]])], [
have_lq=so_listenq
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for sysconf])
- AC_TRY_COMPILE([ #include <unistd.h> ], [sysconf(_SC_CLK_TCK);], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[sysconf(_SC_CLK_TCK);]])],[
AC_DEFINE([HAVE_SYSCONF], 1, [do we have sysconf?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for times])
- AC_TRY_COMPILE([ #include <sys/times.h> ], [struct tms t; times(&t);], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/times.h>]], [[struct tms t; times(&t);]])],[
AC_DEFINE([HAVE_TIMES], 1, [do we have times?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for kqueue])
- AC_TRY_COMPILE(
- [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
- ], [
+ ]], [[
int kfd;
struct kevent k;
kfd = kqueue();
/* 0 -> STDIN_FILENO */
EV_SET(&k, 0, EVFILT_READ , EV_ADD | EV_CLEAR, 0, 0, NULL);
- ], [
+ ]])], [
AC_DEFINE([HAVE_KQUEUE], 1, [do we have kqueue?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for port framework])
- AC_TRY_COMPILE(
- [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <port.h>
- ], [
+ ]], [[
int port;
port = port_create();
if (port < 0) {
return 1;
}
- ], [
+ ]])], [
AC_DEFINE([HAVE_PORT], 1, [do we have port framework?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for /dev/poll])
- AC_TRY_COMPILE(
- [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <sys/devpoll.h>
- ], [
+ ]], [[
int n, dp;
struct dvpoll dvp;
dp = 0;
dvp.dp_nfds = 0;
dvp.dp_timeout = 0;
n = ioctl(dp, DP_POLL, &dvp)
- ], [
+ ]])], [
AC_DEFINE([HAVE_DEVPOLL], 1, [do we have /dev/poll?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for epoll])
- AC_TRY_COMPILE(
- [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/epoll.h>
- ], [
+ ]], [[
int epollfd;
struct epoll_event e;
if (epoll_wait(epollfd, &e, 1, 1) < 0) {
return 1;
}
- ], [
+ ]])], [
AC_DEFINE([HAVE_EPOLL], 1, [do we have epoll?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for poll])
- AC_TRY_COMPILE(
- [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <poll.h>
- ], [
+ ]], [[
struct pollfd fds[2];
fds[0].fd = 0;
fds[1].events = POLLIN;
poll(fds, 2, 1);
- ], [
+ ]])], [
AC_DEFINE([HAVE_POLL], 1, [do we have poll?])
AC_MSG_RESULT([yes])
], [
[
AC_MSG_CHECKING([for select])
- AC_TRY_COMPILE(
- [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
/* According to POSIX.1-2001 */
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
- ], [
+ ]], [[
fd_set fds;
struct timeval t;
t.tv_sec = 0;
/* 0 -> STDIN_FILENO */
FD_SET(0, &fds);
select(FD_SETSIZE, &fds, NULL, NULL, &t);
- ], [
+ ]])], [
AC_DEFINE([HAVE_SELECT], 1, [do we have select?])
AC_MSG_RESULT([yes])
], [
SAVED_LIBS="$LIBS"
LIBS="$LIBS -lapparmor"
- AC_TRY_LINK([ #include <sys/apparmor.h> ], [change_hat("test", 0);], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/apparmor.h>]], [[change_hat("test", 0);]])], [
AC_DEFINE([HAVE_APPARMOR], 1, [do we have apparmor support?])
AC_MSG_RESULT([yes])
], [