Skip to content

Commit ff69a8a

Browse files
kohlernikic
authored andcommitted
Move __alignof__ support check into main configure.ac.
1 parent 1e9ff7e commit ff69a8a

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

configure.ac

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,20 @@ PHP_CHECK_BUILTIN_CPU_INIT
491491
dnl Check __builtin_cpu_supports
492492
PHP_CHECK_BUILTIN_CPU_SUPPORTS
493493

494+
dnl Check for __alignof__ support in the compiler
495+
AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[
496+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
497+
]],[[
498+
int align = __alignof__(int);
499+
]])],[
500+
ac_cv_alignof_exists=yes
501+
],[
502+
ac_cv_alignof_exists=no
503+
])])
504+
if test "$ac_cv_alignof_exists" = "yes"; then
505+
AC_DEFINE([HAVE_ALIGNOF], 1, [whether the compiler supports __alignof__])
506+
fi
507+
494508
dnl Check for structure members.
495509
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
496510
AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])

ext/standard/config.m4

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,6 @@ dnl If one of them is missing, use our own implementation, portable code is then
260260
dnl
261261
dnl TODO This is currently always enabled
262262
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
263-
264-
dnl
265-
dnl Check for __alignof__ support in the compiler
266-
dnl
267-
AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[
268-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
269-
]],[[
270-
int align = __alignof__(int);
271-
]])],[
272-
ac_cv_alignof_exists=yes
273-
],[
274-
ac_cv_alignof_exists=no
275-
])])
276-
if test "$ac_cv_alignof_exists" = "yes"; then
277-
AC_DEFINE([HAVE_ALIGNOF], 1, [whether the compiler supports __alignof__])
278-
fi
279-
280263
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])
281264

282265
PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c)

0 commit comments

Comments
 (0)