Compare commits
12 Commits
Author | SHA256 | Date | |
---|---|---|---|
e646566747 | |||
7f9b1ec233 | |||
a51c6f460b | |||
f971b1f70f | |||
|
9f0aa91e5b | ||
|
56d1ca1fb5 | ||
d6aa3cd03d | |||
2d373a72d2 | |||
|
2a565aeaa0 | ||
030ba2632a | |||
|
1a8b416075 | ||
|
c3894e1578 |
@@ -1,39 +0,0 @@
|
||||
From 8b4866c98775680abc49e8c1c0c50daa25dea052 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 11:59:59 +0100
|
||||
Subject: [PATCH 2/5] Make use of -fPIC parameter when building'
|
||||
|
||||
---
|
||||
c/Makefile | 2 +-
|
||||
cpp/Makefile | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/c/Makefile b/c/Makefile
|
||||
index b27449c..bf79462 100644
|
||||
--- a/c/Makefile
|
||||
+++ b/c/Makefile
|
||||
@@ -77,7 +77,7 @@ $(LIBFILE): $(LIBOBJ)
|
||||
|
||||
# Object files
|
||||
%.o: %.c .deps/timestamp
|
||||
- $(CC) $(CFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
|
||||
+ $(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
||||
|
||||
# Have a place to store header dependencies automatically generated by compiler
|
||||
.deps/timestamp:
|
||||
diff --git a/cpp/Makefile b/cpp/Makefile
|
||||
index 62e03c5..deb8924 100644
|
||||
--- a/cpp/Makefile
|
||||
+++ b/cpp/Makefile
|
||||
@@ -73,7 +73,7 @@ $(LIBFILE): $(LIBOBJ)
|
||||
|
||||
# Object files
|
||||
%.o: %.cpp .deps/timestamp
|
||||
- $(CXX) $(CXXFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
|
||||
+ $(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
||||
|
||||
# Have a place to store header dependencies automatically generated by compiler
|
||||
.deps/timestamp:
|
||||
--
|
||||
2.24.0
|
||||
|
@@ -1,92 +0,0 @@
|
||||
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 $<
|
@@ -1,118 +0,0 @@
|
||||
From 498d2a0cf6d6f01a3ffb87e358f63c3a64afeb9f 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:45:34 +0100
|
||||
Subject: [PATCH 4/5] Create install targets for C and CPP
|
||||
|
||||
---
|
||||
c/Makefile | 26 ++++++++++++++++++++++++++
|
||||
cpp/Makefile | 27 +++++++++++++++++++++++++++
|
||||
2 files changed, 53 insertions(+)
|
||||
|
||||
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
|
||||
@@ -34,6 +34,8 @@ CFLAGS += -std=c99 -O
|
||||
# Extra flags for diagnostics:
|
||||
# CFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
|
||||
|
||||
+# Version information
|
||||
+VERSION = 1.8.0
|
||||
|
||||
# ---- Controlling make ----
|
||||
|
||||
@@ -55,9 +57,15 @@ ARFILE = lib$(LIB).a
|
||||
LIBFILE = lib$(LIB).so
|
||||
# Bump the soname number when the ABI changes and gets incompatible
|
||||
SO_NAME = $(LIBFILE).1
|
||||
+REAL_NAME = $(LIBFILE).$(VERSION)
|
||||
+HEADERS = qrcodegen.h
|
||||
LIBOBJ = qrcodegen.o
|
||||
MAINS = qrcodegen-demo qrcodegen-test
|
||||
|
||||
+# define paths to install
|
||||
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
|
||||
+LIBDIR ?= $(DESTDIR)/usr/lib
|
||||
+
|
||||
# Build all binaries
|
||||
all: $(LIBFILE) $(ARFILE) $(MAINS)
|
||||
|
||||
@@ -66,6 +74,24 @@ clean:
|
||||
rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=.o) $(MAINS)
|
||||
rm -rf .deps
|
||||
|
||||
+install-shared: $(LIBFILE)
|
||||
+ install -d $(LIBDIR) || true
|
||||
+ install -m 0644 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
|
||||
+ rm -f $(LIBDIR)/$(SO_NAME)
|
||||
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
|
||||
+ rm -f $(LIBDIR)/$(LIBFILE)
|
||||
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
|
||||
+
|
||||
+install-static: $(ARFILE)
|
||||
+ install -d $(LIBDIR) || true
|
||||
+ install -m 0644 $(ARFILE) $(LIBDIR)/$(ARFILE)
|
||||
+
|
||||
+install-header: $(HEADERS)
|
||||
+ install -d $(INCLUDEDIR) || true
|
||||
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
|
||||
+
|
||||
+install: install-shared install-static install-header
|
||||
+
|
||||
# Executable files
|
||||
%: %.o $(LIBFILE)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
|
||||
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
|
||||
@@ -34,6 +34,8 @@ CXXFLAGS += -std=c++11 -O
|
||||
# Extra flags for diagnostics:
|
||||
# CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
|
||||
|
||||
+# Version information
|
||||
+VERSION = 1.8.0
|
||||
|
||||
# ---- Controlling make ----
|
||||
|
||||
@@ -55,9 +57,15 @@ ARFILE = lib$(LIB).a
|
||||
LIBFILE = lib$(LIB).so
|
||||
# Bump the soname number when the ABI changes and gets incompatible
|
||||
SO_NAME = $(LIBFILE).1
|
||||
+REAL_NAME = $(LIBFILE).$(VERSION)
|
||||
+HEADERS = qrcodegen.hpp
|
||||
LIBOBJ = qrcodegen.o
|
||||
MAINS = QrCodeGeneratorDemo
|
||||
|
||||
+# define paths to install
|
||||
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
|
||||
+LIBDIR ?= $(DESTDIR)/usr/lib
|
||||
+
|
||||
# Build all binaries
|
||||
all: $(LIBFILE) $(LIBFILE) $(MAINS)
|
||||
|
||||
@@ -66,6 +74,24 @@ clean:
|
||||
rm -f -- $(LIBOBJ) $(ARFILE) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
||||
rm -rf .deps
|
||||
|
||||
+install-shared: $(LIBFILE)
|
||||
+ install -d $(LIBDIR) || true
|
||||
+ install -m 0644 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
|
||||
+ rm -f $(LIBDIR)/$(SO_NAME)
|
||||
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
|
||||
+ rm -f $(LIBDIR)/$(LIBFILE)
|
||||
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
|
||||
+
|
||||
+install-static: $(ARFILE)
|
||||
+ install -d $(LIBDIR) || true
|
||||
+ install -m 0644 $(ARFILE) $(LIBDIR)/$(ARFILE)
|
||||
+
|
||||
+install-header: $(HEADERS)
|
||||
+ install -d $(INCLUDEDIR) || true
|
||||
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
|
||||
+
|
||||
+install: install-shared install-static install-header
|
||||
+
|
||||
# Executable files
|
||||
%: %.o $(LIBFILE)
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2ec0a4d33d6f521c942eeaf473d42d5fe139abcfa57d2beffe10c5cf7d34ae60
|
||||
size 193288
|
Reference in New Issue
Block a user