You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ki...@apache.org on 2018/01/22 19:19:30 UTC

[trafficserver] branch master updated: Add pkg-config fallback to --enable-system-luajit

This is an automated email from the ASF dual-hosted git repository.

kichan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 0f14434  Add pkg-config fallback to --enable-system-luajit
0f14434 is described below

commit 0f14434c45d2dc85c099e793b820c5f89c021b2f
Author: Linnaea Von Lavia <li...@live.com>
AuthorDate: Wed Dec 27 11:26:01 2017 +0800

    Add pkg-config fallback to --enable-system-luajit
    
    Issue #1507
---
 configure.ac | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index d7f1be0..e4e16a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1200,11 +1200,18 @@ TS_CHECK_LZMA
 if test "x$enable_system_luajit" == "xyes"; then
     saveLIBS=$LIBS
     LIBS=""
-    AC_CHECK_HEADER(lua.h, ,
-                    [AC_MSG_ERROR([*** system luajit requested and lua.h not found ***])])
+    AC_CHECK_HEADER(lua.h, [],
+                    [LUAJIT_PKGCONFIG=1])
     AC_CHECK_LIB(luajit-5.1, luaL_newstate, [],
-                 [AC_MSG_ERROR([*** system luajit requested and libluajit-5.1 not found ***])])
-    AC_SUBST([LIBLUAJIT], [$LIBS])
+                 [LUAJIT_PKGCONFIG=1])
+    if test "x$LUAJIT_PKGCONFIG" != "x"; then
+        PKG_CHECK_MODULES([LUAJIT], [luajit < 2.1.0, luajit >= 2.0.0], [
+            AC_SUBST([LIBLUAJIT], [$LUAJIT_LIBS])
+            TS_ADDTO(AM_CPPFLAGS, [$LUAJIT_CFLAGS])
+        ], [AC_MSG_ERROR([*** system luajit requested but either libluajit-5.1 or lua.h cannot be found ***])])
+    else
+        AC_SUBST([LIBLUAJIT], [$LIBS])
+    fi
     LIBS=$saveLIBS
 fi
 

-- 
To stop receiving notification emails like this one, please contact
kichan@apache.org.