From ff69a8a78917fe20153fe5383f022cd7ec6a489d Mon Sep 17 00:00:00 2001 From: Eddie Kohler Date: Sat, 27 Jun 2020 09:01:06 -0400 Subject: [PATCH] Move __alignof__ support check into main configure.ac. --- configure.ac | 14 ++++++++++++++ ext/standard/config.m4 | 17 ----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index df64a61015f..25166773286 100644 --- a/configure.ac +++ b/configure.ac @@ -491,6 +491,20 @@ PHP_CHECK_BUILTIN_CPU_INIT dnl Check __builtin_cpu_supports PHP_CHECK_BUILTIN_CPU_SUPPORTS +dnl Check for __alignof__ support in the compiler +AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +]],[[ + int align = __alignof__(int); +]])],[ + ac_cv_alignof_exists=yes +],[ + ac_cv_alignof_exists=no +])]) +if test "$ac_cv_alignof_exists" = "yes"; then + AC_DEFINE([HAVE_ALIGNOF], 1, [whether the compiler supports __alignof__]) +fi + dnl Check for structure members. AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev]) diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 5081a6b677f..04b9d0aea1d 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -260,23 +260,6 @@ dnl If one of them is missing, use our own implementation, portable code is then dnl dnl TODO This is currently always enabled if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no" || test "$ac_cv_func_crypt_r" != "yes" || true; then - - dnl - dnl Check for __alignof__ support in the compiler - dnl - AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - ]],[[ - int align = __alignof__(int); - ]])],[ - ac_cv_alignof_exists=yes - ],[ - ac_cv_alignof_exists=no - ])]) - if test "$ac_cv_alignof_exists" = "yes"; then - AC_DEFINE([HAVE_ALIGNOF], 1, [whether the compiler supports __alignof__]) - fi - AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 1, [Whether PHP has to use its own crypt_r for blowfish, des, ext des and md5]) PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c)