Changeset 998 in svn for trunk


Ignore:
Timestamp:
2012-07-19T05:57:56+02:00 (3 years ago)
Author:
Xuefer
Message:

refactor: fix build, easier devel

Location:
trunk
Files:
1 added
3 deleted
9 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        11acinclude.m4
        22aclocal.m4
         3autom4te.cache
        34build
        45config.cache
         
        1516conftest.c
        1617.deps
         18devel.ini
         19devel.php
         20.gdb_history
        1721include
        1822includes.i
         
        2731mkinstalldirs
        2832modules
        29 processor.h
        30 processor.out
        31 processor_real.c
         33prepare.devel.inc
        3234run-tests.php
        3335structinfo.m4
        34 autom4te.cache
         36.svnignore
        3537tags
        36 prepare.devel.inc
         38xc_processor.c
         39xc_processor.h
         40xc_processor.out.c
  • trunk/Makefile.frag

    r997 r998  
    11XCACHE_PROC_SRC=$(srcdir)/processor/main.m4
    2 XCACHE_PROC_OUT=$(builddir)/processor.out
    3 XCACHE_PROC_C=$(builddir)/xcache/xc_processor_real.c
    4 XCACHE_PROC_H=$(builddir)/xcache/xc_processor.h
     2XCACHE_PROC_OUT=$(builddir)/processor.out.c
     3XCACHE_PROC_C=$(builddir)/xc_processor.c.h
     4XCACHE_PROC_H=$(builddir)/xc_processor.h
    55XCACHE_INCLUDES_SRC=$(srcdir)/includes.c
    66XCACHE_INCLUDES_I=$(builddir)/includes.i
     
    2626    -$(XCACHE_INDENT) < $(XCACHE_PROC_OUT) > $(XCACHE_PROC_C).tmp && mv $(XCACHE_PROC_C).tmp $(XCACHE_PROC_C)
    2727
    28 $(builddir)/xcache/xc_processor.lo: $(XCACHE_PROC_C) $(XCACHE_PROC_H) $(srcdir)/xcache/xc_processor.c
     28$(builddir)/xcache/xc_processor.lo: $(XCACHE_PROC_C) $(XCACHE_PROC_H)
    2929
    30 $(builddir)/submodules/xc_disassembler.lo: $(XCACHE_PROC_H) $(srcdir)/xcache/xc_processor.c
     30$(builddir)/submodules/xc_disassembler.lo: $(XCACHE_PROC_H)
    3131
    3232$(builddir)/xc_opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/xc_opcode_spec.c $(srcdir)/xc_opcode_spec_def.h $(srcdir)/xc_const_string.h
     
    3535
    3636xcachesvnclean: clean
    37     cat $(srcdir)/.cvsignore | grep -v ^Makefile | grep -v ^config.nice | xargs rm -rf
     37    -svn propget svn:ignore . > .svnignore.tmp 2>/dev/null && mv .svnignore.tmp .svnignore
     38    cat .svnignore | grep -v devel | grep -v svnignore | grep -v ^Makefile | grep -v ^config.nice | xargs rm -rf
    3839
    3940xcachetest: all
  • trunk/devel

    • Property svn:ignore set to
      run.cfg
      prepare.cfg
  • trunk/devel/prepare

    r988 r998  
    22SELF="$0"
    33
    4 if test -e prepare.inc ; then
    5     . prepare.inc
     4if test -e devel/prepare.inc ; then
     5    . devel/prepare.inc
    66else
    7     echo prepare.inc is required, see prepare.inc.example >&2
     7    echo devel/prepare.inc is required, see devel/prepare.inc.example >&2
    88    exit
    99fi
  • trunk/devel/prepare.cfg.example

    r994 r998  
    1 # copy this file as ../devel.prepare.inc before modifying
     1# copy this file as prepare.cfg before modifying
    22PHP4_x_DIR=
    33PHP5_0_DIR=
  • trunk/devel/run

    r995 r998  
    11#!/bin/bash
    22# this script is for developers only
     3set -e
    34
    4 case "$1" in
     5. devel/run.cfg
     6if [[ ! -z $1 ]]; then
     7    type=$1
     8fi
     9
     10case "$type" in
    511prep*)
    612    exec ./devel/prepare
     13    ;;
     14xtest)
     15    exec /usr/bin/make -f devel/test.mak
    716    ;;
    817tags)
     
    1120esac
    1221
    13 . run.cfg
    14 
    1522basename=$(basename $(pwd))
    1623if echo $basename | grep -- - >/dev/null; then :; else
     24    svn propget svn:ignore . > .svnignore
     25
    1726    dirs=${dirs:-php5-debug}
    18 
    1927    for dir in $dirs; do
     28        mkdir -p ../${basename}-${dir}
    2029        cd ../${basename}-${dir} || exit
     30        lndir ../${basename} > /dev/null
    2131
    2232        pwd
     
    3040xcachesrcdir=../$xcachebasename
    3141
    32 rm -f php-src
    33 find -L . -type l | xargs rm -f
    34 lndir "$xcachesrcdir" >/dev/null
    35 find . -iname .\*.swp | xargs rm -f
    36 ln -sf ~/src/php/$phpbasename php-src
    37 for i in ~/src/php/$phpbasename/sapi/cgi/php{,-cgi}; do
    38     [[ -r $i ]] && ln -sf "$i" php-cgi
    39 done
    40 ln -sf ~/src/php/$phpbasename/sapi/cli/php php-cli
    41 
    4242if [[ ! -z $1 ]]; then
    4343    type=$1
     
    4747        args=("$@")
    4848    elif [[ -z $args ]]; then
    49         args=(test.php)
     49        args=(devel.php)
    5050    fi
    5151fi
     52
     53case "$type" in
     54reb*)
     55    if [[ -r Makefile ]]; then
     56        make xcachesvnclean
     57    fi
     58    ;;
     59esac
     60
     61rm -f php-src
     62find -L . -type l | xargs rm -f
     63lndir "$xcachesrcdir" >/dev/null
     64find . -iname .\*.swp | xargs rm -f
     65ln -sf ~/src/php/$phpbasename php-src
     66for i in ~/src/php/$phpbasename/sapi/cgi/php{,-cgi}; do
     67    if [[ -r $i ]]; then
     68        ln -sf "$i" php-cgi
     69    fi
     70done
     71ln -sf ~/src/php/$phpbasename/sapi/cli/php php-cli
    5272
    5373case "$type" in
     
    5979    fi
    6080    export PATH=$PHPDIRS/$phpbasename/bin:$PATH
    61     [[ -r Makefile ]] && make xcachesvnclean
    6281    phpize --clean \
    6382    && phpize \
     
    87106    ;;
    88107*)
    89     cmd=(./php-cgi -q -c php.ini)
     108    cmd=(./php-cgi -q -c devel.ini)
    90109    "${cmd[@]}" -v
    91110    ;;
     
    116135    ;;
    117136dc)
    118     exec ./php-cli -c php.ini ./bin/phpdc.phpr "${args[@]}" | tee decompiled.php
     137    exec ./php-cli -c devel.ini ./bin/phpdc.phpr "${args[@]}" | tee decompiled.php
    119138    ;;
    120139dop)
    121     exec ./php-cli -c php.ini ./bin/phpdop.phpr "${args[@]}"
     140    exec ./php-cli -c devel.ini ./bin/phpdop.phpr "${args[@]}"
    122141    ;;
    123142retest)
  • trunk/devel/test.mak

    r982 r998  
    44OBJS=mem.o
    55CC=gcc
    6 CFLAGS=-g -O0 -D TEST -Wall
     6CFLAGS=-g -O0 -I. -D TEST -Wall
    77TEST=valgrind
    88
    99all: mem
    1010
    11 mem_test: mem.c
    12     $(CC) $(CFLAGS) -o mem_test mem.c
     11mem_test: xcache/xc_mem.c xcache/xc_mem.h util/xc_trace.c util/xc_trace.h
     12    $(CC) $(CFLAGS) -o mem_test xcache/xc_mem.c util/xc_trace.c
    1313   
    1414mem: mem_test
     
    1717clean:
    1818    rm -f $(OBJS) $(EXES)
    19 
    20 leakcheck:
    21     valgrind php -c test.ini test.ini
  • trunk/processor/head.m4

    r994 r998  
    1313#include "util/xc_align.h"
    1414#include "xcache/xc_const_string.h"
    15 #include "xcache/xc_processor.h"
     15#include "xc_processor.h"
    1616#include "xcache_globals.h"
    1717
  • trunk/xcache.c

    r997 r998  
    4545
    4646#include "xcache_globals.h"
    47 #include "xcache/xc_processor.h"
     47#include "xc_processor.h"
    4848#include "xcache/xc_const_string.h"
    4949#include "xcache/xc_opcode_spec.h"
  • trunk/xcache/xc_mem.c

    r989 r998  
    11#ifdef TEST
    2 #include <limits.h>
    3 #include <stdio.h>
     2#   include <limits.h>
     3#   include <stdio.h>
    44#   define XCACHE_DEBUG
     5typedef int zend_bool;
     6#   define ZEND_ATTRIBUTE_PTR_FORMAT(a, b, c)
     7#   define zend_error(type, error) fprintf(stderr, "%s", error)
    58#else
    6 #include <php.h>
     9#   include <php.h>
    710#endif
    811
     
    1821#define XC_MEM_IMPL _xc_mem_mem_t
    1922#include "xc_shm.h"
    20 #include "xc_utils.h"
     23// #include "xc_utils.h"
    2124#include "util/xc_align.h"
    2225#include "util/xc_trace.h"
     
    323326/* {{{ testing */
    324327#undef CHECK
    325 #define CHECK(a, msg) do { if ((a) == NULL) { puts(msg); return -1; } } while (0)
     328#define CHECK(a, msg) do { \
     329    if (!(a)) { \
     330        fprintf(stderr, "%s\n", msg); return -1; \
     331    } \
     332} while (0)
     333
    326334#include <time.h>
    327335
     
    331339    void *p;
    332340    void *memory;
    333     xc_mem_t *mem;
    334341    void **ptrs;
     342    xc_mem_t mem_holder, *mem = &mem_holder;
    335343    int size, i;
    336344
     
    342350#endif
    343351    CHECK(memory = malloc(size), "OOM");
    344     CHECK(ptrs   = malloc(size * sizeof(void*)), "OOM");
    345     CHECK(mem    = xc_mem_init(memory, size), "Failed init memory allocator");
     352    CHECK(ptrs   = malloc(size * sizeof(void *)), "OOM");
     353    CHECK(mem    = xc_mem_init(memory, mem, size), "Failed init memory allocator");
    346354
    347355    while ((p = xc_mem_malloc(mem, 1))) {
     356        fprintf(stderr, "%d %p\n", count, ptrs);
    348357        ptrs[count ++] = p;
    349358    }
  • trunk/xcache/xc_processor.c

    r994 r998  
    1 #include "xc_processor_real.c"
     1#include "../xc_processor.c.h"
Note: See TracChangeset for help on using the changeset viewer.