sngrep: fix error if gnutls and openssl are both enabled
[buildroot-gz.git] / package / zmqpp / 0001-Allow-building-shared-or-static-library-only.patch
blob70caee816239dc0bf33229be1c889daa7c6e1238
1 From 02ad67e60ef698ee47f6ee53b36e5b89c2fd71e7 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
3 Date: Wed, 24 Feb 2016 10:07:11 -0300
4 Subject: [PATCH 1/2] Allow building shared or static library only
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 [Gustavo: update for 4.1.2]
11 Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
12 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
13 ---
14 Makefile | 19 +++++++++++++++----
15 1 file changed, 15 insertions(+), 4 deletions(-)
17 diff --git a/Makefile b/Makefile
18 index 9df5996..86c8fac 100644
19 --- a/Makefile
20 +++ b/Makefile
21 @@ -79,6 +79,8 @@ ifeq ($(UNAME_S),Darwin)
22 endif
25 +BUILD_SHARED ?= yes
27 CONFIG_FLAGS =
28 ifeq ($(CONFIG),debug)
29 CONFIG_FLAGS = -g -fno-inline -ftemplate-depth-1000
30 @@ -93,13 +95,22 @@ ifneq (,$(findstring $(CONFIG),release loadtest))
31 CONFIG_FLAGS = -O3 -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNO_DEBUG_LOG -DNO_TRACE_LOG -DNDEBUG
32 endif
34 -COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall -fPIC \
35 +COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall \
36 -DBUILD_ENV=$(CONFIG) \
37 -DBUILD_DATESTAMP='$(APP_DATESTAMP)' \
38 -DBUILD_LIBRARY_NAME='"$(LIBRARY_NAME)"' \
39 -DBUILD_CLIENT_NAME='"$(CLIENT_TARGET)"' \
40 -I$(SRC_PATH) $(CUSTOM_INCLUDE_PATH)
42 +ifeq ($(BUILD_SHARED),yes)
43 +COMMON_FLAGS += -fPIC
44 +LIBRARY_TARGETS += $(LIBRARY_SHARED)
45 +endif
47 +ifeq ($(BUILD_STATIC),yes)
48 +LIBRARY_TARGETS += $(LIBRARY_ARCHIVE)
49 +endif
51 COMMON_LIBS = -lzmq
53 LIBRARY_LIBS =
54 @@ -147,10 +158,11 @@ install:
55 mkdir -p $(INCLUDEDIR)/$(LIBRARY_DIR)
56 mkdir -p $(LIBDIR)
57 install -m 644 $(ALL_LIBRARY_INCLUDES) $(INCLUDEDIR)/$(LIBRARY_DIR)
58 +ifeq ($(BUILD_SHARED),yes)
59 install -m 755 $(BUILD_PATH)/$(LIBRARY_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_FULL_VERSION_SHARED)
60 - install -m 755 $(BUILD_PATH)/$(LIBRARY_ARCHIVE) $(LIBDIR)/$(LIBRARY_ARCHIVE)
61 ln -sf $(LIBRARY_FULL_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_VERSION_SHARED)
62 ln -sf $(LIBRARY_FULL_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_SHARED)
63 +endif
64 if [ -f $(BUILD_PATH)/$(CLIENT_TARGET) ]; then install -m 755 $(BUILD_PATH)/$(CLIENT_TARGET) $(BINDIR); fi
65 $(LDCONFIG)
66 @echo "use make installcheck to test the install"
67 @@ -172,7 +184,7 @@ clean:
69 client: $(CLIENT_TARGET)
71 -library: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE)
72 +library: $(LIBRARY_TARGETS)
75 # BUILD Targets
76 @@ -211,4 +223,3 @@ test: $(TESTS_TARGET)
77 $(OBJECT_PATH)/%.o: $(SRC_PATH)/%.cpp
78 -mkdir -p $(dir $@)
79 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COMMON_FLAGS) $(CONFIG_FLAGS) -c -o $@ $<
81 --
82 2.4.10