Skip to content

Commit 5959e66

Browse files
committed
Wrap __cpuid_count check into ZEND_CHECK_CPUID_COUNT M4 macro
Instead of checking this when including the Zend.m4 file in configure.ac check is executed with the ZEND_INIT macro.
1 parent 3d6bd16 commit 5959e66

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

Zend/Zend.m4

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ AS_VAR_IF([php_cv_have_stack_limit], [yes],
196196
197197
ZEND_CHECK_FLOAT_PRECISION
198198
ZEND_DLSYM_CHECK
199+
ZEND_CHECK_CPUID_COUNT
199200
200201
AC_MSG_CHECKING(whether to enable thread-safety)
201202
AC_MSG_RESULT($ZEND_ZTS)
@@ -384,18 +385,21 @@ if test "$ZEND_GCC_GLOBAL_REGS" = "yes"; then
384385
fi
385386
AC_MSG_RESULT($ZEND_GCC_GLOBAL_REGS)
386387

388+
dnl
389+
dnl ZEND_CHECK_CPUID_COUNT
390+
dnl
387391
dnl Check whether __cpuid_count is available.
388-
AC_CACHE_CHECK(whether __cpuid_count is available, ac_cv_cpuid_count_available, [
389-
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
390-
#include <cpuid.h>
391-
]], [[
392-
unsigned eax, ebx, ecx, edx;
393-
__cpuid_count(0, 0, eax, ebx, ecx, edx);
394-
]])], [
395-
ac_cv_cpuid_count_available=yes
396-
], [
397-
ac_cv_cpuid_count_available=no
398-
])])
399-
if test "$ac_cv_cpuid_count_available" = "yes"; then
400-
AC_DEFINE([HAVE_CPUID_COUNT], 1, [whether __cpuid_count is available])
401-
fi
392+
dnl
393+
AC_DEFUN([ZEND_CHECK_CPUID_COUNT],
394+
[AC_CACHE_CHECK([whether __cpuid_count is available],
395+
[php_cv_have___cpuid_count],
396+
[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cpuid.h>], [dnl
397+
unsigned eax, ebx, ecx, edx;
398+
__cpuid_count(0, 0, eax, ebx, ecx, edx);
399+
])],
400+
[php_cv_have___cpuid_count=yes],
401+
[php_cv_have___cpuid_count=no])])
402+
AS_VAR_IF([php_cv_have___cpuid_count], [yes],
403+
[AC_DEFINE([HAVE_CPUID_COUNT], [1],
404+
[Define to 1 if '__cpuid_count' is available.])])
405+
])

0 commit comments

Comments
 (0)