TS-2858 Build failures on OmniOS

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

Branch: refs/heads/master
Commit: 1cb12a93a0df96e5c38e77076bcc1337e4caaa31
Parents: f6e9da4
Author: Leif Hedstrom <[email protected]>
Authored: Thu May 29 12:07:09 2014 -0600
Committer: Leif Hedstrom <[email protected]>
Committed: Thu May 29 12:10:19 2014 -0600

----------------------------------------------------------------------
 CHANGES                                                  | 3 +++
 configure.ac                                             | 6 ++++--
 lib/Makefile.am                                          | 9 ++++++---
 plugins/experimental/regex_revalidate/regex_revalidate.c | 7 ++++++-
 proxy/Makefile.am                                        | 2 +-
 5 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1cb12a93/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 172adbd..dbfc39b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-2858] Build failures on OmniOS. Also add some LuaJIT flags as per
+   Theo's and Daniel's recommendations.
+
   *) [TS-2857] Cleanup SPDY and SSL stat names
 
   *) [TS-2856] Remove proxy.config.spdy.verbose_in and use diags instead

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1cb12a93/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index a324025..fa69263 100644
--- a/configure.ac
+++ b/configure.ac
@@ -652,6 +652,7 @@ case $host_os in
       *amd64*)
         TS_ADDTO(CFLAGS, -m64)
         TS_ADDTO(CXXFLAGS, -m64)
+        TS_ADDTO(LUA_LDFLAGS, -m64)
         ;;
     esac
     ;;
@@ -1399,11 +1400,12 @@ AX_LIB_READLINE
 # http://luajit.org/install.html.
 case $host_os_def in
   darwin)
-    LUA_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000"
+    TS_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000"
     ;;
 esac
 
-AC_SUBST(LUA_LUAJIT_LDFLAGS)
+AC_SUBST(TS_LUAJIT_LDFLAGS)
+AC_SUBST(LUA_LDFLAGS)
 
 # 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/1cb12a93/lib/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6d8dee6..cf45bd6 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -36,13 +36,16 @@ endif
 #  - Copy the luajit source tree if we're doing out-of-source builds
 #  - Upon clean, remove the luajit tree from the out-of-source build tree
 #
-# ToDo: Can we do this without copying the source? I tried setting the VPATH, 
but
-#       it did not work. Can we make more intelligent build targets, avoiding 
[ test ] ?
+# Note: The LUA_LDFLAGS is a bit of a hack, since LuaJIT on OmniOS needs
+#       the -m64 flag. See configure.ac.
+#
+LUA_CFLAGS=$(CFLAGS) -DLUA_COMPAT_ALL -DLUA_USE_POSIX -DLUA_USE_DLOPEN
+
 all-local:
        @echo "Making all in luajit"
        test -d "$(top_srcdir)/$(subdir)/luajit/src" || (cd "$(top_srcdir)" && 
git submodule update --init)
        test -d "$(top_builddir)/$(subdir)/luajit/src" || cp -rf 
"$(srcdir)/luajit" "$(top_builddir)/$(subdir)/"
-       cd luajit && $(MAKE) $(AM_MAKEFLAGS) PREFIX="$(prefix)" CC="$(CC)" 
CFLAGS="$(CFLAGS)"
+       cd luajit && $(MAKE) $(AM_MAKEFLAGS) PREFIX="$(prefix)" CC="$(CC)" 
CFLAGS="$(LUA_CFLAGS)" 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/1cb12a93/plugins/experimental/regex_revalidate/regex_revalidate.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/regex_revalidate/regex_revalidate.c 
b/plugins/experimental/regex_revalidate/regex_revalidate.c
index 11edebf..4f6baa0 100644
--- a/plugins/experimental/regex_revalidate/regex_revalidate.c
+++ b/plugins/experimental/regex_revalidate/regex_revalidate.c
@@ -32,9 +32,14 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <pcre.h>
 #include <ts/ts.h>
 
+#ifdef HAVE_PCRE_PCRE_H
+#  include <pcre/pcre.h>
+#else
+#  include <pcre.h>
+#endif
+
 #define LOG_PREFIX        "regex_revalidate"
 #define CONFIG_TMOUT      60000
 #define FREE_TMOUT        300000

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1cb12a93/proxy/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index 755c894..739840a 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -235,7 +235,7 @@ traffic_server_LDADD = \
 
 # 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 += @LUA_LUAJIT_LDFLAGS@
+traffic_server_LDFLAGS += @TS_LUAJIT_LDFLAGS@
 
 traffic_logcat_SOURCES = logcat.cc
 traffic_logcat_LDFLAGS = @EXTRA_CXX_LDFLAGS@ @LIBTOOL_LINK_FLAGS@

Reply via email to