gdbinit
[m6w6/ext-psi] / config.m4
1 PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi)
2
3 case "PHP_EXT_BUILDDIR(psi)" in
4 ""|.) PHP_PSI_BUILDDIR=$PHP_PSI_SRCDIR
5 ;;
6 *) PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi)
7 ;;
8 esac
9
10 m4_foreach(incfile, [
11 [ax/ax_check_sign.m4],
12 [ax/ax_pthread.m4],
13 [psi/psi.m4],
14 [psi/psi_const.m4],
15 [psi/psi_type.m4]], [
16 dnl pecl build
17 sinclude([m4/]incfile)
18 dnl php-src build
19 sinclude([ext/psi/m4/]incfile)
20 ])
21
22 PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support,
23 [ --enable-psi Enable PSI (PHP System Interface) support])
24
25 if test "$PHP_PSI" != no; then
26
27 PHP_ARG_ENABLE(psi-maintainer-mode, whether to enable maintainer mode,
28 [ --enable-psi-maintainer-mode
29 PSI: enable maintainer mode
30 . parallel configure
31 . make dependencies
32 . extra debug wrappers], [no], [no])
33
34 PHP_ARG_WITH(psi-libjit, where to find libjit,
35 [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ])
36
37 PHP_ARG_WITH(psi-libffi, where to find libffi,
38 [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ])
39
40 AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG
41
42 dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late
43 dnl in the game, and we're currently only targeting _GNU_SOURCE for now
44 AC_MSG_CHECKING([for _GNU_SOURCE])
45 AC_EGREP_CPP([gnu_source_not_defined], [
46 #ifndef _GNU_SOURCE
47 gnu_source_not_defined
48 #endif
49 ], [
50 AC_MSG_RESULT([needs define])
51 AC_DEFINE([_GNU_SOURCE], [1], [ ])
52 ], [
53 AC_MSG_RESULT([already defined])
54 ])
55
56 AC_MSG_CHECKING([psi source dir])
57 AC_MSG_RESULT([$PHP_PSI_SRCDIR])
58 AC_MSG_CHECKING([psi build dir])
59 AC_MSG_RESULT([$PHP_PSI_BUILDDIR])
60
61 PSI_CHECK_LIBJIT
62 PSI_CHECK_LIBFFI
63
64 AC_FUNC_FNMATCH
65 AC_FUNC_MMAP
66
67 PSI_CONFIG_INIT
68 PSI_CHECK_STD_TYPES
69 PSI_CONFIG_DONE
70
71 PHP_SUBST(PSI_SHARED_LIBADD)
72
73 AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)
74
75 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR)
76 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
77 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/calc)
78 PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/types)
79 PHP_ADD_INCLUDE($PHP_PSI_BUILDDIR)
80 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
81 PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src/types)
82
83 PHP_PSI_HEADERS=" \
84 src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
85 src/calc/unary.h src/calc/cmp.h src/calc/oper.h \
86 `(cd $PHP_PSI_SRCDIR/src && ls *.h types/*.h)` \
87 "
88 # parser* should come first
89 PHP_PSI_SOURCES=" \
90 src/parser_proc.c src/parser.c \
91 `(cd $PHP_PSI_SRCDIR && ls src/*.c src/types/*.c \
92 | $EGREP -v '^src/parser' \
93 )` \
94 "
95 PHP_PSI_GENERATED=" \
96 src/parser_proc.c src/parser.c \
97 src/calc/basic.h src/calc/bin.h src/calc/bool.h src/calc/cast.h \
98 src/calc/unary.h src/calc/cmp.h src/calc/oper.h \
99 "
100
101 PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
102 PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
103
104 PHP_SUBST(PHP_PSI_GENERATED)
105 PHP_SUBST(PHP_PSI_HEADERS)
106 PHP_SUBST(PHP_PSI_SOURCES)
107
108 PHP_SUBST(PHP_PSI_SRCDIR)
109 PHP_SUBST(PHP_PSI_BUILDDIR)
110
111 PHP_ADD_MAKEFILE_FRAGMENT
112 AC_MSG_RESULT()
113 fi