net-im/lurch: patches merged upstream
This commit is contained in:
parent
142e1d5a07
commit
2b1fa15fac
@ -1,160 +0,0 @@
|
|||||||
From f17d0d28a0c3f383c7d59763d0ba4be7ca27f881 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Julian Ospald <hasufell@posteo.de>
|
|
||||||
Date: Tue, 21 Feb 2017 16:40:32 +0100
|
|
||||||
Subject: [PATCH] Improve build system
|
|
||||||
Upstream: submitted https://github.com/gkdr/lurch/pull/25
|
|
||||||
|
|
||||||
* respect system toolchain: gcc, pkg-config etc might be prefixed
|
|
||||||
* allow more control over passed flags, never overwriting CFLAGS etc
|
|
||||||
entirely
|
|
||||||
* proper quoting: make does _not_ take care of quoting in make rules
|
|
||||||
* default "install" target installs into system plugin dir, additional
|
|
||||||
"install-home" target installs into users home plugin dir
|
|
||||||
* simplify "clean" target and add "clean-all" target
|
|
||||||
* some minor changes to follow common Make style
|
|
||||||
* update .PHONY
|
|
||||||
---
|
|
||||||
README.md | 2 +-
|
|
||||||
makefile | 101 ++++++++++++++++++++++++++++++++++++++++++++------------------
|
|
||||||
2 files changed, 73 insertions(+), 30 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/README.md b/README.md
|
|
||||||
index b5a5283..c188a3d 100644
|
|
||||||
--- a/README.md
|
|
||||||
+++ b/README.md
|
|
||||||
@@ -10,7 +10,7 @@
|
|
||||||
2. `cd lurch`
|
|
||||||
3. `git submodule update --init` (If you just pull a newer version, remember to also update the submodules as they might have changed!)
|
|
||||||
4. `make`
|
|
||||||
-5. A final `make install` should copy the compiled plugin into your libpurple plugin dir.
|
|
||||||
+5. A final `make install-home` should copy the compiled plugin into your libpurple plugin dir.
|
|
||||||
6. The next time you start Pidgin (or another libpurple client), you should be able to activate it in the "Plugins" window.
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
diff --git a/makefile b/makefile
|
|
||||||
index 108fc42..bcf43e2 100644
|
|
||||||
--- a/makefile
|
|
||||||
+++ b/makefile
|
|
||||||
@@ -1,6 +1,38 @@
|
|
||||||
-PURPLE_PLUGIN_DIR=~/.purple/plugins
|
|
||||||
-PIDGIN_DIR=./pidgin-2.11.0
|
|
||||||
-PURPLE_PLUGIN_SRC_DIR=$(PIDGIN_DIR)/libpurple/plugins
|
|
||||||
+### toolchain
|
|
||||||
+#
|
|
||||||
+CC ?= gcc
|
|
||||||
+PKG_CONFIG ?= pkg-config
|
|
||||||
+MKDIR = mkdir
|
|
||||||
+MKDIR_P = mkdir -p
|
|
||||||
+INSTALL = install
|
|
||||||
+INSTALL_LIB = $(INSTALL) -m 755
|
|
||||||
+INSTALL_DIR = $(INSTALL) -d -m 755
|
|
||||||
+RM = rm
|
|
||||||
+RM_RF = $(RM) -rf
|
|
||||||
+CMAKE ?= cmake
|
|
||||||
+CMAKE_FLAGS = -DCMAKE_BUILD_TYPE=Debug
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+### flags
|
|
||||||
+#
|
|
||||||
+PKGCFG_C=$(shell $(PKG_CONFIG) --cflags glib-2.0 purple) \
|
|
||||||
+ $(shell xml2-config --cflags)
|
|
||||||
+
|
|
||||||
+PKGCFG_L=$(shell $(PKG_CONFIG) --libs purple glib-2.0 sqlite3 mxml) \
|
|
||||||
+ $(shell xml2-config --libs) \
|
|
||||||
+ -L$(shell $(PKG_CONFIG) --variable=plugindir purple) \
|
|
||||||
+ $(shell libgcrypt-config --libs)
|
|
||||||
+
|
|
||||||
+HEADERS=-I$(HDIR)/jabber -I$(LOMEMO_SRC) -I$(AXC_SRC) -I$(AX_DIR)/src
|
|
||||||
+CFLAGS += -std=c11 -Wall -g -Wstrict-overflow $(PKGCFG_C) $(HEADERS)
|
|
||||||
+CPPFLAGS += -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
|
|
||||||
+LDFLAGS += -ldl -lm $(PKGCFG_L) -ljabber
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+### directories
|
|
||||||
+#
|
|
||||||
+PURPLE_HOME_PLUGIN_DIR=~/.purple/plugins
|
|
||||||
+PURPLE_PLUGIN_DIR = $(shell $(PKG_CONFIG) --variable=plugindir purple)
|
|
||||||
|
|
||||||
LDIR=./lib
|
|
||||||
BDIR=./build
|
|
||||||
@@ -22,40 +54,51 @@ AX_PATH=$(AX_DIR)/build/src/libaxolotl-c.a
|
|
||||||
|
|
||||||
FILES=$(LOMEMO_PATH) $(AXC_PATH) $(AX_PATH)
|
|
||||||
|
|
||||||
-HEADERS=-I$(HDIR)/jabber -I$(LOMEMO_SRC) -I$(AXC_SRC) -I$(AX_DIR)/src
|
|
||||||
-
|
|
||||||
-PKGCFG_C=$(shell pkg-config --cflags glib-2.0 purple) $(shell xml2-config --cflags)
|
|
||||||
-PKGCFG_L=$(shell pkg-config --libs purple glib-2.0 sqlite3 mxml) $(shell xml2-config --libs) -L$(shell pkg-config --variable=plugindir purple) $(shell libgcrypt-config --libs)
|
|
||||||
-
|
|
||||||
-CFLAGS=-std=c11 -Wall -g -Wstrict-overflow -D_XOPEN_SOURCE=700 -D_BSD_SOURCE $(PKGCFG_C) $(HEADERS)
|
|
||||||
-LFLAGS= -ldl -lm $(PKGCFG_L) -ljabber
|
|
||||||
-
|
|
||||||
|
|
||||||
+### make rules
|
|
||||||
+#
|
|
||||||
all: $(BDIR)/lurch.so
|
|
||||||
|
|
||||||
$(BDIR):
|
|
||||||
- mkdir -p build
|
|
||||||
-
|
|
||||||
+ $(MKDIR_P) build
|
|
||||||
+
|
|
||||||
$(AX_PATH):
|
|
||||||
- cd $(AXC_DIR)/lib/libaxolotl-c/ && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make
|
|
||||||
-
|
|
||||||
+ cd $(AXC_DIR)/lib/libaxolotl-c/ && \
|
|
||||||
+ $(MKDIR_P) build && \
|
|
||||||
+ cd build && \
|
|
||||||
+ $(CMAKE) $(CMAKE_FLAGS) .. \
|
|
||||||
+ && $(MAKE)
|
|
||||||
+
|
|
||||||
$(AXC_PATH):
|
|
||||||
- cd $(AXC_DIR) && make build/libaxc-nt.a
|
|
||||||
-
|
|
||||||
+ $(MAKE) -C "$(AXC_DIR)" build/libaxc-nt.a
|
|
||||||
+
|
|
||||||
$(LOMEMO_PATH):
|
|
||||||
- cd $(LOMEMO_DIR) && make build/libomemo-conversations.a
|
|
||||||
-
|
|
||||||
+ $(MAKE) -C "$(LOMEMO_DIR)" build/libomemo-conversations.a
|
|
||||||
+
|
|
||||||
$(BDIR)/lurch.so: $(SDIR)/lurch.c $(AX_PATH) $(AXC_PATH) $(LOMEMO_PATH) $(BDIR)
|
|
||||||
- gcc $(CFLAGS) -fPIC -c $(SDIR)/lurch.c -o $(BDIR)/lurch.o
|
|
||||||
- gcc -fPIC -shared $(CFLAGS) $(BDIR)/lurch.o $(FILES) -o $@ $(LFLAGS)
|
|
||||||
-
|
|
||||||
+ $(CC) -fPIC $(CFLAGS) $(CPPFLAGS) \
|
|
||||||
+ -c "$(SDIR)/lurch.c" \
|
|
||||||
+ -o "$(BDIR)/lurch.o"
|
|
||||||
+ $(CC) -fPIC -shared $(CFLAGS) $(CPPFLAGS) \
|
|
||||||
+ "$(BDIR)/lurch.o" $(FILES) \
|
|
||||||
+ -o $@ $(LDFLAGS)
|
|
||||||
+
|
|
||||||
install: $(BDIR)/lurch.so
|
|
||||||
- mkdir -p $(PURPLE_PLUGIN_DIR)
|
|
||||||
- cp $(BDIR)/lurch.so $(PURPLE_PLUGIN_DIR)/lurch.so
|
|
||||||
+ [ -e "$(DESTDIR)/$(PURPLE_PLUGIN_DIR)" ] || \
|
|
||||||
+ $(INSTALL_DIR) "$(DESTDIR)/$(PURPLE_PLUGIN_DIR)"
|
|
||||||
+ $(INSTALL_LIB) "$(BDIR)/lurch.so" "$(DESTDIR)/$(PURPLE_PLUGIN_DIR)/lurch.so"
|
|
||||||
+
|
|
||||||
+install-home: $(BDIR)/lurch.so
|
|
||||||
+ [ -e "$(PURPLE_HOME_PLUGIN_DIR)" ] || \
|
|
||||||
+ $(INSTALL_DIR) "$(PURPLE_HOME_PLUGIN_DIR)"
|
|
||||||
+ $(INSTALL_LIB) "$(BDIR)/lurch.so" "$(PURPLE_HOME_PLUGIN_DIR)/lurch.so"
|
|
||||||
|
|
||||||
-.PHONY: clean
|
|
||||||
clean:
|
|
||||||
- rm -rf $(LOMEMO_BUILD)
|
|
||||||
- rm -rf $(AXC_BUILD)
|
|
||||||
- rm -rf $(AX_DIR)/build
|
|
||||||
- rm -rf $(BDIR)
|
|
||||||
+ $(RM_RF) "$(BDIR)"
|
|
||||||
+
|
|
||||||
+clean-all: clean
|
|
||||||
+ $(MAKE) -C "$(LOMEMO_DIR)" clean
|
|
||||||
+ $(MAKE) -C "$(AXC_DIR)" clean
|
|
||||||
+
|
|
||||||
+.PHONY: clean clean-all install install-home
|
|
||||||
+
|
|
||||||
--
|
|
||||||
2.11.1
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
|||||||
From ace0369d26868163dd4f3ba1612812a1c6187197 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Julian Ospald <hasufell@posteo.de>
|
|
||||||
Date: Tue, 21 Feb 2017 17:18:42 +0100
|
|
||||||
Subject: [PATCH] Improve build system
|
|
||||||
Upstream: submitted https://github.com/gkdr/axc/pull/1
|
|
||||||
|
|
||||||
* respect toolchain
|
|
||||||
* make stuff more Make compatible
|
|
||||||
---
|
|
||||||
makefile | 85 ++++++++++++++++++++++++++++++++++++++++------------------------
|
|
||||||
1 file changed, 53 insertions(+), 32 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/makefile b/makefile
|
|
||||||
index 2ca357f..7841a5f 100644
|
|
||||||
--- a/lib/axc/makefile
|
|
||||||
+++ b/lib/axc/makefile
|
|
||||||
@@ -1,3 +1,15 @@
|
|
||||||
+### toolchain
|
|
||||||
+#
|
|
||||||
+CC ?= gcc
|
|
||||||
+AR ?= ar
|
|
||||||
+PKG_CONFIG ?= pkg-config
|
|
||||||
+LIBGCRYPT_CONFIG ?= libgcrypt-config
|
|
||||||
+MKDIR = mkdir
|
|
||||||
+MKDIR_P = mkdir -p
|
|
||||||
+CMAKE ?= cmake
|
|
||||||
+CMAKE_FLAGS = -DCMAKE_BUILD_TYPE=Debug
|
|
||||||
+
|
|
||||||
+
|
|
||||||
SDIR = src
|
|
||||||
LDIR = lib
|
|
||||||
BDIR = build
|
|
||||||
@@ -9,76 +21,85 @@ AX_DIR=./lib/libaxolotl-c
|
|
||||||
AX_BDIR=$(AX_DIR)/build/src
|
|
||||||
AX_PATH=$(AX_BDIR)/libaxolotl-c.a
|
|
||||||
|
|
||||||
-PKGCFG_C=$(shell pkg-config --cflags sqlite3 glib-2.0) $(shell libgcrypt-config --cflags)
|
|
||||||
-PKGCFG_L=$(shell pkg-config --libs sqlite3 glib-2.0) $(shell libgcrypt-config --libs)
|
|
||||||
+PKGCFG_C=$(shell $(PKG_CONFIG) --cflags sqlite3 glib-2.0) \
|
|
||||||
+ $(shell $(LIBGCRYPT_CONFIG) --cflags)
|
|
||||||
+PKGCFG_L=$(shell $(PKG_CONFIG) --libs sqlite3 glib-2.0) \
|
|
||||||
+ $(shell $(LIBGCRYPT_CONFIG) --libs)
|
|
||||||
|
|
||||||
HEADERS=-I$(AX_DIR)/src
|
|
||||||
-CFLAGS=$(HEADERS) $(PKGCFG_C) -std=c11 -Wall -Wextra -Wpedantic -Wstrict-overflow -fno-strict-aliasing -funsigned-char -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE -fno-builtin-memset
|
|
||||||
+CFLAGS += $(HEADERS) $(PKGCFG_C) -std=c11 -Wall -Wextra -Wpedantic \
|
|
||||||
+ -Wstrict-overflow -fno-strict-aliasing -funsigned-char \
|
|
||||||
+ -fno-builtin-memset
|
|
||||||
+CPPFLAGS += -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE
|
|
||||||
TESTFLAGS=$(HEADERS) $(PKGCFG_C) -g -O0 --coverage
|
|
||||||
PICFLAGS=-fPIC $(CFLAGS)
|
|
||||||
-LFLAGS = -pthread -ldl $(PKGCFG_L) $(AX_PATH) -lm
|
|
||||||
-LFLAGS_T= -lcmocka $(LFLAGS)
|
|
||||||
+LDFLAGS += -pthread -ldl $(PKGCFG_L) $(AX_PATH) -lm
|
|
||||||
+LDFLAGS_T= -lcmocka $(LFLAGS)
|
|
||||||
|
|
||||||
all: $(BDIR)/libaxc.a
|
|
||||||
|
|
||||||
$(BDIR):
|
|
||||||
- mkdir -p $@
|
|
||||||
+ $(MKDIR_P) $@
|
|
||||||
|
|
||||||
client: $(SDIR)/message_client.c $(BDIR)/axc_store.o $(BDIR)/axc_crypto.o $(BDIR)/axc.o $(AX_PATH)
|
|
||||||
- mkdir -p $@
|
|
||||||
- gcc -D_POSIX_SOURCE -D_XOPEN_SOURCE=700 $(CFLAGS) $^ -o $@/$@.o $(LFLAGS)
|
|
||||||
-
|
|
||||||
+ $(MKDIR_P) $@
|
|
||||||
+ $(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@/$@.o $(LDFLAGS)
|
|
||||||
+
|
|
||||||
$(BDIR)/axc.o: $(SDIR)/axc.c $(BDIR)
|
|
||||||
- gcc $(PICFLAGS) -c $< -o $@
|
|
||||||
-
|
|
||||||
+ $(CC) $(PICFLAGS) $(CPPFLAGS) -c $< -o $@
|
|
||||||
+
|
|
||||||
$(BDIR)/axc-nt.o: $(SDIR)/axc.c $(BDIR)
|
|
||||||
- gcc $(PICFLAGS) -DNO_THREADS -c $< -o $@
|
|
||||||
-
|
|
||||||
+ $(CC) $(PICFLAGS) $(CPPFLAGS) -DNO_THREADS -c $< -o $@
|
|
||||||
+
|
|
||||||
$(BDIR)/axc_crypto.o: $(SDIR)/axc_crypto.c $(BDIR)
|
|
||||||
- gcc $(PICFLAGS) -c $< -o $@
|
|
||||||
+ $(CC) $(PICFLAGS) $(CPPFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(BDIR)/axc_store.o: $(SDIR)/axc_store.c $(BDIR)
|
|
||||||
- gcc $(PICFLAGS) -c $< -o $@
|
|
||||||
-
|
|
||||||
+ $(CC) $(PICFLAGS) $(CPPFLAGS) -c $< -o $@
|
|
||||||
+
|
|
||||||
$(BDIR)/libaxc.a: $(BDIR)/axc.o $(BDIR)/axc_crypto.o $(BDIR)/axc_store.o
|
|
||||||
- ar rcs $@ $^
|
|
||||||
-
|
|
||||||
+ $(AR) rcs $@ $^
|
|
||||||
+
|
|
||||||
$(BDIR)/libaxc-nt.a: $(BDIR)/axc-nt.o $(BDIR)/axc_crypto.o $(BDIR)/axc_store.o
|
|
||||||
- ar rcs $@ $^
|
|
||||||
+ $(AR) rcs $@ $^
|
|
||||||
|
|
||||||
$(AX_PATH):
|
|
||||||
- cd $(AX_DIR) && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make
|
|
||||||
-
|
|
||||||
+ cd $(AX_DIR) && \
|
|
||||||
+ $(MKDIR_P) build && \
|
|
||||||
+ cd build && \
|
|
||||||
+ $(CMAKE) $(CMAKE_FLAGS) .. && \
|
|
||||||
+ $(MAKE)
|
|
||||||
+
|
|
||||||
.PHONY: test
|
|
||||||
test: $(AX_PATH) test_store.o test_client.o
|
|
||||||
|
|
||||||
.PHONY: test_store.o
|
|
||||||
test_store.o: $(SDIR)/axc_store.c $(SDIR)/axc_crypto.c $(TDIR)/test_store.c
|
|
||||||
- gcc $(TESTFLAGS) -o $(TDIR)/$@ $(TDIR)/test_store.c $(SDIR)/axc_crypto.c $(LFLAGS_T)
|
|
||||||
+ $(CC) $(TESTFLAGS) -o $(TDIR)/$@ $(TDIR)/test_store.c $(SDIR)/axc_crypto.c $(LDFLAGS_T)
|
|
||||||
-$(TDIR)/$@
|
|
||||||
mv *.g* $(TDIR)
|
|
||||||
-
|
|
||||||
+
|
|
||||||
test_store: test_store.o
|
|
||||||
-
|
|
||||||
+
|
|
||||||
.PHONY: test_client.o
|
|
||||||
test_client.o: $(SDIR)/axc.c $(SDIR)/axc_crypto.c $(SDIR)/axc_store.c $(TDIR)/test_client.c
|
|
||||||
- gcc $(TESTFLAGS) -g $(HEADERS) -o $(TDIR)/$@ $(SDIR)/axc_crypto.c $(TDIR)/test_client.c $(LFLAGS_T)
|
|
||||||
+ $(CC) $(TESTFLAGS) -g $(HEADERS) -o $(TDIR)/$@ $(SDIR)/axc_crypto.c $(TDIR)/test_client.c $(LDFLAGS_T)
|
|
||||||
-$(TDIR)/$@
|
|
||||||
mv *.g* $(TDIR)
|
|
||||||
-
|
|
||||||
-test_client: test_client.o
|
|
||||||
-
|
|
||||||
+
|
|
||||||
+test_client: test_client.o
|
|
||||||
+
|
|
||||||
.PHONY: coverage
|
|
||||||
coverage: test
|
|
||||||
gcovr -r . --html --html-details -o $@.html
|
|
||||||
gcovr -r . -s
|
|
||||||
- mkdir -p $@
|
|
||||||
+ $(MKDIR_P) $@
|
|
||||||
mv $@.* $@
|
|
||||||
-
|
|
||||||
+
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
rm -rf client $(BDIR) $(CDIR) $(AX_DIR)/build
|
|
||||||
rm -f $(TDIR)/*.o
|
|
||||||
rm -f $(TDIR)/*.gcno $(TDIR)/*.gcda $(TDIR)/*.sqlite
|
|
||||||
-
|
|
||||||
-
|
|
||||||
+
|
|
||||||
+
|
|
||||||
--
|
|
||||||
2.11.1
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
|||||||
From 48e4c07fcd33fe1743119bde5cfa1ab414f2208a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Julian Ospald <hasufell@posteo.de>
|
|
||||||
Date: Tue, 21 Feb 2017 17:28:03 +0100
|
|
||||||
Subject: [PATCH] Improve build system
|
|
||||||
Upstream: submitted https://github.com/gkdr/libomemo/pull/3
|
|
||||||
|
|
||||||
* respect toolchain
|
|
||||||
* make stuff more Make compatible
|
|
||||||
---
|
|
||||||
makefile | 80 ++++++++++++++++++++++++++++++++++++++--------------------------
|
|
||||||
1 file changed, 48 insertions(+), 32 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/makefile b/makefile
|
|
||||||
index 0785924..5d7ca01 100644
|
|
||||||
--- a/lib/libomemo/makefile
|
|
||||||
+++ b/lib/libomemo/makefile
|
|
||||||
@@ -1,3 +1,14 @@
|
|
||||||
+### toolchain
|
|
||||||
+#
|
|
||||||
+CC ?= gcc
|
|
||||||
+AR ?= ar
|
|
||||||
+LIBTOOL ?= libtool
|
|
||||||
+PKG_CONFIG ?= pkg-config
|
|
||||||
+LIBGCRYPT_CONFIG ?= libgcrypt-config
|
|
||||||
+MKDIR = mkdir
|
|
||||||
+MKDIR_P = mkdir -p
|
|
||||||
+
|
|
||||||
+
|
|
||||||
SDIR = src
|
|
||||||
BDIR = build
|
|
||||||
TDIR = test
|
|
||||||
@@ -7,66 +18,71 @@ LDIR = lib
|
|
||||||
# -fno-builtin-memset is enough to make gcc not optimize it away
|
|
||||||
FILES =
|
|
||||||
|
|
||||||
-PKGCFG_C=$(shell pkg-config --cflags glib-2.0 sqlite3 mxml) $(shell libgcrypt-config --cflags)
|
|
||||||
-PKGCFG_L=$(shell pkg-config --libs glib-2.0 sqlite3 mxml) $(shell libgcrypt-config --libs)
|
|
||||||
+PKGCFG_C=$(shell $(PKG_CONFIG) --cflags glib-2.0 sqlite3 mxml) \
|
|
||||||
+ $(shell $(LIBGCRYPT_CONFIG) --cflags)
|
|
||||||
+PKGCFG_L=$(shell $(PKG_CONFIG) --libs glib-2.0 sqlite3 mxml) \
|
|
||||||
+ $(shell $(LIBGCRYPT_CONFIG) --libs)
|
|
||||||
|
|
||||||
-CFLAGS =-std=c11 -Wall -Wextra -Wpedantic -Wstrict-overflow -fno-strict-aliasing -funsigned-char -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -fno-builtin-memset $(PKGCFG_C)
|
|
||||||
+CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wstrict-overflow \
|
|
||||||
+ -fno-strict-aliasing -funsigned-char \
|
|
||||||
+ -fno-builtin-memset $(PKGCFG_C)
|
|
||||||
+CPPFLAGS += -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
|
|
||||||
CFLAGS_CONVERSATIONS=$(CFLAGS) -DOMEMO_XMLNS='"eu.siacs.conversations.axolotl"' -DOMEMO_NS_SEPARATOR='"."' -DOMEMO_NS_NOVERSION
|
|
||||||
COVFLAGS = --coverage -O0 -g $(CFLAGS)
|
|
||||||
-LFLAGS =-pthread -ldl -lm $(PKGCFG_L)
|
|
||||||
-TESTFLAGS = -lcmocka $(LFLAGS)
|
|
||||||
+LDFLAGS += -pthread -ldl -lm $(PKGCFG_L)
|
|
||||||
+TESTFLAGS = -lcmocka $(LDFLAGS)
|
|
||||||
|
|
||||||
all: $(BDIR)/libomemo-conversations.a
|
|
||||||
|
|
||||||
$(BDIR):
|
|
||||||
- mkdir -p $@
|
|
||||||
-
|
|
||||||
-libomemo: $(SDIR)/libomemo.c libomemo_crypto libomemo_storage $(BDIR)
|
|
||||||
- libtool --mode=compile gcc -c $(SDIR)/$@.c $(CFLAGS) -o $(BDIR)/$@.lo
|
|
||||||
- libtool --mode=link gcc -o $(BDIR)/$@.la $(BDIR)/$@.lo $(BDIR)/$@_crypto.lo $(BDIR)/$@_storage.lo
|
|
||||||
-
|
|
||||||
+ $(MKDIR_P) $@
|
|
||||||
+
|
|
||||||
+libomemo: $(SDIR)/libomemo.c libomemo_crypto libomemo_storage $(BDIR)
|
|
||||||
+ $(LIBTOOL) --mode=compile $(CC) -c $(SDIR)/$@.c $(CFLAGS) $(CPPFLAGS) -o $(BDIR)/$@.lo
|
|
||||||
+ $(LIBTOOL) --mode=link $(CC) -o $(BDIR)/$@.la $(BDIR)/$@.lo $(BDIR)/$@_crypto.lo $(BDIR)/$@_storage.lo
|
|
||||||
+
|
|
||||||
libomemo-conversations: $(SDIR)/libomemo.c libomemo_crypto libomemo_storage $(BDIR)
|
|
||||||
- libtool --mode=compile gcc -c $(SDIR)/libomemo.c $(CFLAGS_CONVERSATIONS) -o $(BDIR)/libomemo.lo
|
|
||||||
- libtool --mode=link gcc -o $(BDIR)/libomemo.la $(BDIR)/libomemo.lo $(BDIR)/libomemo_crypto.lo $(BDIR)/libomemo_storage.lo
|
|
||||||
+ $(LIBTOOL) --mode=compile $(CC) -c $(SDIR)/libomemo.c $(CFLAGS_CONVERSATIONS) -o $(BDIR)/libomemo.lo
|
|
||||||
+ $(LIBTOOL) --mode=link $(CC) -o $(BDIR)/libomemo.la $(BDIR)/libomemo.lo $(BDIR)/libomemo_crypto.lo $(BDIR)/libomemo_storage.lo
|
|
||||||
|
|
||||||
libomemo_crypto: $(SDIR)/libomemo_crypto.c build
|
|
||||||
- libtool --mode=compile gcc -c $(SDIR)/$@.c $(CFLAGS) -o $(BDIR)/$@.lo
|
|
||||||
+ $(LIBTOOL) --mode=compile $(CC) -c $(SDIR)/$@.c $(CFLAGS) $(CPPFLAGS) -o $(BDIR)/$@.lo
|
|
||||||
|
|
||||||
libomemo_storage: $(SDIR)/libomemo_storage.c build
|
|
||||||
- libtool --mode=compile gcc -c $(SDIR)/$@.c $(CFLAGS) -o $(BDIR)/$@.lo
|
|
||||||
+ $(LIBTOOL) --mode=compile $(CC) -c $(SDIR)/$@.c $(CFLAGS) $(CPPFLAGS) -o $(BDIR)/$@.lo
|
|
||||||
|
|
||||||
$(BDIR)/libomemo.o: $(BDIR) $(SDIR)/libomemo.c $(SDIR)/libomemo.h
|
|
||||||
- gcc -c $(CFLAGS) $(SDIR)/libomemo.c -o $@
|
|
||||||
-
|
|
||||||
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SDIR)/libomemo.c -o $@
|
|
||||||
+
|
|
||||||
$(BDIR)/libomemo-conversations.o: $(SDIR)/libomemo.c $(BDIR)
|
|
||||||
- gcc -c $(SDIR)/libomemo.c $(CFLAGS_CONVERSATIONS) -fPIC -o $@
|
|
||||||
-
|
|
||||||
+ $(CC) -c $(SDIR)/libomemo.c $(CFLAGS_CONVERSATIONS) -fPIC -o $@
|
|
||||||
+
|
|
||||||
$(BDIR)/libomemo_crypto.o: $(SDIR)/libomemo_crypto.c $(BDIR)
|
|
||||||
- gcc -c $(SDIR)/libomemo_crypto.c $(CFLAGS) -fPIC -o $@
|
|
||||||
+ $(CC) -c $(SDIR)/libomemo_crypto.c $(CFLAGS) $(CPPFLAGS) -fPIC -o $@
|
|
||||||
|
|
||||||
$(BDIR)/libomemo_storage.o: $(SDIR)/libomemo_storage.c $(BDIR)
|
|
||||||
- gcc -c $(SDIR)/libomemo_storage.c $(CFLAGS) -fPIC -o $@
|
|
||||||
-
|
|
||||||
+ $(CC) -c $(SDIR)/libomemo_storage.c $(CFLAGS) $(CPPFLAGS) -fPIC -o $@
|
|
||||||
+
|
|
||||||
$(BDIR)/libomemo-conversations.a: $(BDIR)/libomemo-conversations.o $(BDIR)/libomemo_crypto.o $(BDIR)/libomemo_storage.o
|
|
||||||
- ar rcs $@ $^
|
|
||||||
-
|
|
||||||
+ $(AR) rcs $@ $^
|
|
||||||
+
|
|
||||||
.PHONY = test_libomemo.o
|
|
||||||
test_libomemo: $(TDIR)/test_libomemo.c $(SDIR)/libomemo.c
|
|
||||||
- gcc $(COVFLAGS) $< $(FILES) -o $(TDIR)/$@.o $(TESTFLAGS)
|
|
||||||
+ $(CC) $(COVFLAGS) $< $(FILES) -o $(TDIR)/$@.o $(TESTFLAGS)
|
|
||||||
-$(TDIR)/$@.o
|
|
||||||
mv *.g* $(TDIR)
|
|
||||||
-
|
|
||||||
+
|
|
||||||
.PHONY: test_crypto
|
|
||||||
test_crypto: $(TDIR)/test_crypto.c $(SDIR)/libomemo_crypto.c
|
|
||||||
- gcc $(COVFLAGS) $< $(FILES) -o $(TDIR)/$@.o $(TESTFLAGS)
|
|
||||||
+ $(CC) $(COVFLAGS) $< $(FILES) -o $(TDIR)/$@.o $(TESTFLAGS)
|
|
||||||
-$(TDIR)/$@.o
|
|
||||||
- mv *.g* $(TDIR)
|
|
||||||
-
|
|
||||||
+ mv *.g* $(TDIR)
|
|
||||||
+
|
|
||||||
.PHONY: test_storage
|
|
||||||
test_storage: $(TDIR)/test_storage.c $(SDIR)/libomemo_storage.c
|
|
||||||
- gcc $(COVFLAGS) $< $(FILES) -o $(TDIR)/$@.o $(TESTFLAGS)
|
|
||||||
+ $(CC) $(COVFLAGS) $< $(FILES) -o $(TDIR)/$@.o $(TESTFLAGS)
|
|
||||||
-$(TDIR)/$@.o
|
|
||||||
- mv *.g* $(TDIR)
|
|
||||||
+ mv *.g* $(TDIR)
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test : test_libomemo test_crypto test_storage
|
|
||||||
@@ -75,7 +91,7 @@ test : test_libomemo test_crypto test_storage
|
|
||||||
coverage: test
|
|
||||||
gcovr -r . --html --html-details -o $@.html
|
|
||||||
gcovr -r . -s
|
|
||||||
- mkdir -p $@
|
|
||||||
+ $(MKDIR_P) $@
|
|
||||||
mv $@.* $@
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
--
|
|
||||||
2.11.1
|
|
||||||
|
|
@ -42,12 +42,6 @@ DEPENDENCIES="
|
|||||||
BUGS_TO="hasufell@posteo.de"
|
BUGS_TO="hasufell@posteo.de"
|
||||||
REMOTE_IDS="github:gkdr/${PN}"
|
REMOTE_IDS="github:gkdr/${PN}"
|
||||||
|
|
||||||
DEFAULT_SRC_PREPARE_PATCHES=(
|
|
||||||
"${FILES}"/0001-Improve-build-system.patch
|
|
||||||
"${FILES}"/0002-axc-Improve-build-system.patch
|
|
||||||
"${FILES}"/0003-omemo-Improve-build-system.patch
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
# cmake part of libaxolotl-c
|
# cmake part of libaxolotl-c
|
||||||
edo mkdir "${CMAKE_SOURCE}"/build
|
edo mkdir "${CMAKE_SOURCE}"/build
|
||||||
|
Loading…
Reference in New Issue
Block a user