Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize Autoconf code #182

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@ PHP_ARG_WITH(uopz-sanitize, whether to enable AddressSanitizer for uopz,
[ --with-uopz-sanitize Build uopz with AddressSanitizer support], no, no)

if test "$PHP_UOPZ" != "no"; then
if test "$PHP_UOPZ_SANITIZE" != "no"; then
AS_VAR_IF([PHP_UOPZ_SANITIZE], [no],, [
EXTRA_LDFLAGS="-lasan"
EXTRA_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST(EXTRA_CFLAGS)
fi
EXTRA_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
PHP_SUBST([EXTRA_LDFLAGS])
PHP_SUBST([EXTRA_CFLAGS])
])

PHP_NEW_EXTENSION(uopz, uopz.c src/util.c src/return.c src/hook.c src/constant.c src/function.c src/class.c src/handlers.c src/executors.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/src, 1)
PHP_ADD_INCLUDE($ext_builddir)
PHP_NEW_EXTENSION([uopz], m4_normalize([
src/class.c
src/constant.c
src/executors.c
src/function.c
src/handlers.c
src/hook.c
src/return.c
src/util.c
uopz.c
]),
[$ext_shared],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_ADD_BUILD_DIR([$ext_builddir/src])
PHP_ADD_INCLUDE([$ext_builddir])

AC_MSG_CHECKING([uopz coverage])
if test "$PHP_UOPZ_COVERAGE" != "no"; then
AC_MSG_RESULT([enabled])

PHP_ADD_MAKEFILE_FRAGMENT
else
AC_MSG_RESULT([disabled])
fi
AS_VAR_IF([PHP_UOPZ_COVERAGE], [no],, [PHP_ADD_MAKEFILE_FRAGMENT])
fi