X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=config.m4;h=fa209641b1acb375ce910bdaac7153cc13df8541;hp=df18db6d66fe51b29e28c0950f4df8067862e90b;hb=9c6a90318dc5e20b73820d7c2bb8eb3b30888cb3;hpb=a78817d6e2da0be5942dd8e1d334789e9e88ffa3 diff --git a/config.m4 b/config.m4 index df18db6..fa20964 100644 --- a/config.m4 +++ b/config.m4 @@ -46,19 +46,35 @@ m4_foreach(incfile, [ PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support, [ --enable-psi Enable PHP System Interface support]) -PHP_ARG_ENABLE(psi-posix, whether to pre-define POSIX decls, -[ --enable-psi-posix=... PSI: pre-define POSIX decls], [ ], [ ]) +if test "$PHP_PSI" != no; then + PHP_CONFIGURE_PART(Configuring PSI) -PHP_ARG_WITH(psi-libjit, where to find libjit, -[ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ]) + PHP_ARG_ENABLE(psi-posix, whether to pre-define POSIX decls, + [ --enable-psi-posix=... PSI: pre-define POSIX decls], [ ], [ ]) -PHP_ARG_WITH(psi-libffi, where to find libffi, -[ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ]) + PHP_ARG_WITH(psi-libjit, where to find libjit, + [ --with-psi-libjit=DIR PSI: path to libjit], [ ], [ ]) -if test "$PHP_PSI" != no; then - PHP_CONFIGURE_PART(Configuring PSI) + PHP_ARG_WITH(psi-libffi, where to find libffi, + [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ]) - save_LIBS=$LIBS + AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG + + dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late + dnl in the game, and we're currently only targeting _GNU_SOURCE for now + AC_MSG_CHECKING([for _GNU_SOURCE]) + AC_EGREP_CPP([gnu_source_not_defined], [ + #ifndef _GNU_SOURCE + gnu_source_not_defined + #endif + ], [ + AC_MSG_RESULT([needs define]) + AC_DEFINE([_GNU_SOURCE], [], [ ]) + ], [ + AC_MSG_RESULT([already defined]) + ]) + + psi_save_LIBS=$LIBS LIBS= PSI_LEMON @@ -67,6 +83,7 @@ if test "$PHP_PSI" != no; then AC_PATH_PROG(NM, nm) AC_FUNC_FNMATCH + AC_FUNC_MMAP PSI_CONFIG_INIT PSI_CHECK_STD_TYPES @@ -99,23 +116,24 @@ if test "$PHP_PSI" != no; then PSI_CHECK_WCTYPE PSI_CONFIG_DONE - eval_LIBS=$LIBS - LIBS=$save_LIBS - PHP_EVAL_LIBLINE($eval_LIBS, PSI_SHARED_LIBADD) + psi_eval_LIBS=$LIBS + LIBS=$psi_save_LIBS + PHP_EVAL_LIBLINE($psi_eval_LIBS, PSI_SHARED_LIBADD) PHP_SUBST(PSI_SHARED_LIBADD) AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix) - AC_DEFINE_UNQUOTED([PSI_STDINC], [$PSI_STDINC], [Standard includes]) - AC_DEFINE_UNQUOTED([PSI_TYPES], [$PSI_TYPES], [Predefined types]) - AC_DEFINE_UNQUOTED([PSI_STRUCTS], [$PSI_STRUCTS], [Predefined structs]) - AC_DEFINE_UNQUOTED([PSI_UNIONS], [$PSI_UNIONS], [Predefined structs]) - AC_DEFINE_UNQUOTED([PSI_CONSTS], [$PSI_CONSTS], [Predefined constants]) - AC_DEFINE_UNQUOTED([PSI_MACROS], [$PSI_MACROS], [Redirected Macros]) - AC_DEFINE_UNQUOTED([PSI_REDIRS], [$PSI_REDIRS], [Redirected functions]) - AC_DEFINE_UNQUOTED([PSI_DECLS], [$PSI_DECLS], [Predefined functions]) - AC_DEFINE_UNQUOTED([PSI_VA_DECLS], [$PSI_VA_DECLS], [Predefined vararg functions]) - + AC_DEFINE_UNQUOTED([PSI_STDINC], ["$PSI_STDINC"], [Standard includes]) + AC_DEFINE_UNQUOTED([PSI_TYPES], ["$PSI_TYPES"], [Predefined types]) + AC_DEFINE_UNQUOTED([PSI_STRUCTS], ["$PSI_STRUCTS"], [Predefined structs]) + AC_DEFINE_UNQUOTED([PSI_UNIONS], ["$PSI_UNIONS"], [Predefined structs]) + AC_DEFINE_UNQUOTED([PSI_CONSTS], ["$PSI_CONSTS"], [Predefined constants]) + AC_DEFINE_UNQUOTED([PSI_MACROS], ["$PSI_MACROS"], [Redirected Macros]) + AC_DEFINE_UNQUOTED([PSI_REDIRS], ["$PSI_REDIRS"], [Redirected functions]) + AC_DEFINE_UNQUOTED([PSI_DECLS], ["$PSI_DECLS"], [Predefined functions]) + AC_DEFINE_UNQUOTED([PSI_VA_DECLS], ["$PSI_VA_DECLS"], [Predefined vararg functions]) + + PHP_ADD_INCLUDE($PHP_PSI_SRCDIR) PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src) PHP_ADD_INCLUDE($PHP_PSI_SRCDIR/src/types) PHP_ADD_BUILD_DIR($PHP_PSI_BUILDDIR/src)