httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1560038 - /httpd/httpd/trunk/modules/lua/config.m4
Date Tue, 21 Jan 2014 14:59:30 GMT
Author: humbedooh
Date: Tue Jan 21 14:59:29 2014
New Revision: 1560038

URL: http://svn.apache.org/r1560038
Log:
mod_lua: Also check for 5.2 headers/libraries, we support both 5.1 and 5.2 nowadays.

Modified:
    httpd/httpd/trunk/modules/lua/config.m4

Modified: httpd/httpd/trunk/modules/lua/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/config.m4?rev=1560038&r1=1560037&r2=1560038&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/config.m4 (original)
+++ httpd/httpd/trunk/modules/lua/config.m4 Tue Jan 21 14:59:29 2014
@@ -11,7 +11,7 @@ AC_DEFUN([CHECK_LUA],
 
 AC_ARG_WITH(
     lua,
-    [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.1 prefix])],
+    [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.1/5.2 prefix])],
     lua_path="$withval",
     :)
 
@@ -88,6 +88,46 @@ for x in $test_paths ; do
     else
         AC_MSG_RESULT([no])
     fi
+    AC_MSG_CHECKING([for lua.h in ${x}/include/lua5.2])
+    if test -f ${x}/include/lua5.2/lua.h; then
+        AC_MSG_RESULT([yes])
+        save_CFLAGS=$CFLAGS
+        save_LDFLAGS=$LDFLAGS
+        CFLAGS="$CFLAGS"
+        LDFLAGS="-L$x/lib $LDFLAGS $lib_m"
+        AC_CHECK_LIB(lua5.2, luaL_newstate, [
+            LUA_LIBS="-L$x/lib -llua5.2 $lib_m"
+            if test "x$ap_platform_runtime_link_flag" != "x"; then
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib])
+            fi
+            LUA_CFLAGS="-I$x/include/lua5.2"
+            ])
+        CFLAGS=$save_CFLAGS
+        LDFLAGS=$save_LDFLAGS
+        break
+    else
+        AC_MSG_RESULT([no])
+    fi
+    AC_MSG_CHECKING([for lua.h in ${x}/include/lua52])
+    if test -f ${x}/include/lua52/lua.h; then
+        AC_MSG_RESULT([yes])
+        save_CFLAGS=$CFLAGS
+        save_LDFLAGS=$LDFLAGS
+        CFLAGS="$CFLAGS"
+        LDFLAGS="-L$x/lib/lua52 $LDFLAGS $lib_m"
+        AC_CHECK_LIB(lua, luaL_newstate, [
+            LUA_LIBS="-L$x/lib/lua52 -llua $lib_m"
+            if test "x$ap_platform_runtime_link_flag" != "x"; then
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua52])
+            fi
+            LUA_CFLAGS="-I$x/include/lua52"
+            ])
+        CFLAGS=$save_CFLAGS
+        LDFLAGS=$save_LDFLAGS
+        break
+    else
+        AC_MSG_RESULT([no])
+    fi
     AC_MSG_CHECKING([for lua.h in ${x}/include])
     if test -f ${x}/include/lua.h; then
         AC_MSG_RESULT([yes])



Mime
View raw message