X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=config.m4;h=fa209641b1acb375ce910bdaac7153cc13df8541;hp=47ee1b071268c15aaf0856ff14f003a491287f0e;hb=9c6a90318dc5e20b73820d7c2bb8eb3b30888cb3;hpb=2f5af21b263403997e154658635d6b6e6eaab453 diff --git a/config.m4 b/config.m4 index 47ee1b0..fa20964 100644 --- a/config.m4 +++ b/config.m4 @@ -2,41 +2,41 @@ PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi) PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi) m4_foreach(incfile, [ - [ax_check_sign.m4], - [ax_pthread.m4], - [psi.m4], - [psi_type.m4], - [psi_const.m4], - [psi_decl.m4], - [psi_macro.m4], - [psi_struct.m4], - [errno.m4], - [fcntl.m4], - [glob.m4], - [locale.m4], - [stddef.m4], - [stdio.m4], - [stdint.m4], - [stdlib.m4], - [sys_select.m4], - [sys_socket.m4], - [sys_stat.m4], - [sys_time.m4], - [sys_times.m4], - [sys_types.m4], - [sys_uio.m4], - [sys_utsname.m4], - [ndbm.m4], - [netdb.m4], - [netinet_in.m4], - [netinet_tcp.m4], - [poll.m4], - [signal.m4], - [syslog.m4], - [time.m4], - [unistd.m4], - [wchar.m4], - [wctype.m4]], [ + [ax/ax_check_sign.m4], + [ax/ax_pthread.m4], + [psi/psi.m4], + [psi/psi_type.m4], + [psi/psi_const.m4], + [psi/psi_decl.m4], + [psi/psi_macro.m4], + [psi/psi_struct.m4], + [posix/errno.m4], + [posix/fcntl.m4], + [posix/glob.m4], + [posix/locale.m4], + [posix/stddef.m4], + [posix/stdio.m4], + [posix/stdint.m4], + [posix/stdlib.m4], + [posix/sys_select.m4], + [posix/sys_socket.m4], + [posix/sys_stat.m4], + [posix/sys_time.m4], + [posix/sys_times.m4], + [posix/sys_types.m4], + [posix/sys_uio.m4], + [posix/sys_utsname.m4], + [posix/ndbm.m4], + [posix/netdb.m4], + [posix/netinet_in.m4], + [posix/netinet_tcp.m4], + [posix/poll.m4], + [posix/signal.m4], + [posix/syslog.m4], + [posix/time.m4], + [posix/unistd.m4], + [posix/wchar.m4], + [posix/wctype.m4]], [ dnl pecl build sinclude([m4/]incfile) dnl php-src build @@ -46,25 +46,45 @@ 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], [ ], [ ]) + + PHP_ARG_WITH(psi-libffi, where to find libffi, + [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ]) + + 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= -if test "$PHP_PSI" != no; then - PHP_CONFIGURE_PART(Configuring PSI) - PSI_LEMON PSI_CHECK_LIBJIT PSI_CHECK_LIBFFI AC_PATH_PROG(NM, nm) AC_FUNC_FNMATCH - + AC_FUNC_MMAP + PSI_CONFIG_INIT PSI_CHECK_STD_TYPES PSI_CHECK_STDINT @@ -96,20 +116,24 @@ if test "$PHP_PSI" != no; then PSI_CHECK_WCTYPE PSI_CONFIG_DONE + 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)