httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1706533 - /httpd/httpd/trunk/modules/lua/config.m4
Date Sat, 03 Oct 2015 09:45:21 GMT
Author: humbedooh
Date: Sat Oct  3 09:45:20 2015
New Revision: 1706533

URL: http://svn.apache.org/viewvc?rev=1706533&view=rev
Log:
Turn 5.1/5.2 order upside down, simplify. This should also (AFAIK) work with Ubuntu/Debian,
which has previously been known to fail to compile mod_lua.so

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=1706533&r1=1706532&r2=1706533&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/config.m4 (original)
+++ httpd/httpd/trunk/modules/lua/config.m4 Sat Oct  3 09:45:20 2015
@@ -1,7 +1,7 @@
 
 APACHE_MODPATH_INIT(lua)
 
-dnl Check for Lua 5.1/5.2 Libraries
+dnl Check for Lua 5.2/5.1 Libraries
 dnl CHECK_LUA(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 dnl Sets:
 dnl  LUA_CFLAGS
@@ -11,7 +11,7 @@ AC_DEFUN([CHECK_LUA],
 
 AC_ARG_WITH(
     lua,
-    [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.1/5.2 prefix])],
+    [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.2/5.1 prefix])],
     lua_path="$withval",
     :)
 
@@ -25,42 +25,19 @@ fi
 AC_CHECK_LIB(m, pow, lib_m="-lm")
 AC_CHECK_LIB(m, sqrt, lib_m="-lm")
 for x in $test_paths ; do
-  if test "x$x" = "x."; then
-    AC_CHECK_HEADER(lua.h,[
-        save_CFLAGS=$CFLAGS
-        save_LDFLAGS=$LDFLAGS
-        CFLAGS="$CFLAGS"
-        LDFLAGS="$LDFLAGS $lib_m"
-        AC_CHECK_LIB(lua5.1, luaL_newstate, [
-            LUA_LIBS="-llua5.1 $lib_m"
-        ],[
-            AC_CHECK_LIB(lua-5.1, luaL_newstate, [
-                LUA_LIBS="-llua-5.1 $lib_m"
-            ],[
-                AC_CHECK_LIB(lua, luaL_newstate, [
-                    LUA_LIBS="-llua $lib_m"
-                ])
-            ])
-        ])
-        LUA_CFLAGS=
-        CFLAGS=$save_CFLAGS
-        LDFLAGS=$save_LDFLAGS
-        break
-    ])
-  else
-    AC_MSG_CHECKING([for lua.h in ${x}/include/lua-5.1])
-    if test -f ${x}/include/lua-5.1/lua.h; then
+    AC_MSG_CHECKING([for lua.h in ${x}/include/lua-5.2])
+    if test -f ${x}/include/lua-5.2/lua.h; then
         AC_MSG_RESULT([yes])
         save_CFLAGS=$CFLAGS
         save_LDFLAGS=$LDFLAGS
         CFLAGS="$CFLAGS"
-        LDFLAGS="-L$x/lib/lua-5.1 $LDFLAGS $lib_m"
-        AC_CHECK_LIB(lua-5.1, luaL_newstate, [
-            LUA_LIBS="-L$x/lib/lua-5.1 -llua-5.1 $lib_m"
+        LDFLAGS="-L$x/lib/lua-5.2 $LDFLAGS $lib_m"
+        AC_CHECK_LIB(lua-5.2, luaL_newstate, [
+            LUA_LIBS="-L$x/lib/lua-5.2 -llua-5.2 $lib_m"
             if test "x$ap_platform_runtime_link_flag" != "x"; then
-               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua-5.1])
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua-5.2])
             fi
-            LUA_CFLAGS="-I$x/include/lua-5.1"
+            LUA_CFLAGS="-I$x/include/lua-5.2"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -68,19 +45,19 @@ for x in $test_paths ; do
     else
         AC_MSG_RESULT([no])
     fi
-    AC_MSG_CHECKING([for lua.h in ${x}/include/lua5.1])
-    if test -f ${x}/include/lua5.1/lua.h; then
+    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.1, luaL_newstate, [
-            LUA_LIBS="-L$x/lib -llua5.1 $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.1"
+            LUA_CFLAGS="-I$x/include/lua5.2"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -88,19 +65,19 @@ for x in $test_paths ; do
     else
         AC_MSG_RESULT([no])
     fi
-    AC_MSG_CHECKING([for lua.h in ${x}/include/lua51])
-    if test -f ${x}/include/lua51/lua.h; then
+    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/lua51 $LDFLAGS $lib_m"
+        LDFLAGS="-L$x/lib/lua52 $LDFLAGS $lib_m"
         AC_CHECK_LIB(lua, luaL_newstate, [
-            LUA_LIBS="-L$x/lib/lua51 -llua $lib_m"
+            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/lua51])
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua52])
             fi
-            LUA_CFLAGS="-I$x/include/lua51"
+            LUA_CFLAGS="-I$x/include/lua52"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -108,22 +85,19 @@ for x in $test_paths ; do
     else
         AC_MSG_RESULT([no])
     fi
-#
-# Shouldn't we look for 5.2 first??
-#
-    AC_MSG_CHECKING([for lua.h in ${x}/include/lua-5.2])
-    if test -f ${x}/include/lua-5.2/lua.h; then
+    AC_MSG_CHECKING([for lua.h in ${x}/include])
+    if test -f ${x}/include/lua.h; then
         AC_MSG_RESULT([yes])
         save_CFLAGS=$CFLAGS
         save_LDFLAGS=$LDFLAGS
         CFLAGS="$CFLAGS"
-        LDFLAGS="-L$x/lib/lua-5.2 $LDFLAGS $lib_m"
-        AC_CHECK_LIB(lua-5.2, luaL_newstate, [
-            LUA_LIBS="-L$x/lib/lua-5.2 -llua-5.2 $lib_m"
+        LDFLAGS="-L$x/lib $LDFLAGS $lib_m"
+        AC_CHECK_LIB(lua, luaL_newstate, [
+            LUA_LIBS="-L$x/lib -llua $lib_m"
             if test "x$ap_platform_runtime_link_flag" != "x"; then
-               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua-5.2])
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib])
             fi
-            LUA_CFLAGS="-I$x/include/lua-5.2"
+            LUA_CFLAGS="-I$x/include"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -131,19 +105,20 @@ 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_CHECKING([for lua.h in ${x}/include/lua-5.1])
+    if test -f ${x}/include/lua-5.1/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"
+        LDFLAGS="-L$x/lib/lua-5.1 $LDFLAGS $lib_m"
+        AC_CHECK_LIB(lua-5.1, luaL_newstate, [
+            LUA_LIBS="-L$x/lib/lua-5.1 -llua-5.1 $lib_m"
             if test "x$ap_platform_runtime_link_flag" != "x"; then
-               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib])
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua-5.1])
             fi
-            LUA_CFLAGS="-I$x/include/lua5.2"
+            LUA_CFLAGS="-I$x/include/lua-5.1"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -151,19 +126,19 @@ for x in $test_paths ; do
     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_CHECKING([for lua.h in ${x}/include/lua5.1])
+    if test -f ${x}/include/lua5.1/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"
+        LDFLAGS="-L$x/lib $LDFLAGS $lib_m"
+        AC_CHECK_LIB(lua5.1, luaL_newstate, [
+            LUA_LIBS="-L$x/lib -llua5.1 $lib_m"
             if test "x$ap_platform_runtime_link_flag" != "x"; then
-               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua52])
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib])
             fi
-            LUA_CFLAGS="-I$x/include/lua52"
+            LUA_CFLAGS="-I$x/include/lua5.1"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -171,19 +146,19 @@ for x in $test_paths ; do
     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_CHECKING([for lua.h in ${x}/include/lua51])
+    if test -f ${x}/include/lua51/lua.h; then
         AC_MSG_RESULT([yes])
         save_CFLAGS=$CFLAGS
         save_LDFLAGS=$LDFLAGS
         CFLAGS="$CFLAGS"
-        LDFLAGS="-L$x/lib $LDFLAGS $lib_m"
+        LDFLAGS="-L$x/lib/lua51 $LDFLAGS $lib_m"
         AC_CHECK_LIB(lua, luaL_newstate, [
-            LUA_LIBS="-L$x/lib -llua $lib_m"
+            LUA_LIBS="-L$x/lib/lua51 -llua $lib_m"
             if test "x$ap_platform_runtime_link_flag" != "x"; then
-               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib])
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua51])
             fi
-            LUA_CFLAGS="-I$x/include"
+            LUA_CFLAGS="-I$x/include/lua51"
             ])
         CFLAGS=$save_CFLAGS
         LDFLAGS=$save_LDFLAGS
@@ -191,20 +166,19 @@ for x in $test_paths ; do
     else
         AC_MSG_RESULT([no])
     fi
-  fi
 done
 
 AC_SUBST(LUA_LIBS)
 AC_SUBST(LUA_CFLAGS)
 
 if test -z "${LUA_LIBS}"; then
-  AC_MSG_WARN([*** Lua 5.1 or 5.2 library not found.])
+  AC_MSG_WARN([*** Lua 5.2 or 5.1 library not found.])
   ifelse([$2], ,
     enable_lua="no"
     if test -z "${lua_path}"; then
-        AC_MSG_WARN([Lua 5.1 or 5.2 library is required])
+        AC_MSG_WARN([Lua 5.2 or 5.1 library is required])
     else
-        AC_MSG_ERROR([Lua 5.1 or 5.2 library is required])
+        AC_MSG_ERROR([Lua 5.2 or 5.1 library is required])
     fi,
     $2)
 else



Mime
View raw message