Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v6] leveldb: new package
Date: Tue, 3 Feb 2015 10:59:51 +0100	[thread overview]
Message-ID: <20150203105951.46ac2d50@free-electrons.com> (raw)
In-Reply-To: <20150202161408.GA17739@free.fr>

Dear Yann E. MORIN,

On Mon, 2 Feb 2015 17:14:08 +0100, Yann E. MORIN wrote:

> Rather than adding this in the package's Makefile, can't we just do the
> installation manually in the .mk file, that is, something like:
> 
>     ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
>     define LEVELDB_INSTALL_STATIC
>         $(INSTALL) -D -m 0644 $(@D)/lib/libleveldb.a $(1)/usr/lib/libleveldb.a
>     endef
>     endif
>     ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
>     define LEVELDB_INSTALL_SHARED
>         $(INSTALL) -D -m 0644 $(@D)/lib/libleveldb.so $(1)/usr/lib/libleveldb.so
>         ln -sf libleveldb.so $(1)/usr/lib/libleveldb.so.VERSION
>     endef
>     endif
> 
>     define LEVELDB_INSTALL_STAGING_CMDS
>         $(call LEVELDB_INSTALL_STATIC,$(STAGING_DIR))
>         $(call LEVELDB_INSTALL_SHARED,$(STAGING_DIR))
>         install -D -m 0644 $(@D)/leveldb.h $(STAGING_DIR)/usr/include/leveldb.h
>     endef
> 
>     define LEVELDB_INSTALL_TARGET_CMDS
>         $(call LEVELDB_INSTALL_SHARED,$(STAGING_DIR))
>     endef

Well, I actually asked Steve to write patches that can be submitted
upstream (leveldb upstream is active) rather than solving all problems
in the Buildroot .mk file.


> > +-CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
> > +-CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
> > ++override CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
> > ++override CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
> > + 
> > +-LDFLAGS += $(PLATFORM_LDFLAGS)
> > +-LIBS += $(PLATFORM_LIBS)
> > ++override LDFLAGS += $(PLATFORM_LDFLAGS)
> > ++override LIBS += $(PLATFORM_LIBS)
> > + 
> > + LIBOBJECTS = $(SOURCES:.cc=.o)
> > + MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o)
> 
> I think this would not be needed if you do:
> 
>     define LEVELDB_BUILD_CMDS
>         $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
>             $(LEVELDB_MAKE_ARGS) -C $(@D)
>     endef
> 
> i.e. pass the TARGET_CONFIGURE_OPTS in the environment, and not as make
> arguments.

Aaah, yes, indeed. When passed in the environment, a normal += work,
and you don't need the override.


> > +# Disable the static library for shared only build
> > +ifeq ($(BR2_SHARED_LIBS),y)
> > +LEVELDB_MAKE_ARGS += LIBRARY=
> > +endif
> > +
> > +# Disable the shared library for static only build
> > +ifeq ($(BR2_STATIC_LIBS),y)
> > +LEVELDB_MAKE_ARGS += SHARED=
> > +endif
> 
> I would prefer we actually we use direct logic, like:
> 
>     ifeq ($(BR2_STATIC_LIBS),)
>     LEVELDB_MAKE_ARGS += SHARED=
>     endif
> 
>     ifeq ($(BR2_SHARED_LIBS),)
>     LEVELDB_MAKE_ARGS += LIBRARY=
>     endif

Well I actually asked for the opposite, in order to use positive logic,
i.e test BR2_SHARED_LIBS==y.

> > +define LEVELDB_INSTALL_TARGET_CMDS
> > +	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
> > +		INSTALL_ROOT=$(TARGET_DIR) INSTALL_PREFIX=/usr \
> > +		$(LEVELDB_MAKE_ARGS) -C $(@D) install
> > +endef
> 
> And adapt the install commands as explained above.

Or not, depending on whether we want the patch to be upstreamed.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-02-03  9:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 10:53 [Buildroot] [PATCH v6] leveldb: new package Steve James
2015-02-02 16:14 ` Yann E. MORIN
2015-02-03  9:59   ` Thomas Petazzoni [this message]
2015-04-05 14:34 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150203105951.46ac2d50@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox