[v2,1/3] leveldb: install memenv static library and header

Message ID 20180903072528.15744-2-gael.portay@savoirfairelinux.com
State New
Headers show
Series
  • qt5webkit: fix build issue using system leveldb
Related show

Commit Message

Gaël PORTAY Sept. 3, 2018, 7:25 a.m.
The project builds a tiny static library that consists of a single
symbol which creates an in-memory LevelDB database.

That library is not installed by default and may be used by other
projects.

This commit creates a config option that installs in the staging
directory the libmemenv.a static library and the memenv.h header file
when the option is set.

Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
---
 package/leveldb/Config.in  | 10 ++++++++++
 package/leveldb/leveldb.mk |  8 ++++++++
 2 files changed, 18 insertions(+)

Comments

Thomas Petazzoni Sept. 3, 2018, 8:43 a.m. | #1
Hello,

On Mon,  3 Sep 2018 03:25:26 -0400, Gaël PORTAY wrote:

> +ifdef BR2_PACKAGE_LEVELDB_MEMENV

Too much vacations here! :-) You have forgotten how Buildroot does this
normally:

ifeq ($(BR2_PACKAGE_LEVELDB_MEMENV),y)

> +define LEVELDB_INSTALL_MEMENV
> +	$(INSTALL) -m 0644 $(@D)/out-static/libmemenv.a $(STAGING_DIR)/usr/lib

-D option and full destination path please.

Thanks!

Thomas
Gaël PORTAY Sept. 3, 2018, 9:02 a.m. | #2
Thomas,

On Mon, Sep 03, 2018 at 10:43:38AM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Mon,  3 Sep 2018 03:25:26 -0400, Gaël PORTAY wrote:
> 
> > +ifdef BR2_PACKAGE_LEVELDB_MEMENV
> 
> Too much vacations here! :-) You have forgotten how Buildroot does this
> normally:
>
> ifeq ($(BR2_PACKAGE_LEVELDB_MEMENV),y)
>

... and I also forgot to add the Changes in the coverletter :(

> > +define LEVELDB_INSTALL_MEMENV
> > +	$(INSTALL) -m 0644 $(@D)/out-static/libmemenv.a $(STAGING_DIR)/usr/lib
> 
> -D option and full destination path please.
> 

Okay, I will resend a v3 later that day.

> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Regards,
Gaël

Patch

diff --git a/package/leveldb/Config.in b/package/leveldb/Config.in
index 163a75e8f2..4ceb2cfb5b 100644
--- a/package/leveldb/Config.in
+++ b/package/leveldb/Config.in
@@ -10,5 +10,15 @@  config BR2_PACKAGE_LEVELDB
 
 	  https://github.com/google/leveldb
 
+if BR2_PACKAGE_LEVELDB
+
+config BR2_PACKAGE_LEVELDB_MEMENV
+	bool "memenv"
+	help
+	  Installs memenv static library and header to create in-memory
+	  LevelDB database.
+
+endif
+
 comment "leveldb needs a toolchain w/ C++, threads"
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/leveldb/leveldb.mk b/package/leveldb/leveldb.mk
index 54942a0f27..c8c2e102c0 100644
--- a/package/leveldb/leveldb.mk
+++ b/package/leveldb/leveldb.mk
@@ -21,10 +21,18 @@  define LEVELDB_BUILD_CMDS
 		$(LEVELDB_MAKE_ARGS) -C $(@D)
 endef
 
+ifdef BR2_PACKAGE_LEVELDB_MEMENV
+define LEVELDB_INSTALL_MEMENV
+	$(INSTALL) -m 0644 $(@D)/out-static/libmemenv.a $(STAGING_DIR)/usr/lib
+	$(INSTALL) -D -m 0644 $(@D)/helpers/memenv/memenv.h $(STAGING_DIR)/usr/include/helpers/memenv/memenv.h
+endef
+endif
+
 define LEVELDB_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) \
 		INSTALL_ROOT=$(STAGING_DIR) INSTALL_PREFIX=/usr \
 		$(LEVELDB_MAKE_ARGS) -C $(@D) install
+	$(LEVELDB_INSTALL_MEMENV)
 endef
 
 define LEVELDB_INSTALL_TARGET_CMDS