Commit 8780d5c1 authored by Ondrej Sury's avatar Ondrej Sury

Define and use SQLITE3_SONAME macro from d/rules instead of hardcoded libsqlite3.so

parent b7eac253
From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD?= <ondrej@sury.org>
Date: Mon, 2 Jan 2017 15:00:13 +0100
Subject: Use SQLITE3_SONAME macro to dlopen libsqlite3.so.*
---
enforcer/src/ods-migrate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/enforcer/src/ods-migrate.c b/enforcer/src/ods-migrate.c
index 241e71d..424ced5 100644
--- a/enforcer/src/ods-migrate.c
+++ b/enforcer/src/ods-migrate.c
@@ -97,7 +97,7 @@ dblayer_sqlite3_initialize(void)
char const *error;
dlerror();
- handle = dlopen("libsqlite3.so", RTLD_NOW);
+ handle = dlopen(SQLITE3_SONAME, RTLD_NOW);
if ((error = dlerror()) != NULL) {
printf("Failed to load sqlite3 library. dlerror(): %s\n", error);
exit(1);
......@@ -4,3 +4,4 @@
0004-ods-control.in-fixes.patch
0005-Fix-manpage-sections.patch
0006-Fix-OpenSSL-1.1.0-Support.patch
0007-Use-SQLITE3_SONAME-macro-to-dlopen-libsqlite3.so.patch
......@@ -13,10 +13,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -DSQLITE3_SONAME=\\\"$(SQLITE3_SONAME)\\\"
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
SQLITE3_SONAME = $(shell objdump -p $$(pkg-config --variable=libdir sqlite3)/libsqlite3.so | sed -ne 's/^[[:space:]]*SONAME[[:space:]]*\(libsqlite3\.so.*\)/\1/p')
# main packaging script based on dh7 syntax
%:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment