])
+dnl PHP_CHECK_BUILTIN_CPU_INIT
+AC_DEFUN([PHP_CHECK_BUILTIN_CPU_INIT], [
+ AC_MSG_CHECKING([for __builtin_cpu_init])
+
+ AC_TRY_LINK(, [
+ return __builtin_cpu_init()? 1 : 0;
+ ], [
+ have_builtin_cpu_init=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_cpu_init=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CPU_INIT],
+ [$have_builtin_cpu_init], [Whether the compiler supports __builtin_cpu_init])
+
+])
+
+dnl PHP_CHECK_BUILTIN_CPU_SUPPORTS
+AC_DEFUN([PHP_CHECK_BUILTIN_CPU_SUPPORTS], [
+ AC_MSG_CHECKING([for __builtin_cpu_supports])
+
+ AC_TRY_LINK(, [
+ return __builtin_cpu_supports("sse")? 1 : 0;
+ ], [
+ have_builtin_cpu_supports=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_cpu_supports=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CPU_SUPPORTS],
+ [$have_builtin_cpu_supports], [Whether the compiler supports __builtin_cpu_supports])
+])
+
+dnl PHP_CHECK_CPU_SUPPORTS
+AC_DEFUN([PHP_CHECK_CPU_SUPPORTS], [
+ AC_REQUIRE([PHP_CHECK_BUILTIN_CPU_INIT])
+ AC_REQUIRE([PHP_CHECK_BUILTIN_CPU_SUPPORTS])
+ have_ext_instructions=0
+ if test $have_builtin_cpu_supports = 1; then
+ AC_MSG_CHECKING([for $1 instructions supports])
+ AC_TRY_RUN([
+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])
+])
+
dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
m4_include([build/ax_check_compile_flag.m4])
-
- dnl PHP_CHECK_VALGRIND
- AC_DEFUN([PHP_CHECK_VALGRIND], [
- AC_MSG_CHECKING([for valgrind])
-
- SEARCH_PATH="/usr/local /usr"
- SEARCH_FOR="/include/valgrind/valgrind.h"
- for i in $SEARCH_PATH ; do
- if test -r $i/$SEARCH_FOR; then
- VALGRIND_DIR=$i
- fi
- done
-
- if test -z "$VALGRIND_DIR"; then
- AC_MSG_RESULT([not found])
- else
- AC_MSG_RESULT(found in $VALGRIND_DIR)
- AC_DEFINE(HAVE_VALGRIND, 1, [ ])
- fi
- ])
+
+m4_include([build/ax_gcc_func_attribute.m4])
PHP_CRYPT_R_STYLE
fi
- PHP_CHECK_VALGRIND
+dnl Check for asm goto support
+AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,
+[AC_TRY_RUN([
+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)])
+
+if test "$ac_cv__asm_goto" = yes; then
+ AC_DEFINE(HAVE_ASM_GOTO,1,[Define if asm goto support])
+fi
+
+ dnl Check valgrind support
+ PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
+ [ --with-valgrind=DIR Enable valgrind support], yes, no)
+
+ if test "$PHP_VALGRIND" != "no"; then
+
+ AC_MSG_CHECKING([for valgrind header])
+
+ if test "$PHP_VALGRIND" = "yes"; then
+ SEARCH_PATH="/usr/local /usr"
+ else
+ SEARCH_PATH="$PHP_VALGRIND"
+ fi
+
+ SEARCH_FOR="/include/valgrind/valgrind.h"
+ for i in $SEARCH_PATH ; do
+ if test -r $i/$SEARCH_FOR; then
+ VALGRIND_DIR=$i
+ fi
+ done
+
+ if test -z "$VALGRIND_DIR"; then
+ AC_MSG_RESULT([not found])
+ else
+ AC_MSG_RESULT(found in $VALGRIND_DIR)
+ AC_DEFINE(HAVE_VALGRIND, 1, [ ])
+ fi
+
+ fi
dnl General settings.
dnl -------------------------------------------------------------------------