]> granicus.if.org Git - apache/commitdiff
Add in finding LUA installed via Macports and others
authorJim Jagielski <jim@apache.org>
Wed, 16 Sep 2015 14:42:35 +0000 (14:42 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 16 Sep 2015 14:42:35 +0000 (14:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703417 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/config.m4

index c9567ef0472512d2a4cc46ab01e65e213f96586a..8a778ce136458709ec763b96032f87b6315a3b6e 100644 (file)
@@ -48,6 +48,26 @@ for x in $test_paths ; do
         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_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"
+            if test "x$ap_platform_runtime_link_flag" != "x"; then
+               APR_ADDTO(LUA_LIBS, [$ap_platform_runtime_link_flag$x/lib/lua-5.1])
+            fi
+            LUA_CFLAGS="-I$x/include/lua-5.1"
+            ])
+        CFLAGS=$save_CFLAGS
+        LDFLAGS=$save_LDFLAGS
+        break
+    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_RESULT([yes])
@@ -88,6 +108,29 @@ for x in $test_paths ; do
     else
         AC_MSG_RESULT([no])
     fi
+#
+# Why are we bothering looking for lua 5.2?
+#
+    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.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.2])
+            fi
+            LUA_CFLAGS="-I$x/include/lua-5.2"
+            ])
+        CFLAGS=$save_CFLAGS
+        LDFLAGS=$save_LDFLAGS
+        break
+    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])