Browse Source

fix win32 build

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1006 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 9 years ago
parent
commit
063f9a1fb8
  1. 36
      config.m4
  2. 41
      config.w32
  3. 1
      devel/run
  4. 8
      mod_coverager/xc_coverager.c
  5. 10
      util/xc_trace.h
  6. 2
      xcache/xc_utils.h

36
config.m4

@ -23,21 +23,27 @@ if test "$PHP_XCACHE" != "no"; then
AC_DEFINE([HAVE_XCACHE_CONSTANT], 1, [Define to enable XCache handling of compile time constants])
fi
xcache_sources=" \
util/xc_stack.c \
util/xc_trace.c \
xcache.c \
xcache/xc_const_string.c \
xcache/xc_compatibility.c \
xcache/xc_lock.c \
xcache/xc_mem.c \
xcache/xc_opcode_spec.c \
xcache/xc_processor.c \
xcache/xc_sandbox.c \
xcache/xc_shm.c \
xcache/xc_shm_mmap.c \
xcache/xc_utils.c \
"
xcache_sources="xcache.c"
for i in \
xc_stack.c \
xc_trace.c \
; do
xcache_sources="$xcache_sources util/$i"
done
for i in \
xc_const_string.c \
xc_compatibility.c \
xc_lock.c \
xc_mem.c \
xc_opcode_spec.c \
xc_processor.c \
xc_sandbox.c \
xc_shm.c \
xc_shm_mmap.c \
xc_utils.c \
; do
xcache_sources="$xcache_sources xcache/$i"
done
XCACHE_MODULES="cacher"
XCACHE_MODULE([optimizer], [optimizer ], [XCACHE_OPTIMIZER], [(N/A)])
XCACHE_MODULE([coverager], [coverager ], [XCACHE_COVERAGER], [Enable code coverage dumper, useful for testing php scripts])

41
config.w32

@ -4,6 +4,7 @@
ARG_ENABLE("xcache", "Include XCache support", "yes,shared");
if (PHP_XCACHE != "no") {
EXTENSION("xcache", "xcache.c", null, "/I " + configure_module_dirname);
// {{{ check for xcache-constant
ARG_ENABLE("xcache-constant", "XCache: Handle new constants made by php compiler (e.g.: for __halt_compiler)", "yes");
if (PHP_XCACHE_CONSTANT != "no") {
@ -11,21 +12,24 @@ if (PHP_XCACHE != "no") {
}
// }}}
var xcache_sources = " \
util/xc_stack.c \
util/xc_trace.c \
xcache.c \
xcache/xc_const_string.c \
xcache/xc_compatibility.c \
xcache/xc_lock.c \
xcache/xc_mem.c \
xcache/xc_opcode_spec.c \
xcache/xc_processor.c \
xcache/xc_sandbox.c \
xcache/xc_shm.c \
xcache/xc_shm_mmap.c \
xcache/xc_utils.c \
";
ADD_SOURCES(configure_module_dirname + "/util", " \
xc_stack.c \
xc_trace.c \
", "xcache");
ADD_SOURCES(configure_module_dirname + "/xcache", " \
xc_const_string.c \
xc_compatibility.c \
xc_lock.c \
xc_mem.c \
xc_opcode_spec.c \
xc_processor.c \
xc_sandbox.c \
xc_shm.c \
xc_shm_mmap.c \
xc_utils.c \
", "xcache");
// {{{ add sources on enabled
ARG_ENABLE("xcache-optimizer", "(N/A)", "no");
ARG_ENABLE("xcache-coverager", "Enable code coverage dumper, useful for testing php scripts", "no");
@ -44,7 +48,7 @@ xcache/xc_utils.c \
var uname = name.toUpperCase();
var withval = eval("PHP_XCACHE_" + uname);
if (withval != "no") {
xcache_sources += " mod_" + name + "/xc_" + name + ".c";
ADD_SOURCES(configure_module_dirname + "/mod_" + name, "xc_" + name + ".c", "xcache");
XCACHE_MODULES += " " + name;
STDOUT.WriteLine("Enabling XCache Module: " + name);
AC_DEFINE("HAVE_XCACHE_" + uname, 1, "Define for XCache: " + name)
@ -79,7 +83,7 @@ xcache/xc_utils.c \
ARG_ENABLE("xcache-test", "XCache: Enable self test - FOR DEVELOPERS ONLY!!", "no");
if (PHP_XCACHE_TEST != "no") {
ADD_FLAG("XCACHE_ENABLE_TEST", "-DXCACHE_ENABLE_TEST");
xcache_sources += " xcache/xc_malloc.c";
ADD_SOURCES(configure_module_dirname + "/xcache", "xc_malloc.c", "xcache");
AC_DEFINE("HAVE_XCACHE_TEST", 1, "Define to enable XCache self test");
}
else {
@ -92,8 +96,7 @@ xcache/xc_utils.c \
AC_DEFINE("HAVE_XCACHE_DPRINT", 1, "Define to enable XCache debug print functions");
}
// }}}
// {{{ create extension
EXTENSION("xcache", xcache_sources);
// {{{ get ccrule
var srcdir = configure_module_dirname;
// it's a bit harder to get builddir
var mfofile = "Makefile.objects";

1
devel/run

@ -86,6 +86,7 @@ reb*)
--enable-xcache-encoder \
--enable-xcache-decoder \
--enable-xcache-disassembler \
--enable-xcache-coverager \
--enable-xcache-test --enable-xcache-constant \
&& make clean all
exit

8
mod_coverager/xc_coverager.c

@ -12,10 +12,12 @@
#include <sys/stat.h>
#include <fcntl.h>
#include "stack.h"
#include "util/xc_stack.h"
#include "util/xc_trace.h"
#include "xcache_globals.h"
#include "coverager.h"
#include "utils.h"
#include "xc_coverager.h"
#include "xcache/xc_utils.h"
typedef HashTable *coverager_t;
#define PCOV_HEADER_MAGIC 0x564f4350

10
util/xc_trace.h

@ -5,6 +5,16 @@
#pragma once
#endif // _MSC_VER > 1000
#ifdef ZEND_WIN32
# ifndef inline
# ifdef ZEND_WIN32_FORCE_INLINE
# define inline __forceinline
# else
# define inline
# endif
# endif
#endif
#ifdef XCACHE_DEBUG
# define IFDEBUG(x) (x)
int xc_vtrace(const char *fmt, va_list args);

2
xcache/xc_utils.h

@ -1,5 +1,5 @@
#include "php.h"
#include "xcache.h"
#include "../xcache.h"
typedef struct {
zend_op_array *op_array;

Loading…
Cancel
Save