From d416d9b59b1436736ee558a2dbe1d6d2701a62e9 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Sat, 12 Oct 2013 01:07:34 -0400 Subject: [PATCH 1/2] Support g++-4.6 in configuration script. gcc 4.6 doesn't have the -std=c++11 option, it uses the not-yet-finalized -std=c++0x option. Use whichever is found to be appropriate at configure time. --- config.m4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index 623a475..62ea670 100644 --- a/config.m4 +++ b/config.m4 @@ -75,8 +75,18 @@ CPPFLAGS=$old_CPPFLAGS else AC_MSG_ERROR([could not determine libv8 version]) fi + + AC_CACHE_CHECK(for C standard version, ac_cv_v8_cstd, [ + ac_cv_v8_cstd="c++11" + old_CPPFLAGS=$CPPFLAGS + AC_LANG_PUSH([C++]) + CPPFLAGS="-std="$ac_cv_v8_cstd + AC_TRY_RUN([int main() { return 0; }],[],[ac_cv_v8_cstd="c++0x"],[]) + AC_LANG_POP([C++]) + CPPFLAGS=$old_CPPFLAGS + ]); - PHP_NEW_EXTENSION(v8js, v8js.cc v8js_convert.cc v8js_methods.cc v8js_variables.cc v8js_commonjs.cc, $ext_shared, , "-std=c++11") + PHP_NEW_EXTENSION(v8js, v8js.cc v8js_convert.cc v8js_methods.cc v8js_variables.cc v8js_commonjs.cc, $ext_shared, , "-std="$ac_cv_v8_cstd) PHP_ADD_MAKEFILE_FRAGMENT fi From d75fc4a142fb82bcb349ab0fd089415ead37de06 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 11 Oct 2013 23:58:32 -0400 Subject: [PATCH 2/2] Hookup Travis continous integration test server. --- .travis.yml | 5 +++++ Makefile.travis | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .travis.yml create mode 100644 Makefile.travis diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bf99098 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: cpp +compiler: gcc +before_install: make -f Makefile.travis before_install +install: make -f Makefile.travis install +script: make -f Makefile.travis test diff --git a/Makefile.travis b/Makefile.travis new file mode 100644 index 0000000..bd70c20 --- /dev/null +++ b/Makefile.travis @@ -0,0 +1,31 @@ +# Configure and build scripts for travis CI system +V8VER=3.22.10 +CPPVER=4.6 + +export CXX=g++-$(CPPVER) +export LINK=g++-$(CPPVER) + +export NO_INTERACTION=1 + +before_install: + sudo apt-get update + +# install dependencies (php5, v8) +install: + sudo apt-get install php5-cli php5-dev g++-$(CPPVER) + -$(RM) -rf $(V8VER).tar.gz v8-$(V8VER) v8-build + wget https://github.com/v8/v8/archive/$(V8VER).tar.gz + tar -xzf $(V8VER).tar.gz + $(MAKE) -C v8-$(V8VER) dependencies + $(MAKE) -C v8-$(V8VER) native library=shared -j4 + mkdir -p v8-build/lib v8-build/include + cp v8-$(V8VER)/out/native/lib.target/lib*.so v8-build/lib/ + cp v8-$(V8VER)/include/v8* v8-build/include/ + +build: + phpize + ./configure --with-v8js=$(realpath ./v8-build) + $(MAKE) + +test: build + $(MAKE) test