Repository: trafficserver Updated Branches: refs/heads/master 8a0df996b -> e776c5fc2
TS-4036: make Lua build flags consistent Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e776c5fc Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e776c5fc Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e776c5fc Branch: refs/heads/master Commit: e776c5fc21cb25c18ce172ebc1434eb3f4d1d54e Parents: 8a0df99 Author: James Peach <[email protected]> Authored: Sun Nov 22 17:03:45 2015 -0800 Committer: James Peach <[email protected]> Committed: Sun Nov 22 17:04:14 2015 -0800 ---------------------------------------------------------------------- configure.ac | 20 +++++++++++++------- lib/Makefile.am | 11 +++++++---- plugins/experimental/ts_lua/Makefile.am | 4 +--- proxy/Makefile.am | 2 +- 4 files changed, 22 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e776c5fc/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 317f962..889a149 100644 --- a/configure.ac +++ b/configure.ac @@ -797,7 +797,7 @@ case $host_os_def in debug_opt="-ggdb3 $common_opt -Qunused-arguments" release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing -Qunused-arguments" cxx_opt="-Wno-invalid-offsetof" - luajit_cflags="-Wno-parentheses-equality -Wno-tautological-compare" + lua_cflags="-Wno-parentheses-equality -Wno-tautological-compare" ]) AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [ @@ -819,7 +819,7 @@ case $host_os_def in debug_opt="-g $common_opt" release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing" cxx_opt="-Wno-invalid-offsetof" - luajit_cflags="-Wno-parentheses-equality -Wno-tautological-compare" + lua_cflags="-Wno-parentheses-equality -Wno-tautological-compare" ], [ AC_MSG_WARN([clang is the only supported compiler on Darwin]) ]) @@ -840,7 +840,7 @@ case $host_os_def in debug_opt="-ggdb3 $common_opt" release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing" cxx_opt="-Wno-invalid-offsetof" - luajit_cflags="-Wno-parentheses-equality -Wno-tautological-compare" + lua_cflags="-Wno-parentheses-equality -Wno-tautological-compare" ]) AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [ @@ -911,7 +911,10 @@ AC_SUBST(AM_CXXFLAGS) # Special compiler flag hacks for various pieces of the code AC_SUBST([FLEX_CFLAGS], $flex_cflags) -AC_SUBST([LUAJIT_CFLAGS], $luajit_cflags) + +# Flags for buildit LuaJIT itself. +AC_SUBST(LUA_LDFLAGS) +AC_SUBST([LUA_CFLAGS], $lua_cflags) SHARED_CFLAGS=-fPIC SHARED_LDFLAGS=-shared @@ -1393,12 +1396,15 @@ AX_LIB_READLINE # http://luajit.org/install.html. case $host_os_def in darwin) - TS_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000" + LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000" ;; esac -AC_SUBST(TS_LUAJIT_LDFLAGS) -AC_SUBST(LUA_LDFLAGS) +# Flags for building and linking against our internal copy of LuaJIT. +AC_SUBST([LUAJIT_LDFLAGS]) +AC_SUBST([LUAJIT_CPPFLAGS], ['-I$(top_srcdir)/lib/luajit/src']) +AC_SUBST([LUAJIT_LIBS], ['$(top_builddir)/lib/luajit/src/libluajit.a']) + # We should be able to build http_load if epoll(2) is available. AM_CONDITIONAL([BUILD_HTTP_LOAD], [test x"$ac_cv_func_epoll_ctl" = x"yes"]) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e776c5fc/lib/Makefile.am ---------------------------------------------------------------------- diff --git a/lib/Makefile.am b/lib/Makefile.am index 6f3bf23..3306483 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -41,13 +41,16 @@ DIST_SUBDIRS = $(SUBDIRS) # the -m64 flag. See configure.ac. # if BUILD_LUAJIT -LUA_CFLAGS=$(CFLAGS) $(LUAJIT_CFLAGS) -DLUA_COMPAT_ALL -DLUA_USE_POSIX -DLUA_USE_DLOPEN - all-local: @echo "Making all in luajit" test -d "$(top_builddir)/$(subdir)/luajit/src" || cp -rf "$(srcdir)/luajit" "$(top_builddir)/$(subdir)/" - cd luajit && $(MAKE) $(AM_MAKEFLAGS) BUILDMODE="static" PREFIX="$(prefix)" CC="$(CC)" \ - CFLAGS="$(LUA_CFLAGS)" LDFLAGS="@LUA_LDFLAGS@" + cd luajit && $(MAKE) $(AM_MAKEFLAGS) \ + BUILDMODE="static" \ + PREFIX="$(prefix)" \ + CC="$(CC)" \ + CFLAGS="$(CFLAGS) $(LUA_CFLAGS)" \ + XCFLAGS="" \ + LDFLAGS="$(LUA_LDFLAGS)" clean-local: test "$(top_srcdir)" != "$(top_builddir)" || (cd "$(top_builddir)/$(subdir)/luajit" && $(MAKE) clean) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e776c5fc/plugins/experimental/ts_lua/Makefile.am ---------------------------------------------------------------------- diff --git a/plugins/experimental/ts_lua/Makefile.am b/plugins/experimental/ts_lua/Makefile.am index 3e09ed1..7cf1b35 100644 --- a/plugins/experimental/ts_lua/Makefile.am +++ b/plugins/experimental/ts_lua/Makefile.am @@ -18,12 +18,10 @@ include $(top_srcdir)/build/plugins.mk tslua_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ - -I$(top_srcdir)/lib/luajit/src + $(LUAJIT_CPPFLAGS) pkglib_LTLIBRARIES = tslua.la -#tslua_la_LIBADD = $(top_builddir)/lib/luajit/src/libluajit.a - tslua_la_SOURCES = \ ts_lua.c \ ts_lua_cached_response.c \ http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e776c5fc/proxy/Makefile.am ---------------------------------------------------------------------- diff --git a/proxy/Makefile.am b/proxy/Makefile.am index 0160294..0e49606 100644 --- a/proxy/Makefile.am +++ b/proxy/Makefile.am @@ -240,7 +240,7 @@ if BUILD_LUAJIT # On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See # http://luajit.org/install.html. - traffic_server_LDFLAGS += $(TS_LUAJIT_LDFLAGS) + traffic_server_LDFLAGS += $(LUAJIT_LDFLAGS) endif traffic_logcat_SOURCES = logcat.cc
