From: Steve James <ste@junkomatic.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v5] leveldb: new package
Date: Mon, 12 Jan 2015 17:43:09 +0000 [thread overview]
Message-ID: <201501121743.09235.ste@junkomatic.net> (raw)
In-Reply-To: <20150110111950.45e3baf2@free-electrons.com>
On Saturday 10 Jan 2015 10:19:50 Thomas Petazzoni wrote:
> Dear Steve James,
>
> Thanks for this new version!
>
--snip--
> > +Subject: [PATCH 1/1] facilitate integration into Buildroot:
> > + - Add Buildroot TARGET_OS
> > + - Allow flags from the environment
> > + - Add install recipe
>
> There are three different things being done, so it should be three
> separate patches, especially for upstream submission.
OK.
> However, I believe adding a Buildroot TARGET_OS is a mistake, and has
> no chance of being merged upstream. Buildroot is not an OS. It builds
> Linux based systems, so the existing TARGET_OS=Linux should work just
> fine for Buildroot.
Hmm. Yes TARGET_OS=Linux should be enough, but I failed to make this work with
Leveldb's home-brew autoconf script. Unfortunately that was a while ago so I
can't added any data here. It may just be that I was simply failing to pass
the target compiler path to the configure script...
>
> > +-CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
--snip--
> > ++override LIBS += $(PLATFORM_LIBS)
>
> So this should be one patch.
OK, now submitted upstream.
> > + LIBOBJECTS = $(SOURCES:.cc=.o)
> > + MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o)
--snip--
>
> This should be another patch.
OK, now submitted upstream.
> > ++ Buildroot)
> > ++ PLATFORM=OS_LINUX
> > ++ COMMON_FLAGS="$MEMCMP_FLAG -pthread -DOS_LINUX
> > -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT"
> > ++ PLATFORM_LDFLAGS="-pthread"
> > ++ PLATFORM_CXXFLAGS="-std=c++0x"
> > ++ PORT_FILE=port/port_posix.cc
> > ++ CROSS_COMPILE=true
> > ++ ;;
>
> This should not be needed.
The configure-style script uses the usual method of compiling test programs to
detect target features and libraries. The one exception to this method is when
TARGET_OS=Android. In this case the compile options are set in-line in the
case statement. What I have done is re-use the Android method for Buildroot.
Note that TARGET_OS does not appear in the code: PLATFORM is set to OS_LINUX
when TARGET_OS=Linux|CYGWIN_*|Buildroot and it is PLATFORM that affects the
code.
So something is needed somewhere to capture the correct combination of flags
for use with Buildroot. My first attempt of putting them in leveldb.mk was
ugly. At least my later proposed changes for Buildroot are simple, confined to
a new case statement and follow the precedent set by Android.
That said, I will try once more to make the the configure script work as
intended.
> > +ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),)
> > +# Dynamic library not required
> > +LEVELDB_MAKE_ARGS += SHARED=
> > +endif
> > +
> > +ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),)
> > +# Static library not required
> > +LEVELDB_MAKE_ARGS += LIBRARY=
> > +endif
>
> I found this a bit odd to read, maybe:
>
> # 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
>
> is more readable.
Agreed, that's better.
> > +ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
>
> Not needed, just call install unconditionally. It will install the
> static library to $(TARGET_DIR), but that's not a problem, as it gets
> removed afterwards by Buildroot anyway.
OK.
Thanks,
Steve.
prev parent reply other threads:[~2015-01-12 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-09 17:09 [Buildroot] [PATCH v5] leveldb: new package Steve James
2015-01-10 10:19 ` Thomas Petazzoni
2015-01-12 17:43 ` Steve James [this message]
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=201501121743.09235.ste@junkomatic.net \
--to=ste@junkomatic.net \
--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