THRIFT-916: Commit a partial fix for flex-generated code infested with warnings on...
authorChristian Lavoie <clavoie@apache.org>
Wed, 24 Nov 2010 21:58:05 +0000 (21:58 +0000)
committerChristian Lavoie <clavoie@apache.org>
Wed, 24 Nov 2010 21:58:05 +0000 (21:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038844 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/Makefile.am
compiler/cpp/src/thriftl.ll
lib/cpp/Makefile.am
lib/cpp/test/Makefile.am

index ac69b34..cbb12f5 100644 (file)
@@ -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
 
index a6229f4..762cb2f 100644 (file)
 
 %{
 
+/* 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"
 
index c15cbe0..402a294 100644 (file)
@@ -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 = \
index 02c26ad..1829268 100644 (file)
@@ -176,6 +176,7 @@ INCLUDES = \
        -I$(top_srcdir)/lib/cpp/src
 
 AM_CPPFLAGS = $(BOOST_CPPFLAGS)
+AM_CXXFLAGS = -Wall
 
 clean-local:
        $(RM) -r gen-cpp