xref: /PHP-7.3/sapi/phpdbg/config.m4 (revision b7442f1b)
1dnl config.m4 for sapi phpdbg
2
3PHP_ARG_ENABLE(phpdbg, for phpdbg support,
4[  --enable-phpdbg         Build phpdbg], yes, yes)
5
6PHP_ARG_ENABLE(phpdbg-webhelper, for phpdbg web SAPI support,
7[  --enable-phpdbg-webhelper
8                          Build phpdbg web SAPI support], no)
9
10PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
11[  --enable-phpdbg-debug   Build phpdbg in debug mode], no, no)
12
13PHP_ARG_ENABLE(phpdbg-readline, for phpdbg readline support,
14[  --enable-phpdbg-readline   Enable readline support in phpdbg (depends on static ext/readline)], no, no)
15
16if test "$BUILD_PHPDBG" = "" && test "$PHP_PHPDBG" != "no"; then
17  AC_HEADER_TIOCGWINSZ
18  AC_DEFINE(HAVE_PHPDBG, 1, [ ])
19
20  if test "$PHP_PHPDBG_DEBUG" != "no"; then
21    AC_DEFINE(PHPDBG_DEBUG, 1, [ ])
22  else
23    AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
24  fi
25
26  PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
27  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"
28
29  AC_MSG_CHECKING([for phpdbg and readline integration])
30  if test "$PHP_PHPDBG_READLINE" = "yes"; then
31    if test "$PHP_READLINE" != "no" -o  "$PHP_LIBEDIT" != "no"; then
32  	  AC_DEFINE(HAVE_PHPDBG_READLINE, 1, [ ])
33  	  PHPDBG_EXTRA_LIBS="$PHP_READLINE_LIBS"
34  	  AC_MSG_RESULT([ok])
35  	else
36  	  AC_MSG_RESULT([readline is not available])
37    fi
38  else
39    AC_MSG_RESULT([disabled])
40  fi
41
42  PHP_SUBST(PHP_PHPDBG_CFLAGS)
43  PHP_SUBST(PHP_PHPDBG_FILES)
44  PHP_SUBST(PHPDBG_EXTRA_LIBS)
45
46  PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/phpdbg/Makefile.frag], [$abs_srcdir/sapi/phpdbg], [$abs_builddir/sapi/phpdbg])
47  PHP_SELECT_SAPI(phpdbg, program, $PHP_PHPDBG_FILES, $PHP_PHPDBG_CFLAGS, [$(SAPI_PHPDBG_PATH)])
48
49  BUILD_BINARY="sapi/phpdbg/phpdbg"
50  BUILD_SHARED="sapi/phpdbg/libphpdbg.la"
51
52  BUILD_PHPDBG="\$(LIBTOOL) --mode=link \
53        \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \
54                \$(PHP_GLOBAL_OBJS) \
55                \$(PHP_BINARY_OBJS) \
56                \$(PHP_PHPDBG_OBJS) \
57                \$(EXTRA_LIBS) \
58                \$(PHPDBG_EXTRA_LIBS) \
59                \$(ZEND_EXTRA_LIBS) \
60                \$(PHP_FRAMEWORKS) \
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