You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/03/18 07:36:30 UTC

[1/4] thrift git commit: THRIFT-3747 Duplicate node.js build on Travis-CI

Repository: thrift
Updated Branches:
  refs/heads/master 55499b880 -> a4f964032


THRIFT-3747 Duplicate node.js build on Travis-CI

This closes #953


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6505312e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6505312e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6505312e

Branch: refs/heads/master
Commit: 6505312e0ad23795f84161db190b5a426fff6b42
Parents: 55499b8
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Fri Mar 18 02:50:06 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Fri Mar 18 04:40:16 2016 +0900

----------------------------------------------------------------------
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/6505312e/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 8b70889..33a32d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -68,7 +68,7 @@ env:
 
     - TEST_NAME="Java Lua Perl PHP Python Ruby Dart (automake)"
       BUILD_CMD="../autotools.sh"
-      BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe"
+      BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe --without-nodejs"
 
     # These are flaky (due to cabal and npm network/server failures) and also have lengthy output
     - TEST_NAME="Haskell Node.js (automake)"


[2/4] thrift git commit: THRIFT-3736 C++ library build fails if OpenSSL does not surrpot SSLv3

Posted by ns...@apache.org.
THRIFT-3736 C++ library build fails if OpenSSL does not surrpot SSLv3

This closes #944


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/b819260c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/b819260c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/b819260c

Branch: refs/heads/master
Commit: b819260c653f6fd9602419ee2541060ecb930c4c
Parents: 6505312
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Sun Mar 13 08:55:38 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Fri Mar 18 04:40:35 2016 +0900

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/TSSLSocket.cpp | 2 ++
 lib/cpp/test/SecurityTest.cpp               | 8 ++++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/b819260c/lib/cpp/src/thrift/transport/TSSLSocket.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index bd13160..517151f 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -151,8 +151,10 @@ static char uppercase(char c);
 SSLContext::SSLContext(const SSLProtocol& protocol) {
   if (protocol == SSLTLS) {
     ctx_ = SSL_CTX_new(SSLv23_method());
+#ifndef OPENSSL_NO_SSL3
   } else if (protocol == SSLv3) {
     ctx_ = SSL_CTX_new(SSLv3_method());
+#endif
   } else if (protocol == TLSv1_0) {
     ctx_ = SSL_CTX_new(TLSv1_method());
   } else if (protocol == TLSv1_1) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/b819260c/lib/cpp/test/SecurityTest.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/test/SecurityTest.cpp b/lib/cpp/test/SecurityTest.cpp
index 9968e2c..23650d6 100644
--- a/lib/cpp/test/SecurityTest.cpp
+++ b/lib/cpp/test/SecurityTest.cpp
@@ -240,6 +240,14 @@ BOOST_AUTO_TEST_CASE(ssl_security_matrix)
                     continue;
                 }
 
+#ifdef OPENSSL_NO_SSL3
+                if (si == 2 || ci == 2)
+                {
+                    // Skip all SSLv3 cases - protocol not supported
+                    continue;
+                }
+#endif
+
                 boost::mutex::scoped_lock lock(mMutex);
 
                 BOOST_TEST_MESSAGE(boost::format("TEST: Server = %1%, Client = %2%")


[3/4] thrift git commit: THRIFT-3728 http transport for thrift-lua

Posted by ns...@apache.org.
THRIFT-3728 http transport for thrift-lua

This closes #938


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/e432c6b8
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/e432c6b8
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/e432c6b8

Branch: refs/heads/master
Commit: e432c6b828d70ee4901f1ec3e04b0145da2ce54e
Parents: b819260
Author: Wang Yaofu <vo...@sina.cn>
Authored: Wed Mar 9 16:39:03 2016 +0800
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Fri Mar 18 04:40:46 2016 +0900

----------------------------------------------------------------------
 lib/lua/THttpTransport.lua     | 182 ++++++++++++++++++++++++++++++++++++
 lib/lua/TServer.lua            |  11 ++-
 test/lua/test_basic_client.lua |   5 +-
 test/lua/test_basic_server.lua |   2 +
 test/tests.json                |   3 +-
 5 files changed, 196 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/e432c6b8/lib/lua/THttpTransport.lua
----------------------------------------------------------------------
diff --git a/lib/lua/THttpTransport.lua b/lib/lua/THttpTransport.lua
new file mode 100644
index 0000000..5bbfece
--- /dev/null
+++ b/lib/lua/THttpTransport.lua
@@ -0,0 +1,182 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+--
+
+require 'TTransport'
+
+THttpTransport = TTransportBase:new{
+  __type = 'THttpTransport',
+  path = '/',
+  wBuf = '',
+  rBuf = '',
+  CRLF = '\r\n',
+  VERSION = '1.0.0',
+  isServer = true
+}
+
+function THttpTransport:new(obj)
+  if ttype(obj) ~= 'table' then
+    error(ttype(self) .. 'must be initialized with a table')
+  end
+
+  -- Ensure a transport is provided
+  if not obj.trans then
+    error('You must provide ' .. ttype(self) .. ' with a trans')
+  end
+
+  return TTransportBase.new(self, obj)
+end
+
+function THttpTransport:isOpen()
+  return self.trans:isOpen()
+end
+
+function THttpTransport:open()
+  return self.trans:open()
+end
+
+function THttpTransport:close()
+  return self.trans:close()
+end
+
+function THttpTransport:readAll(len)
+  return self:read(len)
+end
+
+function THttpTransport:read(len)
+  if string.len(self.rBuf) == 0 then
+    self:_readMsg()
+  end
+  if len > string.len(self.rBuf) then
+    local val = self.rBuf
+    self.rBuf = ''
+    return val
+  end
+
+  local val = string.sub(self.rBuf, 0, len)
+  self.rBuf = string.sub(self.rBuf, len+1)
+  return val
+end
+
+function THttpTransport:_readMsg()
+  while true do
+    self.rBuf = self.rBuf .. self.trans:read(4)
+    if string.find(self.rBuf, self.CRLF .. self.CRLF) then
+      break
+    end
+  end
+  if not self.rBuf then
+    self.rBuf = ""
+    return
+  end
+  self:getLine()
+  local headers = self:_parseHeaders()
+  if not headers then
+    self.rBuf = ""
+    return
+  end
+
+  local length = tonumber(headers["Content-Length"])
+  if length then
+    length = length - string.len(self.rBuf)
+    self.rBuf = self.rBuf .. self.trans:readAll(length)
+  end
+  if self.rBuf == nil then
+    self.rBuf = ""
+  end
+end
+
+function THttpTransport:getLine()
+  local a,b = string.find(self.rBuf, self.CRLF)
+  local line = ""
+  if a and b then
+    line = string.sub(self.rBuf, 0, a-1)
+    self.rBuf = string.sub(self.rBuf, b+1)
+  end
+  return line
+end
+
+function THttpTransport:_parseHeaders()
+  local headers = {}
+
+  repeat
+    local line = self:getLine()
+    for key, val in string.gmatch(line, "([%w%-]+)%s*:%s*(.+)") do
+      if headers[key] then
+        local delimiter = ", "
+        if key == "Set-Cookie" then
+          delimiter = "; "
+        end
+        headers[key] = headers[key] .. delimiter .. tostring(val)
+      else
+        headers[key] = tostring(val)
+      end
+    end
+  until string.find(line, "^%s*$")
+
+  return headers
+end
+
+function THttpTransport:write(buf, len)
+  if len and len < string.len(buf) then
+    buf = string.sub(buf, 0, len)
+  end
+  self.wBuf = self.wBuf .. buf
+end
+
+function THttpTransport:writeHttpHeader(content_len)
+  if self.isServer then
+    local header =  "HTTP/1.1 200 OK" .. self.CRLF
+      .. "Server: Thrift/" .. self.VERSION .. self.CRLF
+      .. "Access-Control-Allow-Origin: *" .. self.CRLF
+      .. "Content-Type: application/x-thrift" .. self.CRLF
+      .. "Content-Length: " .. content_len .. self.CRLF
+      .. "Connection: Keep-Alive" .. self.CRLF .. self.CRLF
+    self.trans:write(header)
+  else
+    local header = "POST " .. self.path .. " HTTP/1.1" .. self.CRLF
+      .. "Host: " .. self.trans.host .. self.CRLF
+      .. "Content-Type: application/x-thrift" .. self.CRLF
+      .. "Content-Length: " .. content_len .. self.CRLF
+      .. "Accept: application/x-thrift " .. self.CRLF
+      .. "User-Agent: Thrift/" .. self.VERSION .. " (Lua/THttpClient)"
+      .. self.CRLF .. self.CRLF
+    self.trans:write(header)
+  end
+end
+
+function THttpTransport:flush()
+  -- If the write fails we still want wBuf to be clear
+  local tmp = self.wBuf
+  self.wBuf = ''
+  self:writeHttpHeader(string.len(tmp))
+  self.trans:write(tmp)
+  self.trans:flush()
+end
+
+THttpTransportFactory = TTransportFactoryBase:new{
+  __type = 'THttpTransportFactory'
+}
+function THttpTransportFactory:getTransport(trans)
+  if not trans then
+    terror(TProtocolException:new{
+      message = 'Must supply a transport to ' .. ttype(self)
+    })
+  end
+  return THttpTransport:new{trans = trans}
+end

http://git-wip-us.apache.org/repos/asf/thrift/blob/e432c6b8/lib/lua/TServer.lua
----------------------------------------------------------------------
diff --git a/lib/lua/TServer.lua b/lib/lua/TServer.lua
index d6b9cd0..4e37d58 100644
--- a/lib/lua/TServer.lua
+++ b/lib/lua/TServer.lua
@@ -93,15 +93,16 @@ end
 
 function TServer:serve() end
 function TServer:handle(client)
-  local itrans, otrans, iprot, oprot, ret, err =
+  local itrans, otrans =
     self.inputTransportFactory:getTransport(client),
-    self.outputTransportFactory:getTransport(client),
-    self.inputProtocolFactory:getProtocol(client),
-    self.outputProtocolFactory:getProtocol(client)
+    self.outputTransportFactory:getTransport(client)
+  local iprot, oprot =
+    self.inputProtocolFactory:getProtocol(itrans),
+    self.outputProtocolFactory:getProtocol(otrans)
 
   self:_clientBegin(iprot, oprot)
   while true do
-    ret, err = pcall(self.processor.process, self.processor, iprot, oprot)
+    local ret, err = pcall(self.processor.process, self.processor, iprot, oprot)
     if ret == false and err then
       if not string.find(err, "TTransportException") then
         self:_handleException(err)

http://git-wip-us.apache.org/repos/asf/thrift/blob/e432c6b8/test/lua/test_basic_client.lua
----------------------------------------------------------------------
diff --git a/test/lua/test_basic_client.lua b/test/lua/test_basic_client.lua
index fea426d..77d8d07 100644
--- a/test/lua/test_basic_client.lua
+++ b/test/lua/test_basic_client.lua
@@ -19,6 +19,7 @@
 require('TSocket')
 require('TBufferedTransport')
 require('TFramedTransport')
+require('THttpTransport')
 require('TCompactProtocol')
 require('TJsonProtocol')
 require('TBinaryProtocol')
@@ -65,10 +66,12 @@ function testBasicClient(rawArgs)
   local transports = {
     buffered = TBufferedTransport,
     framed = TFramedTransport,
+    http = THttpTransport,
   }
   assert(transports[opt.transport] ~= nil)
   local transport = transports[opt.transport]:new{
-    trans = socket
+    trans = socket,
+    isServer = false
   }
 
   local protocols = {

http://git-wip-us.apache.org/repos/asf/thrift/blob/e432c6b8/test/lua/test_basic_server.lua
----------------------------------------------------------------------
diff --git a/test/lua/test_basic_server.lua b/test/lua/test_basic_server.lua
index 864b63d..acd2d79 100644
--- a/test/lua/test_basic_server.lua
+++ b/test/lua/test_basic_server.lua
@@ -19,6 +19,7 @@ require('ThriftTest_ThriftTest')
 require('TSocket')
 require('TBufferedTransport')
 require('TFramedTransport')
+require('THttpTransport')
 require('TCompactProtocol')
 require('TJsonProtocol')
 require('TBinaryProtocol')
@@ -111,6 +112,7 @@ function testBasicServer(rawArgs)
   local transports = {
     buffered = TBufferedTransportFactory,
     framed = TFramedTransportFactory,
+    http = THttpTransportFactory,
   }
   assert(transports[opt.transport], 'Failed to create framed transport factory')
   local trans_factory = transports[opt.transport]:new{}

http://git-wip-us.apache.org/repos/asf/thrift/blob/e432c6b8/test/tests.json
----------------------------------------------------------------------
diff --git a/test/tests.json b/test/tests.json
index c9f357a..3938c57 100644
--- a/test/tests.json
+++ b/test/tests.json
@@ -523,7 +523,8 @@
       "timeout": 5,
       "transports": [
         "buffered",
-        "framed"
+        "framed",
+        "http"
       ],
       "sockets": [
         "ip"


[4/4] thrift git commit: THRIFT-3723 Fix Lua include path

Posted by ns...@apache.org.
THRIFT-3723 Fix Lua include path

This closes #934


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/a4f96403
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/a4f96403
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/a4f96403

Branch: refs/heads/master
Commit: a4f96403210566bd1e76fee9b6e40412ff014e0a
Parents: e432c6b
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Wed Mar 9 19:58:18 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Fri Mar 18 15:25:59 2016 +0900

----------------------------------------------------------------------
 aclocal/ax_lua.m4   | 33 +++++++++++++++++----------------
 lib/lua/Makefile.am | 21 ++++++++++++---------
 2 files changed, 29 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/a4f96403/aclocal/ax_lua.m4
----------------------------------------------------------------------
diff --git a/aclocal/ax_lua.m4 b/aclocal/ax_lua.m4
index 1553491..9feb352 100644
--- a/aclocal/ax_lua.m4
+++ b/aclocal/ax_lua.m4
@@ -18,8 +18,8 @@
 #   Also detect Lua headers and libraries. The Lua version contained in the
 #   header is checked to match the Lua interpreter version exactly. When
 #   searching for Lua libraries, the version number is used as a suffix.
-#   This is done with the goal of supporting multiple Lua installs (5.1 and
-#   5.2 side-by-side).
+#   This is done with the goal of supporting multiple Lua installs (5.1,
+#   5.2, and 5.3 side-by-side).
 #
 #   A note on compatibility with previous versions: This file has been
 #   mostly rewritten for serial 18. Most developers should be able to use
@@ -51,7 +51,7 @@
 #
 #   If MINIMUM-VERSION is supplied, then only Lua interpreters with a
 #   version number greater or equal to MINIMUM-VERSION will be accepted. If
-#   TOO-BIG- VERSION is also supplied, then only Lua interpreters with a
+#   TOO-BIG-VERSION is also supplied, then only Lua interpreters with a
 #   version number greater or equal to MINIMUM-VERSION and less than
 #   TOO-BIG-VERSION will be accepted.
 #
@@ -66,12 +66,13 @@
 #     luaexecdir         Directory to install Lua modules.
 #     pkgluaexecdir      $luaexecdir/$PACKAGE
 #
-#   These paths a found based on $prefix, $exec_prefix, Lua's package.path,
-#   and package.cpath. The first path of package.path beginning with $prefix
-#   is selected as luadir. The first path of package.cpath beginning with
-#   $exec_prefix is used as luaexecdir. This should work on all reasonable
-#   Lua installations. If a path cannot be determined, a default path is
-#   used. Of course, the user can override these later when invoking make.
+#   These paths are found based on $prefix, $exec_prefix, Lua's
+#   package.path, and package.cpath. The first path of package.path
+#   beginning with $prefix is selected as luadir. The first path of
+#   package.cpath beginning with $exec_prefix is used as luaexecdir. This
+#   should work on all reasonable Lua installations. If a path cannot be
+#   determined, a default path is used. Of course, the user can override
+#   these later when invoking make.
 #
 #     luadir             Default: $prefix/share/lua/$LUA_VERSION
 #     luaexecdir         Default: $exec_prefix/lib/lua/$LUA_VERSION
@@ -151,7 +152,7 @@
 #
 # LICENSE
 #
-#   Copyright (c) 2014 Reuben Thomas <rr...@sc3d.org>
+#   Copyright (c) 2015 Reuben Thomas <rr...@sc3d.org>
 #   Copyright (c) 2014 Tim Perkins <tp...@gmail.com>
 #
 #   This program is free software: you can redistribute it and/or modify it
@@ -180,7 +181,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 36
+#serial 39
 
 dnl =========================================================================
 dnl AX_PROG_LUA([MINIMUM-VERSION], [TOO-BIG-VERSION],
@@ -197,7 +198,7 @@ AC_DEFUN([AX_PROG_LUA],
 
   dnl Find a Lua interpreter.
   m4_define_default([_AX_LUA_INTERPRETER_LIST],
-    [lua lua5.2 lua52 lua5.1 lua51 lua50])
+    [lua lua5.3 lua53 lua5.2 lua52 lua5.1 lua51 lua50])
 
   m4_if([$1], [],
   [ dnl No version check is needed. Find any Lua interpreter.
@@ -304,7 +305,7 @@ AC_DEFUN([AX_PROG_LUA],
         ax_cv_lua_luadir="$LUA_PREFIX/share/lua/$LUA_VERSION"
 
         dnl Try to find a path with the prefix.
-        _AX_LUA_FND_PRFX_PTH([$LUA], [$ax_lua_prefix], [package.path])
+        _AX_LUA_FND_PRFX_PTH([$LUA], [$ax_lua_prefix], [script])
         AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
         [ dnl Fix the prefix.
           _ax_strip_prefix=`echo "$ax_lua_prefix" | $SED 's|.|.|g'`
@@ -331,7 +332,7 @@ AC_DEFUN([AX_PROG_LUA],
 
         dnl Try to find a path with the prefix.
         _AX_LUA_FND_PRFX_PTH([$LUA],
-          [$ax_lua_exec_prefix], [package.cpath])
+          [$ax_lua_exec_prefix], [module])
         AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
         [ dnl Fix the prefix.
           _ax_strip_prefix=`echo "$ax_lua_exec_prefix" | $SED 's|.|.|g'`
@@ -415,7 +416,7 @@ AC_DEFUN([_AX_LUA_FND_PRFX_PTH],
 [
   dnl Get the script or module directory by querying the Lua interpreter,
   dnl filtering on the given prefix, and selecting the shallowest path. If no
-  dnl path  is found matching the prefix, the result will be an empty string.
+  dnl path is found matching the prefix, the result will be an empty string.
   dnl The third argument determines the type of search, it can be 'script' or
   dnl 'module'. Supplying 'script' will perform the search with package.path
   dnl and LUA_PATH, and supplying 'module' will search with package.cpath and
@@ -431,7 +432,7 @@ AC_DEFUN([_AX_LUA_FND_PRFX_PTH],
       paths = (package and package.cpath) or LUA_CPATH
     end
     -- search for the prefix
-    local prefix = "$2"
+    local prefix = "'$2'"
     local minpath = ""
     local mindepth = 1e9
     string.gsub(paths, "(@<:@^;@:>@+)",

http://git-wip-us.apache.org/repos/asf/thrift/blob/a4f96403/lib/lua/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/lua/Makefile.am b/lib/lua/Makefile.am
index 4e7f472..588fb58 100644
--- a/lib/lua/Makefile.am
+++ b/lib/lua/Makefile.am
@@ -33,26 +33,29 @@ libluasocket_la_SOURCES = \
 
 nobase_include_HEADERS = src/socket.h
 
-libluasocket_la_CPPFLAGS = $(AM_CPPFLAGS) -I/usr/include/lua5.2 -DLUA_COMPAT_MODULE
-libluasocket_la_LDFLAGS = $(AM_LDFLAGS) $(LUA_LIB) -lm
+libluasocket_la_CPPFLAGS = $(AM_CPPFLAGS) $(LUA_INCLUDE) -DLUA_COMPAT_MODULE
+libluasocket_la_LDFLAGS = $(AM_LDFLAGS)
+libluasocket_la_LIBADD = $(LUA_LIB) -lm
 
 libluabpack_la_SOURCES = src/luabpack.c
 
-libluabpack_la_CPPFLAGS = $(AM_CPPFLAGS) -I/usr/include/lua5.2 -DLUA_COMPAT_MODULE
-libluabpack_la_LDFLAGS = $(AM_LDFLAGS) $(LUA_LIB) -lm
-libluabpack_la_LIBADD = liblualongnumber.la
+libluabpack_la_CPPFLAGS = $(AM_CPPFLAGS) $(LUA_INCLUDE) -DLUA_COMPAT_MODULE
+libluabpack_la_LDFLAGS = $(AM_LDFLAGS)
+libluabpack_la_LIBADD = liblualongnumber.la $(LUA_LIB) -lm
 
 libluabitwise_la_SOURCES = src/luabitwise.c
 
-libluabitwise_la_CPPFLAGS = $(AM_CPPFLAGS) -I/usr/include/lua5.2 -DLUA_COMPAT_MODULE
-libluabitwise_la_LDFLAGS = $(AM_LDFLAGS) $(LUA_LIB) -lm
+libluabitwise_la_CPPFLAGS = $(AM_CPPFLAGS) $(LUA_INCLUDE) -DLUA_COMPAT_MODULE
+libluabitwise_la_LDFLAGS = $(AM_LDFLAGS)
+libluabitwise_la_LIBADD = $(LUA_LIB) -lm
 
 liblualongnumber_la_SOURCES = \
 		src/lualongnumber.c \
 		src/longnumberutils.c
 
-liblualongnumber_la_CPPFLAGS = $(AM_CPPFLAGS) -I/usr/include/lua5.2 -DLUA_COMPAT_MODULE
-liblualongnumber_la_LDFLAGS = $(AM_LDFLAGS) $(LUA_LIB) -lm
+liblualongnumber_la_CPPFLAGS = $(AM_CPPFLAGS) $(LUA_INCLUDE) -DLUA_COMPAT_MODULE
+liblualongnumber_la_LDFLAGS = $(AM_LDFLAGS)
+liblualongnumber_la_LIBADD = $(LUA_LIB) -lm
 
 EXTRA_DIST = \
 		coding_standards.md \