Skip to content

Commit d09b56a

Browse files
petkDavid Ellingsworth
authored and
David Ellingsworth
committed
Autotools: Sync CS in opcache Capstone check (php#15084)
- Added Capstone check message in configure log - PKG_CHECK_MODULES already errors out by default if Capstone is not found with a bit more informative message - Autoconf syntax used - HAVE_CAPSTONE help text synced and updated
1 parent 52f901a commit d09b56a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

ext/opcache/config.m4

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ PHP_ARG_ENABLE([opcache-jit],
1818
[yes],
1919
[no])
2020

21-
PHP_ARG_WITH([capstone],,
21+
PHP_ARG_WITH([capstone],
22+
[whether to support opcache JIT dissasembly through Capstone],
2223
[AS_HELP_STRING([--with-capstone],
23-
[support opcache JIT disassembly through capstone])],
24+
[Support opcache JIT disassembly through Capstone])],
2425
[no],
2526
[no])
2627

@@ -94,16 +95,13 @@ if test "$PHP_OPCACHE" != "no"; then
9495
;;
9596
esac
9697

97-
AS_IF([test x"$with_capstone" = "xyes"],[
98-
PKG_CHECK_MODULES([CAPSTONE],[capstone >= 3.0.0],[
99-
AC_DEFINE([HAVE_CAPSTONE], [1], [Capstone is available])
98+
AS_VAR_IF([PHP_CAPSTONE], [yes],
99+
[PKG_CHECK_MODULES([CAPSTONE], [capstone >= 3.0.0], [
100+
AC_DEFINE([HAVE_CAPSTONE], [1], [Define to 1 if Capstone is available.])
100101
PHP_EVAL_LIBLINE([$CAPSTONE_LIBS], [OPCACHE_SHARED_LIBADD])
101102
PHP_EVAL_INCLINE([$CAPSTONE_CFLAGS])
102103
ZEND_JIT_SRC="$ZEND_JIT_SRC jit/ir/ir_disasm.c"
103-
],[
104-
AC_MSG_ERROR([capstone >= 3.0 required but not found])
105-
])
106-
])
104+
])])
107105

108106
PHP_SUBST([IR_TARGET])
109107
PHP_SUBST([DASM_FLAGS])

ext/opcache/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if (PHP_OPCACHE != "no") {
4141

4242
if (CHECK_HEADER_ADD_INCLUDE("capstone\\capstone.h", "CFLAGS_OPCACHE", PHP_OPCACHE+ ";" + PHP_PHP_BUILD + "\\include") &&
4343
CHECK_LIB("capstone.lib", "opcache", PHP_OPCACHE)) {
44-
AC_DEFINE('HAVE_CAPSTONE', 1, 'capstone support enabled');
44+
AC_DEFINE('HAVE_CAPSTONE', 1, 'Define to 1 if Capstone is available.');
4545
ir_src += " ir_disasm.c";
4646
}
4747

0 commit comments

Comments
 (0)