9f0aa91e5b
- Update to 1.8.0 * https://github.com/nayuki/QR-Code-generator/compare/v1.6.0...v1.8.0 - Rebase 0003-Generate-both-shared-and-static-libraries.patch - Rebase 0004-Create-install-targets-for-C-and-CPP.patch - Drop 0005-Rename-cpp-library-to-qrcodegencpp-to-avoid-conflict.patch - Add %{?sle15_python_module_pythons} OBS-URL: https://build.opensuse.org/request/show/1125245 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/QR-Code-generator?expand=0&rev=8
93 lines
2.6 KiB
Diff
93 lines
2.6 KiB
Diff
From 16351a7ebaf318d21632bbaabf0675a70bb67dc7 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tchvatal@suse.com>
|
|
Date: Tue, 3 Dec 2019 12:07:19 +0100
|
|
Subject: [PATCH 3/5] Generate both shared and static libraries
|
|
|
|
---
|
|
c/Makefile | 14 ++++++++++----
|
|
cpp/Makefile | 14 ++++++++++----
|
|
2 files changed, 20 insertions(+), 8 deletions(-)
|
|
|
|
Index: QR-Code-generator-1.8.0/c/Makefile
|
|
===================================================================
|
|
--- QR-Code-generator-1.8.0.orig/c/Makefile
|
|
+++ QR-Code-generator-1.8.0/c/Makefile
|
|
@@ -51,16 +51,19 @@ CFLAGS += -std=c99 -O
|
|
# ---- Targets to build ----
|
|
|
|
LIB = qrcodegen
|
|
-LIBFILE = lib$(LIB).a
|
|
+ARFILE = lib$(LIB).a
|
|
+LIBFILE = lib$(LIB).so
|
|
+# Bump the soname number when the ABI changes and gets incompatible
|
|
+SO_NAME = $(LIBFILE).1
|
|
LIBOBJ = qrcodegen.o
|
|
MAINS = qrcodegen-demo qrcodegen-test
|
|
|
|
# Build all binaries
|
|
-all: $(LIBFILE) $(MAINS)
|
|
+all: $(LIBFILE) $(ARFILE) $(MAINS)
|
|
|
|
# Delete build output
|
|
clean:
|
|
- rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
|
+ rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=.o) $(MAINS)
|
|
rm -rf .deps
|
|
|
|
# Executable files
|
|
@@ -72,9 +75,12 @@ qrcodegen-test: qrcodegen-test.c $(LIBOB
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -DQRCODEGEN_TEST -o $@ $^
|
|
|
|
# The library
|
|
-$(LIBFILE): $(LIBOBJ)
|
|
+$(ARFILE): $(LIBOBJ)
|
|
$(AR) -crs $@ -- $^
|
|
|
|
+$(LIBFILE): $(LIBOBJ)
|
|
+ $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
|
|
+
|
|
# Object files
|
|
%.o: %.c .deps/timestamp
|
|
$(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
|
Index: QR-Code-generator-1.8.0/cpp/Makefile
|
|
===================================================================
|
|
--- QR-Code-generator-1.8.0.orig/cpp/Makefile
|
|
+++ QR-Code-generator-1.8.0/cpp/Makefile
|
|
@@ -51,16 +51,19 @@ CXXFLAGS += -std=c++11 -O
|
|
# ---- Targets to build ----
|
|
|
|
LIB = qrcodegencpp
|
|
-LIBFILE = lib$(LIB).a
|
|
+ARFILE = lib$(LIB).a
|
|
+LIBFILE = lib$(LIB).so
|
|
+# Bump the soname number when the ABI changes and gets incompatible
|
|
+SO_NAME = $(LIBFILE).1
|
|
LIBOBJ = qrcodegen.o
|
|
MAINS = QrCodeGeneratorDemo
|
|
|
|
# Build all binaries
|
|
-all: $(LIBFILE) $(MAINS)
|
|
+all: $(LIBFILE) $(LIBFILE) $(MAINS)
|
|
|
|
# Delete build output
|
|
clean:
|
|
- rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
|
+ rm -f -- $(LIBOBJ) $(ARFILE) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
|
rm -rf .deps
|
|
|
|
# Executable files
|
|
@@ -68,9 +71,12 @@ clean:
|
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
|
|
|
|
# The library
|
|
-$(LIBFILE): $(LIBOBJ)
|
|
+$(ARFILE): $(LIBOBJ)
|
|
$(AR) -crs $@ -- $^
|
|
|
|
+$(LIBFILE): $(LIBOBJ)
|
|
+ $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
|
|
+
|
|
# Object files
|
|
%.o: %.cpp .deps/timestamp
|
|
$(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|