1PHP_ARG_ENABLE([phpdbg], 2 [for phpdbg support], 3 [AS_HELP_STRING([--enable-phpdbg], 4 [Build phpdbg])], 5 [yes], 6 [yes]) 7 8PHP_ARG_ENABLE([phpdbg-webhelper], 9 [for phpdbg web SAPI support], 10 [AS_HELP_STRING([--enable-phpdbg-webhelper], 11 [Build phpdbg web SAPI support])], 12 [no]) 13 14PHP_ARG_ENABLE([phpdbg-debug], 15 [for phpdbg debug build], 16 [AS_HELP_STRING([--enable-phpdbg-debug], 17 [Build phpdbg in debug mode])], 18 [no], 19 [no]) 20 21PHP_ARG_ENABLE([phpdbg-readline], 22 [for phpdbg readline support], 23 [AS_HELP_STRING([--enable-phpdbg-readline], 24 [Enable readline support in phpdbg (depends on static ext/readline)])], 25 [no], 26 [no]) 27 28if test "$BUILD_PHPDBG" = "" && test "$PHP_PHPDBG" != "no"; then 29 AC_HEADER_TIOCGWINSZ 30 AC_DEFINE(HAVE_PHPDBG, 1, [ ]) 31 32 if test "$PHP_PHPDBG_DEBUG" != "no"; then 33 AC_DEFINE(PHPDBG_DEBUG, 1, [ ]) 34 else 35 AC_DEFINE(PHPDBG_DEBUG, 0, [ ]) 36 fi 37 38 PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" 39 PHP_PHPDBG_FILES="phpdbg.c phpdbg_parser.c phpdbg_lexer.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c phpdbg_info.c phpdbg_cmd.c phpdbg_set.c phpdbg_frame.c phpdbg_watch.c phpdbg_btree.c phpdbg_sigsafe.c phpdbg_wait.c phpdbg_io.c phpdbg_eol.c phpdbg_out.c" 40 41 AC_MSG_CHECKING([for phpdbg and readline integration]) 42 if test "$PHP_PHPDBG_READLINE" = "yes"; then 43 if test "$PHP_READLINE" != "no" -o "$PHP_LIBEDIT" != "no"; then 44 AC_DEFINE(HAVE_PHPDBG_READLINE, 1, [ ]) 45 PHPDBG_EXTRA_LIBS="$PHP_READLINE_LIBS" 46 AC_MSG_RESULT([ok]) 47 else 48 AC_MSG_RESULT([readline is not available]) 49 fi 50 else 51 AC_MSG_RESULT([disabled]) 52 fi 53 54 PHP_SUBST(PHP_PHPDBG_CFLAGS) 55 PHP_SUBST(PHP_PHPDBG_FILES) 56 PHP_SUBST(PHPDBG_EXTRA_LIBS) 57 58 PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/phpdbg/Makefile.frag], [$abs_srcdir/sapi/phpdbg], [$abs_builddir/sapi/phpdbg]) 59 PHP_SELECT_SAPI(phpdbg, program, $PHP_PHPDBG_FILES, $PHP_PHPDBG_CFLAGS, [$(SAPI_PHPDBG_PATH)]) 60 61 BUILD_BINARY="sapi/phpdbg/phpdbg" 62 BUILD_SHARED="sapi/phpdbg/libphpdbg.la" 63 64 BUILD_PHPDBG="\$(LIBTOOL) --mode=link \ 65 \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \ 66 \$(PHP_GLOBAL_OBJS:.lo=.o) \ 67 \$(PHP_BINARY_OBJS:.lo=.o) \ 68 \$(PHP_PHPDBG_OBJS:.lo=.o) \ 69 \$(EXTRA_LIBS) \ 70 \$(PHPDBG_EXTRA_LIBS) \ 71 \$(ZEND_EXTRA_LIBS) \ 72 \$(PHP_FRAMEWORKS) \ 73 -o \$(BUILD_BINARY)" 74 75 BUILD_PHPDBG_SHARED="\$(LIBTOOL) --mode=link \ 76 \$(CC) -shared -Wl,-soname,libphpdbg.so -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \ 77 \$(PHP_GLOBAL_OBJS) \ 78 \$(PHP_BINARY_OBJS) \ 79 \$(PHP_PHPDBG_OBJS) \ 80 \$(EXTRA_LIBS) \ 81 \$(PHPDBG_EXTRA_LIBS) \ 82 \$(ZEND_EXTRA_LIBS) \ 83 \-DPHPDBG_SHARED \ 84 -o \$(BUILD_SHARED)" 85 86 PHP_SUBST(BUILD_BINARY) 87 PHP_SUBST(BUILD_SHARED) 88 PHP_SUBST(BUILD_PHPDBG) 89 PHP_SUBST(BUILD_PHPDBG_SHARED) 90 91 PHP_OUTPUT(sapi/phpdbg/phpdbg.1) 92fi 93 94if test "$PHP_PHPDBG_WEBHELPER" != "no"; then 95 PHP_NEW_EXTENSION(phpdbg_webhelper, phpdbg_rinit_hook.c phpdbg_webdata_transfer.c, $ext_shared) 96fi 97