Browse Source

processor: avoid using srcdir dstdir marco for m4

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1473 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 8 years ago
parent
commit
8f51668e2e
  1. 5
      Makefile.frag
  2. 2
      config.m4
  3. 3
      config.w32
  4. 2
      processor/head.m4
  5. 28
      processor/main.m4
  6. 2
      processor/processor.m4

5
Makefile.frag

@ -11,10 +11,11 @@ $(XCACHE_INCLUDES_I):
$(XCACHE_STRUCTINFO_OUT): $(XCACHE_INCLUDES_I) $(srcdir)/gen_structinfo.awk
@echo $(XCACHE_STRUCTINFO_OUT) is optional if XCache test is not enabled, feel free if it awk failed to produce it
-$(XCACHE_AWK) -f $(srcdir)/gen_structinfo.awk < $(XCACHE_INCLUDES_I) > $(XCACHE_STRUCTINFO_OUT).tmp && mv $(XCACHE_STRUCTINFO_OUT).tmp $(XCACHE_STRUCTINFO_OUT)
$(XCACHE_AWK) -f $(srcdir)/gen_structinfo.awk < $(XCACHE_INCLUDES_I) > $(XCACHE_STRUCTINFO_OUT).tmp || echo > $(XCACHE_STRUCTINFO_OUT)
mv $(XCACHE_STRUCTINFO_OUT).tmp $(XCACHE_STRUCTINFO_OUT)
$(XCACHE_PROC_OUT): $(XCACHE_PROC_SRC) $(XCACHE_STRUCTINFO_OUT) $(XCACHE_PROC_SOURCES)
$(M4) -D srcdir=$(XCACHE_BACKTICK)"$(srcdir)'" -D builddir=$(XCACHE_BACKTICK)"$(builddir)'" $(XCACHE_ENABLE_TEST) $(XCACHE_PROC_SRC) > $(XCACHE_PROC_OUT).tmp
$(M4) $(XCACHE_ENABLE_TEST) $(XCACHE_STRUCTINFO_OUT) $(XCACHE_PROC_SRC) > $(XCACHE_PROC_OUT).tmp
mv $(XCACHE_PROC_OUT).tmp $(XCACHE_PROC_OUT)
$(XCACHE_PROC_H): $(XCACHE_PROC_OUT)

2
config.m4

@ -109,8 +109,6 @@ done
M4="$M4 -B 102400"
fi
PHP_SUBST([M4])
XCACHE_BACKTICK="'"'`'"'"
PHP_SUBST([XCACHE_BACKTICK])
AC_PATH_PROGS([GREP], [grep])
PHP_SUBST([GREP])
AC_PATH_PROGS([SED], [sed])

3
config.w32

@ -70,7 +70,6 @@ xc_cacher.c \
ERROR(apps[i] + " is currently required to build XCache");
}
}
DEFINE("XCACHE_BACKTICK", "`")
PATH_PROG("gawk", null, "XCACHE_AWK") || PATH_PROG("awk", null, "XCACHE_AWK");
// the cygwin indent is known broken on our output
@ -134,8 +133,6 @@ xc_cacher.c \
frag = frag.replace(/ -o /g, " /Fo");
frag = frag.replace(/cp /g, "copy ");
frag = frag.replace(/mv /g, "move ");
frag = frag.replace(/ \|\| /g, "\r\n\tif errorlevel 1 ");
frag = frag.replace(/ && /g, "\r\n\tif not errorlevel 1 ");
if (indent == '') {
frag = frag.replace(/\| *\$\(XCACHE_INDENT\)/g, '');
frag = frag.replace(/\$\(XCACHE_INDENT\) *< */g, 'type ');

2
processor/head.m4

@ -52,8 +52,6 @@ m4_errprint(`AUTOCHECK INFO: runtime autocheck Disabled (optimized build)')
')
ifdef(`DEBUG_SIZE', `static int xc_totalsize = 0;')
sinclude(builddir`/structinfo.m4')
#ifndef NDEBUG
# undef inline
#define inline

28
processor/main.m4

@ -17,6 +17,10 @@ ifdef(`len', `
define(`m4_len', defn(`len'))
undefine(`len')
')
define(`dirof', `patsubst(`$1', `[/\\][^/\\]*$', `')')
ifdef(`__dir__', `', `
define(`__dir__', `dirof(__file__)')
')
define(`XCACHE_STRS', `($1), (sizeof($1))')
define(`XCACHE_STRL', `($1), (sizeof($1) - 1)')
define(`SRC', `ifelse(`$1', `', `src', `src->$1')')
@ -248,37 +252,37 @@ EXPORT_PROCESSOR(`dasm', `zend_function')
EXPORT_PROCESSOR(`dasm', `zend_class_entry')
EXPORT_PROCESSOR(`dprint', `zval')
include(srcdir`/processor/hashtable.m4')
include(srcdir`/processor/string.m4')
include(srcdir`/processor/struct.m4')
include(srcdir`/processor/process.m4')
include(srcdir`/processor/head.m4')
include(__dir__`/hashtable.m4')
include(__dir__`/string.m4')
include(__dir__`/struct.m4')
include(__dir__`/process.m4')
include(__dir__`/head.m4')
REDEF(`PROCESSOR_TYPE', `calc') include(srcdir`/processor/processor.m4')
REDEF(`PROCESSOR_TYPE', `calc') include(__dir__`/processor.m4')
pushdef(`RELOCATE_EX', `$2 = ptradd($1 *, notnullable($2), processor->relocatediff);')
REDEF(`PROCESSOR_TYPE', `store') include(srcdir`/processor/processor.m4')
REDEF(`PROCESSOR_TYPE', `store') include(__dir__`/processor.m4')
popdef(`RELOCATE_EX')
REDEF(`PROCESSOR_TYPE', `restore') include(srcdir`/processor/processor.m4')
REDEF(`PROCESSOR_TYPE', `restore') include(__dir__`/processor.m4')
pushdef(`PTR_FROM_VIRTUAL_EX', `ptradd($1 *, notnullable($2), ptrdiff)')
pushdef(`RELOCATE_EX', `$2 = ptradd($1 *, notnullable($2), relocatediff);')
pushdef(`SRC', defn(`DST'))
REDEF(`PROCESSOR_TYPE', `relocate') include(srcdir`/processor/processor.m4')
REDEF(`PROCESSOR_TYPE', `relocate') include(__dir__`/processor.m4')
popdef(`SRC')
popdef(`RELOCATE_EX')
popdef(`PTR_FROM_VIRTUAL_EX')
#ifdef HAVE_XCACHE_DPRINT
REDEF(`PROCESSOR_TYPE', `dprint') include(srcdir`/processor/processor.m4')
REDEF(`PROCESSOR_TYPE', `dprint') include(__dir__`/processor.m4')
#endif /* HAVE_XCACHE_DPRINT */
#ifdef HAVE_XCACHE_DISASSEMBLER
REDEF(`PROCESSOR_TYPE', `dasm') include(srcdir`/processor/processor.m4')
REDEF(`PROCESSOR_TYPE', `dasm') include(__dir__`/processor.m4')
#endif /* HAVE_XCACHE_DISASSEMBLER */
undefine(`PROCESSOR_TYPE')
include(srcdir`/processor/foot.m4')
include(__dir__`/foot.m4')
ifdef(`EXIT_PENDING', `m4exit(EXIT_PENDING)')

2
processor/processor.m4

@ -912,7 +912,7 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
#else
dnl zend_cv.m4 is illegal to be made public, don not ask me for it
IFDASM(`
sinclude(srcdir`/processor/zend_cv.m4')
sinclude(__dir__`/zend_cv.m4')
')
#endif

Loading…
Cancel
Save