[oe-commits] [openembedded-core] 15/15: pseudo: fix link of sqlite3 using pkg-config

git at git.openembedded.org git at git.openembedded.org
Mon Nov 19 22:47:08 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e31e919cecdd497132a048653f93d3e196692aed
Author: Jens Rehsack <sno at netbsd.org>
AuthorDate: Sun Nov 18 19:36:46 2018 +0100

    pseudo: fix link of sqlite3 using pkg-config
    
    If sqlite3 is built with FTS5 it uses log() from libm, it sqlite3 is built
    with READLINE it uses tgetent from a curses lib and readline from libreadline,
    if it is built using deflate from libz ... , but all that linkage is lost
    if we manually statically link so explicitely extract extra static linking
    options from pkg-config and force them into pseudo as well.
    
    This commit obsoletes (so include the implicit revert)
        e39fec613d pseudo: fix link with new sqlite3
    
    Signed-off-by: Jens Rehsack <sno at netbsd.org>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/pseudo/files/libm.patch | 33 ---------------------------
 meta/recipes-devtools/pseudo/pseudo.inc       | 19 ++++++++++++---
 meta/recipes-devtools/pseudo/pseudo_git.bb    |  1 -
 3 files changed, 16 insertions(+), 37 deletions(-)

diff --git a/meta/recipes-devtools/pseudo/files/libm.patch b/meta/recipes-devtools/pseudo/files/libm.patch
deleted file mode 100644
index 1a82979..0000000
--- a/meta/recipes-devtools/pseudo/files/libm.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-If sqlite3 is built with FTS5 enabled then it links to libm.so for log(), but if
-we statically link to libsqlite3.a then this linkage is lost.
-
-Work around this by always linking to libm.so.
-
-Upstream-Status: Submitted
-Signed-off-by: Ross Burton <ross.burton at intel.com>
-
-From 4633a8750f0966621d258548fba82bc6aa5aa997 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton at intel.com>
-Date: Tue, 6 Nov 2018 12:13:17 +0000
-Subject: [PATCH] Makefile: sqlite can need libm
-
----
- Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index ad6541b..28b5ecb 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -73,7 +73,7 @@ WRAPOBJS=pseudo_wrappers.o
- 
- # needed for anything that links with pseduo_client.o, pretty much
- CLIENT_LDFLAGS=-ldl -lpthread
--DB_LDFLAGS=@SQLITE_LDARG@ -lpthread
-+DB_LDFLAGS=@SQLITE_LDARG@ -lpthread -lm
- 
- PSEUDO=$(BIN)/pseudo
- PSEUDODB=$(BIN)/pseudodb
--- 
-2.11.0
-
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
index cdc2a58..8b05735 100644
--- a/meta/recipes-devtools/pseudo/pseudo.inc
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -17,7 +17,7 @@ PROVIDES += "virtual/fakeroot"
 
 MAKEOPTS = ""
 
-inherit siteinfo
+inherit siteinfo pkgconfig
 
 do_configure () {
 	:
@@ -30,10 +30,23 @@ PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback --enable-ep
 
 # Compile for the local machine arch...
 do_compile () {
+        SQLITE_LDADD='$(SQLITE)/$(SQLITE_LIB)/libsqlite3.a'
+	for sqlite_link_opt in $(pkg-config sqlite3 --libs --static)
+	do
+	    case "$sqlite_link_opt" in
+	    -lsqlite3)
+		;;
+	    -l*)
+		SQLITE_LDADD="${SQLITE_LDADD} ${sqlite_link_opt}"
+		;;
+	    *)
+		;;
+	    esac
+	done
 	if [ "${SITEINFO_BITS}" = "64" ]; then
-	  ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+	  ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --with-static-sqlite="$SQLITE_LDADD" --without-rpath
 	else
-	  ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+	  ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --with-static-sqlite="$SQLITE_LDADD" --without-rpath
 	fi
 	oe_runmake ${MAKEOPTS}
 }
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index c9a4ecd..79e0b6b 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -2,7 +2,6 @@ require pseudo.inc
 
 SRC_URI = "git://git.yoctoproject.org/pseudo \
            file://0001-configure-Prune-PIE-flags.patch \
-           file://libm.patch \
            file://fallback-passwd \
            file://fallback-group \
            file://moreretries.patch \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list