flush
[m6w6/ext-psi] / config.m4
index 999f61c851d0c48eddac05b0fcd681cec1c898a6..1207c0ca943a1b07f01687e838eb514e128dd064 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -1,34 +1,56 @@
-PHP_ARG_ENABLE(psi, whether to enable psi support,
-[  --with-psi[[=path to libjit]]
-                          Enable PHP System Interface support])
-
-if test "$PHP_PSI" != "no"; then
-       AC_ARG_VAR(LEMON, The lemon parser generator of the SQLite project)
-       AC_PATH_PROG(LEMON, lemon, ./lemon)
-       PHP_SUBST(LEMON)
-
-       AC_CACHE_CHECK(for libjit install root, PSI_cv_LIBJIT_DIR, [
-       for PSI_cv_LIBJIT_DIR in {/usr{,/local},/opt}{,libjit}
-       do
-               if test -e $PSI_cv_LIBJIT_DIR/include/jit/jit.h
-               then
-                       break
-               fi
-               PSI_cv_LIBJIT_DIR=
-       done])
-       if test -z "$PSI_cv_LIBJIT_DIR"
-       then
-               AC_MSG_ERROR([Could not find libjit, please provide the base install path])
-       fi
+PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support,
+[  --enable-psi            Enable PHP System Interface support])
+
+if test "$PHP_PSI" != no; then
+       PHP_CONFIGURE_PART(Configuring PSI)
 
        PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi)
        PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi)
 
+       sinclude(config.ax_check_sign.m4)
+       sinclude(config.psi.m4)
+       sinclude(config.psi_type.m4)
+       sinclude(config.psi_const.m4)
+       sinclude(config.psi_decl.m4)
+       sinclude(config.psi_macro.m4)
+       sinclude(config.psi_struct.m4)
+
+       sinclude(config.psi_errno.m4)
+       sinclude(config.psi_glob.m4)
+       sinclude(config.psi_stddef.m4)
+       sinclude(config.psi_stdio.m4)
+       sinclude(config.psi_stdint.m4)
+       sinclude(config.psi_sys_types.m4)
+
+       PSI_LEMON
+       PSI_CHECK_LIBJIT
+       PSI_CHECK_LIBFFI
+
+       AC_FUNC_FNMATCH
+       AC_HEADER_DIRENT
+
+       PSI_CHECK_STD_TYPES
+       PSI_CHECK_STDINT
+       PSI_CHECK_STDDEF
+       PSI_CHECK_SYS_TYPES
+       PSI_CHECK_ERRNO
+       PSI_CHECK_GLOB
+       PSI_CHECK_STDIO
+
+       echo PSI_TYPES=$PSI_TYPES
+       echo PSI_MACROS=$PSI_MACROS
+       echo PSI_REDIRS=$PSI_REDIRS
+       echo PSI_DECLS=$PSI_DECLS
+       echo PSI_STRUCTS=$PSI_STRUCTS
+
+       PHP_SUBST(PSI_SHARED_LIBADD)
+
        PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src)
        PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)
 
        PHP_PSI_HEADERS=`(cd $PHP_PSI_SRCDIR/src && echo *.h)`
-       PHP_PSI_SOURCES=`(cd $PHP_PSI_SRCDIR && echo src/*.c)`
+       PHP_PSI_SOURCES="src/parser_proc.c src/parser.c src/module.c src/context.c"
+       PHP_PSI_SOURCES="$PHP_PSI_SOURCES src/libjit.c src/libffi.c"
 
        PHP_NEW_EXTENSION(psi, $PHP_PSI_SOURCES, $ext_shared)
        PHP_INSTALL_HEADERS(ext/psi, php_psi.h $PHP_PSI_HEADERS)
@@ -40,4 +62,6 @@ if test "$PHP_PSI" != "no"; then
        PHP_SUBST(PHP_PSI_BUILDDIR)
 
        PHP_ADD_MAKEFILE_FRAGMENT
+
+       AC_MSG_RESULT()
 fi