From af65f1b4781a6f7761617e67f5604413f65ceb8d Mon Sep 17 00:00:00 2001 From: Christian Lavoie Date: Wed, 24 Nov 2010 21:58:05 +0000 Subject: [PATCH] THRIFT-916: Commit a partial fix for flex-generated code infested with warnings on Mac OS X git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038844 13f79535-47bb-0310-9956-ffa450edef68 --- compiler/cpp/Makefile.am | 17 +++++++++++------ compiler/cpp/src/thriftl.ll | 8 ++++++++ lib/cpp/Makefile.am | 3 ++- lib/cpp/test/Makefile.am | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am index ac69b344..cbb12f55 100644 --- a/compiler/cpp/Makefile.am +++ b/compiler/cpp/Makefile.am @@ -26,11 +26,11 @@ BUILT_SOURCES = bin_PROGRAMS = thrift +noinst_LIBRARIES = libparse.a + thrift_OBJDIR = obj -thrift_SOURCES = src/thrifty.yy \ - src/thriftl.ll \ - src/main.cc \ +thrift_SOURCES = src/main.cc \ src/md5.c \ src/generate/t_generator.cc \ src/generate/t_generator_registry.h \ @@ -115,10 +115,15 @@ if THRIFT_GEN_javame thrift_SOURCES += src/generate/t_javame_generator.cc endif -thrift_CXXFLAGS = -Wall -I$(srcdir)/src -thrift_LDFLAGS = -Wall +thrift_CPPFLAGS = -I$(srcdir)/src +thrift_CXXFLAGS = -Wall +thrift_LDADD = @LEXLIB@ libparse.a + +libparse_a_CPPFLAGS = -I$(srcdir)/src +libparse_a_CXXFLAGS = -Wall -Wno-sign-compare -Wno-unused -thrift_LDADD = @LEXLIB@ +libparse_a_SOURCES = src/thrifty.yy \ + src/thriftl.ll EXTRA_DIST = README diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll index a6229f40..762cb2fd 100644 --- a/compiler/cpp/src/thriftl.ll +++ b/compiler/cpp/src/thriftl.ll @@ -25,6 +25,14 @@ %{ +/* This is redundant with some of the flags in Makefile.am, but it works + * when people override CXXFLAGS without being careful. The pragmas are + * the 'right' way to do it, but don't work on old-enough GCC (in particular + * the GCC that ship on Mac OS X 10.6.5, *counter* to what the GNU docs say) + * + * We should revert the Makefile.am changes once Apple ships a reasonable + * GCC. + */ #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-label" diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index c15cbe0f..402a294a 100644 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -80,7 +80,8 @@ libthriftz_la_SOURCES = src/transport/TZlibTransport.cpp # Flags for the various libraries libthriftnb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBEVENT_CPPFLAGS) libthriftz_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS) - +libthriftnb_la_CXXFLAGS = $(AM_CXXFLAGS) +libthriftz_la_CXXFLAGS = $(AM_CXXFLAGS) include_thriftdir = $(includedir)/thrift include_thrift_HEADERS = \ diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am index 02c26ada..18292683 100644 --- a/lib/cpp/test/Makefile.am +++ b/lib/cpp/test/Makefile.am @@ -176,6 +176,7 @@ INCLUDES = \ -I$(top_srcdir)/lib/cpp/src AM_CPPFLAGS = $(BOOST_CPPFLAGS) +AM_CXXFLAGS = -Wall clean-local: $(RM) -r gen-cpp -- 2.17.1