Better support for msys2.
diff --git a/Makefile b/Makefile
index 8be6c5f..857bde1 100644
--- a/Makefile
+++ b/Makefile
@@ -37,12 +37,38 @@
ifeq ($(SYSTEM),)
SYSTEM = $(HOST_SYSTEM)
endif
+ifeq ($(SYSTEM),MSYS)
+SYSTEM = MINGW32
+endif
ifndef BUILDDIR
BUILDDIR = .
endif
+HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false)
+HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false)
+HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false)
+
+ifeq ($(HAS_CC),true)
+DEFAULT_CC = cc
+DEFAULT_CXX = c++
+else
+ifeq ($(HAS_GCC),true)
+DEFAULT_CC = gcc
+DEFAULT_CXX = g++
+else
+ifeq ($(HAS_CLANG),true)
+DEFAULT_CC = clang
+DEFAULT_CXX = clang++
+else
+DEFAULT_CC = no_c_compiler
+DEFAULT_CXX = no_c++_compiler
+endif
+endif
+endif
+
+
BINDIR = $(BUILDDIR)/bins
OBJDIR = $(BUILDDIR)/objs
LIBDIR = $(BUILDDIR)/libs
@@ -51,29 +77,29 @@
# Configurations
VALID_CONFIG_opt = 1
-CC_opt = cc
-CXX_opt = c++
-LD_opt = cc
-LDXX_opt = c++
+CC_opt = $(DEFAULT_CC)
+CXX_opt = $(DEFAULT_CXX)
+LD_opt = $(DEFAULT_CC)
+LDXX_opt = $(DEFAULT_CXX)
CPPFLAGS_opt = -O2
LDFLAGS_opt =
DEFINES_opt = NDEBUG
VALID_CONFIG_dbg = 1
-CC_dbg = cc
-CXX_dbg = c++
-LD_dbg = cc
-LDXX_dbg = c++
+CC_dbg = $(DEFAULT_CC)
+CXX_dbg = $(DEFAULT_CXX)
+LD_dbg = $(DEFAULT_CC)
+LDXX_dbg = $(DEFAULT_CXX)
CPPFLAGS_dbg = -O0
LDFLAGS_dbg =
DEFINES_dbg = _DEBUG DEBUG
VALID_CONFIG_valgrind = 1
REQUIRE_CUSTOM_LIBRARIES_valgrind = 1
-CC_valgrind = cc
-CXX_valgrind = c++
-LD_valgrind = cc
-LDXX_valgrind = c++
+CC_valgrind = $(DEFAULT_CC)
+CXX_valgrind = $(DEFAULT_CXX)
+LD_valgrind = $(DEFAULT_CC)
+LDXX_valgrind = $(DEFAULT_CXX)
CPPFLAGS_valgrind = -O0
OPENSSL_CFLAGS_valgrind = -DPURIFY
LDFLAGS_valgrind =
@@ -194,8 +220,14 @@
CXXFLAGS += -std=c++0x
DEFINES += GRPC_OLD_CXX
endif
-CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
-LDFLAGS += -g -fPIC
+CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
+LDFLAGS += -g
+
+ifneq ($(SYSTEM),MINGW32)
+PIC_CPPFLAGS = -fPIC
+CPPFLAGS += -fPIC
+LDFLAGS += -fPIC
+endif
INCLUDES = . include $(GENDIR)
ifeq ($(SYSTEM),Darwin)
@@ -218,11 +250,18 @@
ifneq ($(wildcard /usr/local/lib),)
LDFLAGS += -L/usr/local/lib
endif
-else
+endif
+
+ifeq ($(SYSTEM),Linux)
LIBS = rt m z pthread
LDFLAGS += -pthread
endif
+ifeq ($(SYSTEM),MINGW32)
+LIBS = m z pthread
+LDFLAGS += -pthread
+endif
+
ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),)
GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest
else
@@ -272,13 +311,31 @@
IS_GIT_FOLDER = true
endif
-OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS)
+ifeq ($(SYSTEM),Linux)
+OPENSSL_REQUIRES_DL = true
+endif
+
+ifeq ($(SYSTEM),Darwin)
+OPENSSL_REQUIRES_DL = true
+endif
+
+ifeq ($(SYSTEM),MINGW32)
+OPENSSL_LIBS = ssl32 eay32
+else
+OPENSSL_LIBS = ssl crypto
+endif
+
+OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS)
ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS)
PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS)
PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS)
-PROTOC_CMD = which protoc
+PROTOC_CMD = which protoc > /dev/null
PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3
+ifeq ($(OPENSSL_REQUIRES_DL),true)
+OPENSSL_ALPN_CHECK_CMD += -ldl
+endif
+
ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
@@ -299,7 +356,7 @@
HAS_SYSTEM_PROTOBUF = false
endif
-HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false)
+HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_PROTOC),true)
HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false)
else
@@ -344,12 +401,17 @@
# need to prefix these to ensure overriding system libraries
CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS)
LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS)
+ifeq ($(OPENSSL_REQUIRES_DL),true)
LIBS_SECURE = dl
+endif
else
NO_SECURE = true
endif
else
-LIBS_SECURE = ssl crypto dl
+LIBS_SECURE = $(OPENSSL_LIBS)
+ifeq ($(OPENSSL_REQUIRES_DL),true)
+LIBS_SECURE += dl
+endif
endif
LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
@@ -923,7 +985,7 @@
$(LIBDIR)/$(CONFIG)/zlib/libz.a:
$(E) "[MAKE] Building zlib"
- $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
+ $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
$(Q)$(MAKE) -C third_party/zlib clean
$(Q)$(MAKE) -C third_party/zlib
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib
@@ -932,9 +994,29 @@
$(LIBDIR)/$(CONFIG)/openssl/libssl.a:
$(E) "[MAKE] Building openssl for $(SYSTEM)"
ifeq ($(SYSTEM),Darwin)
- $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc)
+ $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc)
else
- $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG)))
+ifeq ($(SYSTEM),MINGW32)
+ @echo "We currently don't have a good way to compile OpenSSL in-place under msys."
+ @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system."
+ @echo
+ @echo "Note that you can find a compatible version of the libraries here:"
+ @echo
+ @echo "http://slproweb.com/products/Win32OpenSSL.html"
+ @echo
+ @echo "If you decide to install that one, take the full version. The light"
+ @echo "version only contains compiled DLLs, without the development files."
+ @echo
+ @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries"
+ @echo "directory. This way we'll link to them directly."
+ @echo
+ @echo "You can then re-start the build the following way:"
+ @echo
+ @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make"
+ @false
+else
+ $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG)))
+endif
endif
$(Q)$(MAKE) -C third_party/openssl clean
$(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl
@@ -948,9 +1030,9 @@
$(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
$(E) "[MAKE] Building protobuf"
ifeq ($(HAVE_CXX11),true)
- $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
+ $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
else
- $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
+ $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
endif
$(Q)$(MAKE) -C third_party/protobuf clean
$(Q)$(MAKE) -C third_party/protobuf
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 6845b91..36d1142 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -54,12 +54,38 @@
ifeq ($(SYSTEM),)
SYSTEM = $(HOST_SYSTEM)
endif
+ifeq ($(SYSTEM),MSYS)
+SYSTEM = MINGW32
+endif
ifndef BUILDDIR
BUILDDIR = .
endif
+HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false)
+HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false)
+HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false)
+
+ifeq ($(HAS_CC),true)
+DEFAULT_CC = cc
+DEFAULT_CXX = c++
+else
+ifeq ($(HAS_GCC),true)
+DEFAULT_CC = gcc
+DEFAULT_CXX = g++
+else
+ifeq ($(HAS_CLANG),true)
+DEFAULT_CC = clang
+DEFAULT_CXX = clang++
+else
+DEFAULT_CC = no_c_compiler
+DEFAULT_CXX = no_c++_compiler
+endif
+endif
+endif
+
+
BINDIR = $(BUILDDIR)/bins
OBJDIR = $(BUILDDIR)/objs
LIBDIR = $(BUILDDIR)/libs
@@ -68,29 +94,29 @@
# Configurations
VALID_CONFIG_opt = 1
-CC_opt = cc
-CXX_opt = c++
-LD_opt = cc
-LDXX_opt = c++
+CC_opt = $(DEFAULT_CC)
+CXX_opt = $(DEFAULT_CXX)
+LD_opt = $(DEFAULT_CC)
+LDXX_opt = $(DEFAULT_CXX)
CPPFLAGS_opt = -O2
LDFLAGS_opt =
DEFINES_opt = NDEBUG
VALID_CONFIG_dbg = 1
-CC_dbg = cc
-CXX_dbg = c++
-LD_dbg = cc
-LDXX_dbg = c++
+CC_dbg = $(DEFAULT_CC)
+CXX_dbg = $(DEFAULT_CXX)
+LD_dbg = $(DEFAULT_CC)
+LDXX_dbg = $(DEFAULT_CXX)
CPPFLAGS_dbg = -O0
LDFLAGS_dbg =
DEFINES_dbg = _DEBUG DEBUG
VALID_CONFIG_valgrind = 1
REQUIRE_CUSTOM_LIBRARIES_valgrind = 1
-CC_valgrind = cc
-CXX_valgrind = c++
-LD_valgrind = cc
-LDXX_valgrind = c++
+CC_valgrind = $(DEFAULT_CC)
+CXX_valgrind = $(DEFAULT_CXX)
+LD_valgrind = $(DEFAULT_CC)
+LDXX_valgrind = $(DEFAULT_CXX)
CPPFLAGS_valgrind = -O0
OPENSSL_CFLAGS_valgrind = -DPURIFY
LDFLAGS_valgrind =
@@ -211,8 +237,14 @@
CXXFLAGS += -std=c++0x
DEFINES += GRPC_OLD_CXX
endif
-CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
-LDFLAGS += -g -fPIC
+CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
+LDFLAGS += -g
+
+ifneq ($(SYSTEM),MINGW32)
+PIC_CPPFLAGS = -fPIC
+CPPFLAGS += -fPIC
+LDFLAGS += -fPIC
+endif
INCLUDES = . include $(GENDIR)
ifeq ($(SYSTEM),Darwin)
@@ -235,11 +267,18 @@
ifneq ($(wildcard /usr/local/lib),)
LDFLAGS += -L/usr/local/lib
endif
-else
+endif
+
+ifeq ($(SYSTEM),Linux)
LIBS = rt m z pthread
LDFLAGS += -pthread
endif
+ifeq ($(SYSTEM),MINGW32)
+LIBS = m z pthread
+LDFLAGS += -pthread
+endif
+
ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),)
GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest
else
@@ -289,13 +328,31 @@
IS_GIT_FOLDER = true
endif
-OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS)
+ifeq ($(SYSTEM),Linux)
+OPENSSL_REQUIRES_DL = true
+endif
+
+ifeq ($(SYSTEM),Darwin)
+OPENSSL_REQUIRES_DL = true
+endif
+
+ifeq ($(SYSTEM),MINGW32)
+OPENSSL_LIBS = ssl32 eay32
+else
+OPENSSL_LIBS = ssl crypto
+endif
+
+OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS)
ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS)
PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS)
PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS)
-PROTOC_CMD = which protoc
+PROTOC_CMD = which protoc > /dev/null
PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3
+ifeq ($(OPENSSL_REQUIRES_DL),true)
+OPENSSL_ALPN_CHECK_CMD += -ldl
+endif
+
ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
@@ -316,7 +373,7 @@
HAS_SYSTEM_PROTOBUF = false
endif
-HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false)
+HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_PROTOC),true)
HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false)
else
@@ -361,12 +418,17 @@
# need to prefix these to ensure overriding system libraries
CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS)
LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS)
+ifeq ($(OPENSSL_REQUIRES_DL),true)
LIBS_SECURE = dl
+endif
else
NO_SECURE = true
endif
else
-LIBS_SECURE = ssl crypto dl
+LIBS_SECURE = $(OPENSSL_LIBS)
+ifeq ($(OPENSSL_REQUIRES_DL),true)
+LIBS_SECURE += dl
+endif
endif
LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
@@ -513,7 +575,7 @@
$(LIBDIR)/$(CONFIG)/zlib/libz.a:
$(E) "[MAKE] Building zlib"
- $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
+ $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
$(Q)$(MAKE) -C third_party/zlib clean
$(Q)$(MAKE) -C third_party/zlib
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib
@@ -522,9 +584,29 @@
$(LIBDIR)/$(CONFIG)/openssl/libssl.a:
$(E) "[MAKE] Building openssl for $(SYSTEM)"
ifeq ($(SYSTEM),Darwin)
- $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc)
+ $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc)
else
- $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG)))
+ifeq ($(SYSTEM),MINGW32)
+ @echo "We currently don't have a good way to compile OpenSSL in-place under msys."
+ @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system."
+ @echo
+ @echo "Note that you can find a compatible version of the libraries here:"
+ @echo
+ @echo "http://slproweb.com/products/Win32OpenSSL.html"
+ @echo
+ @echo "If you decide to install that one, take the full version. The light"
+ @echo "version only contains compiled DLLs, without the development files."
+ @echo
+ @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries"
+ @echo "directory. This way we'll link to them directly."
+ @echo
+ @echo "You can then re-start the build the following way:"
+ @echo
+ @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make"
+ @false
+else
+ $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG)))
+endif
endif
$(Q)$(MAKE) -C third_party/openssl clean
$(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl
@@ -538,9 +620,9 @@
$(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
$(E) "[MAKE] Building protobuf"
ifeq ($(HAVE_CXX11),true)
- $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
+ $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
else
- $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
+ $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
endif
$(Q)$(MAKE) -C third_party/protobuf clean
$(Q)$(MAKE) -C third_party/protobuf