xref: /PHP-7.2/sapi/phpdbg/config.m4 (revision b7442f1b)
1dnl
2dnl $Id$
3dnl
4
5PHP_ARG_ENABLE(phpdbg, for phpdbg support,
6[  --enable-phpdbg            Build phpdbg], yes, yes)
7
8PHP_ARG_ENABLE(phpdbg-webhelper, for phpdbg web SAPI support,
9[  --enable-phpdbg-webhelper  Build phpdbg web SAPI support], no)
10
11PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
12[  --enable-phpdbg-debug      Build phpdbg in debug mode], no, no)
13
14PHP_ARG_ENABLE(phpdbg-readline, for phpdbg readline support,
15[  --enable-phpdbg-readline   Enable readline support in phpdbg (depends on static ext/readline)], no, no)
16
17if test "$BUILD_PHPDBG" = "" && test "$PHP_PHPDBG" != "no"; then
18  AC_HEADER_TIOCGWINSZ
19  AC_DEFINE(HAVE_PHPDBG, 1, [ ])
20
21  if test "$PHP_PHPDBG_DEBUG" != "no"; then
22    AC_DEFINE(PHPDBG_DEBUG, 1, [ ])
23  else
24    AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
25  fi
26
27  PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
28  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"
29
30  AC_MSG_CHECKING([for phpdbg and readline integration])
31  if test "$PHP_PHPDBG_READLINE" = "yes"; then
32    if test "$PHP_READLINE" != "no" -o  "$PHP_LIBEDIT" != "no"; then
33  	  AC_DEFINE(HAVE_PHPDBG_READLINE, 1, [ ])
34  	  PHPDBG_EXTRA_LIBS="$PHP_READLINE_LIBS"
35  	  AC_MSG_RESULT([ok])
36  	else
37  	  AC_MSG_RESULT([readline is not available])
38    fi
39  else
40    AC_MSG_RESULT([disabled])
41  fi
42
43  PHP_SUBST(PHP_PHPDBG_CFLAGS)
44  PHP_SUBST(PHP_PHPDBG_FILES)
45  PHP_SUBST(PHPDBG_EXTRA_LIBS)
46
47  PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/phpdbg/Makefile.frag], [$abs_srcdir/sapi/phpdbg], [$abs_builddir/sapi/phpdbg])
48  PHP_SELECT_SAPI(phpdbg, program, $PHP_PHPDBG_FILES, $PHP_PHPDBG_CFLAGS, [$(SAPI_PHPDBG_PATH)])
49
50  BUILD_BINARY="sapi/phpdbg/phpdbg"
51  BUILD_SHARED="sapi/phpdbg/libphpdbg.la"
52
53  BUILD_PHPDBG="\$(LIBTOOL) --mode=link \
54        \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \
55                \$(PHP_GLOBAL_OBJS) \
56                \$(PHP_BINARY_OBJS) \
57                \$(PHP_PHPDBG_OBJS) \
58                \$(EXTRA_LIBS) \
59                \$(PHPDBG_EXTRA_LIBS) \
60                \$(ZEND_EXTRA_LIBS) \
61         -o \$(BUILD_BINARY)"
62
63  BUILD_PHPDBG_SHARED="\$(LIBTOOL) --mode=link \
64        \$(CC) -shared -Wl,-soname,libphpdbg.so -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \
65                \$(PHP_GLOBAL_OBJS) \
66                \$(PHP_BINARY_OBJS) \
67                \$(PHP_PHPDBG_OBJS) \
68                \$(EXTRA_LIBS) \
69                \$(PHPDBG_EXTRA_LIBS) \
70                \$(ZEND_EXTRA_LIBS) \
71                \-DPHPDBG_SHARED \
72         -o \$(BUILD_SHARED)"
73
74  PHP_SUBST(BUILD_BINARY)
75  PHP_SUBST(BUILD_SHARED)
76  PHP_SUBST(BUILD_PHPDBG)
77  PHP_SUBST(BUILD_PHPDBG_SHARED)
78
79  PHP_OUTPUT(sapi/phpdbg/phpdbg.1)
80fi
81
82if test "$PHP_PHPDBG_WEBHELPER" != "no"; then
83  PHP_NEW_EXTENSION(phpdbg_webhelper, phpdbg_rinit_hook.c phpdbg_webdata_transfer.c, $ext_shared)
84fi
85
86dnl ## Local Variables:
87dnl ## tab-width: 4
88dnl ## End:
89