From 50d32564d2094ef4f359efba3417a9d5ee062864 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 25 Feb 2015 22:23:05 +0800 Subject: [PATCH 1/2] Master is only for PHP5.X now --- config.m4 | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) mode change 100644 => 100755 config.m4 diff --git a/config.m4 b/config.m4 old mode 100644 new mode 100755 index e762900..ac18332 --- a/config.m4 +++ b/config.m4 @@ -1,33 +1,48 @@ dnl $Id: config.m4 321796 2012-01-05 17:23:48Z laruence $ PHP_ARG_WITH(lua, for lua support, [ --with-lua=[DIR] Include php lua support]) +PHP_ARG_WITH(lua-version, to specify a custom lua version, [ --with-lua-version=[VERSION]] Use the specified lua version.) if test "$PHP_LUA" != "no"; then if test -r $PHP_LUA/include/lua.h; then - LUA_DIR=$PHP_LUA + LUA_INCLUDE_DIR=$PHP_LUA/include else AC_MSG_CHECKING(for lua in default path) for i in /usr/local /usr; do if test -r $i/include/lua/lua.h; then - LUA_DIR=$i + LUA_INCLUDE_DIR=$i/include/lua AC_MSG_RESULT(found in $i) break fi + + if test "$PHP_LUA_VERSION" != "yes"; then + if test -r $i/include/lua$PHP_LUA_VERSION/lua.h; then + LUA_INCLUDE_DIR=$i/include/lua$PHP_LUA_VERSION + AC_MSG_RESULT(found in a version-specific subdirectory of $i) + break + fi + fi done fi - if test -z "$LUA_DIR"; then + if test -z "$LUA_INCLUDE_DIR"; then AC_MSG_RESULT(not found) AC_MSG_ERROR(Please reinstall the lua distribution - lua.h should be in /include/) fi - LUA_LIB_NAME=liblua + if test "$PHP_LUA_VERSION" != "yes" -a "$PHP_LUA_VERSION" != "no"; then + LUA_LIB_SUFFIX=lua$PHP_LUA_VERSION + else + LUA_LIB_SUFFIX=lua + fi + + LUA_LIB_NAME=lib$LUA_LIB_SUFFIX if test -r $PHP_LUA/$PHP_LIBDIR/${LUA_LIB_NAME}.${SHLIB_SUFFIX_NAME} -o -r $PHP_LUA/$PHP_LIBDIR/${LUA_LIB_NAME}.a; then LUA_LIB_DIR=$PHP_LUA/$PHP_LIBDIR else AC_MSG_CHECKING(for lua library in default path) - for i in /usr/$PHP_LIBDIR /usr/lib /usr/lib64; do + for i in /usr/$PHP_LIBDIR /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu; do if test -r $i/${LUA_LIB_NAME}.${SHLIB_SUFFIX_NAME} -o -r $i/${LUA_LIB_NAME}.a; then LUA_LIB_DIR=$i AC_MSG_RESULT(found in $i) @@ -41,8 +56,8 @@ if test "$PHP_LUA" != "no"; then AC_MSG_ERROR(Please reinstall the lua distribution - lua library should be in /lib/) fi - PHP_ADD_INCLUDE($LUA_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(lua, $LUA_LIB_DIR, LUA_SHARED_LIBADD) + PHP_ADD_INCLUDE($LUA_INCLUDE_DIR) + PHP_ADD_LIBRARY_WITH_PATH($LUA_LIB_SUFFIX, $LUA_LIB_DIR, LUA_SHARED_LIBADD) PHP_SUBST(LUA_SHARED_LIBADD) PHP_NEW_EXTENSION(lua, lua.c lua_closure.c, $ext_shared) fi From d3323aa9fe7edce269d2ddad92f10a9078fa0927 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 26 Oct 2015 20:54:55 -0700 Subject: [PATCH 2/2] enable travis --- .travis.yml | 26 ++++++++++++++++++++++++++ README | 5 ++++- config.m4 | 1 + travis/compile.sh | 2 ++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100755 travis/compile.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f0c137f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: php + +addons: + apt: + packages: + - liblua5.2-dev + +php: + - 5.3 + - 5.4 + - 5.5 + - 5.6 + +notifications: + email: false + irc: "irc.efnet.org#php.yaf" + +env: + - REPORT_EXIT_STATUS=1 NO_INTERACTION=1 + +#Compile +before_script: + - ./travis/compile.sh + +# Run PHPs run-tests.php +script: make test diff --git a/README b/README index 2825319..387e15f 100644 --- a/README +++ b/README @@ -1,2 +1,5 @@ -"Lua is a powerful, fast, light-weight, embeddable scripting language." +##PHP Lua +====== This extension embeds the lua interpreter and offers an OO-API to lua variables and functions. + +"Lua is a powerful, fast, light-weight, embeddable scripting language." diff --git a/config.m4 b/config.m4 index ac18332..9c9c0ba 100755 --- a/config.m4 +++ b/config.m4 @@ -1,6 +1,7 @@ dnl $Id: config.m4 321796 2012-01-05 17:23:48Z laruence $ PHP_ARG_WITH(lua, for lua support, [ --with-lua=[DIR] Include php lua support]) + PHP_ARG_WITH(lua-version, to specify a custom lua version, [ --with-lua-version=[VERSION]] Use the specified lua version.) if test "$PHP_LUA" != "no"; then diff --git a/travis/compile.sh b/travis/compile.sh new file mode 100755 index 0000000..c6009a8 --- /dev/null +++ b/travis/compile.sh @@ -0,0 +1,2 @@ +#!/bin/sh +phpize && ./configure --with-lua-version=5.2 && make