aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2015-06-12 15:49:21 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2015-06-16 18:27:36 -0700
commit78d470c7a50d3788bf3f819eba99597aea43674f (patch)
treef2d0c53ce1a94234cc4994ea319f1560f44b2f96 /src/Makefile.am
parent4cbb612299eaf8259db25f5dcda46022fbd1db54 (diff)
Make the code independent of config.h
Now the Build tool needs to define -DHAVE_ZLIB and -DHAVE-PTHREAD rather than providing a config.h - Make pbconfig.h a manually written file to handle hash conditions according to platform related macros. - Remove #include "config.h" from source code. - Changed the configure.ac and Makefile.am to pass down the macros. - Change cmake to pass down the the macros. Change-Id: I537249d5df8fdeba189706aec436d1ab1104a4dc
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ac6ec6f4..67cd4c57 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,17 +4,25 @@ if HAVE_ZLIB
GZCHECKPROGRAMS = zcgzip zcgunzip
GZHEADERS = google/protobuf/io/gzip_stream.h
GZTESTS = google/protobuf/io/gzip_stream_unittest.sh
+ZLIB_DEF = -DHAVE_ZLIB=1
else
GZCHECKPROGRAMS =
GZHEADERS =
GZTESTS =
+ZLIB_DEF =
+endif
+
+if HAVE_PTHREAD
+PTHREAD_DEF = -DHAVE_PTHREAD=1
+else
+PTHREAD_DEF =
endif
if GCC
# These are good warnings to turn on by default
-NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
+NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
else
-NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS)
+NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF)
endif
AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG)