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 v2] rabbitmq-c: link against zlib and libintl
Date: Thu, 28 Jan 2016 12:06:00 +0100	[thread overview]
Message-ID: <20160128120600.5d445d77@free-electrons.com> (raw)
In-Reply-To: <CACt6We30Dq0ztHQbO2x0+MyC2gGXW8LkJdMVH2biD4_utBetKw@mail.gmail.com>

Joris,

(Please don't top post, this is considered bad practice on most mailing
list.)

I'm adding Samuel Martin in Cc, he is our CMake expert :)

On Thu, 28 Jan 2016 10:11:21 +0100, Joris Lijssens wrote:

> I know that libcrypto is using zlib and libpopt is using libintl, but i
> have no idea how to query opensll and popt in cmake. Can you give some
> pointers?

So, for the libcrypto -> zlib case, I had a look. rabbitmq-c properly
uses find_package(OpenSSL), which uses pkg-config internally, and there
knows about the -lz dependency. Building the rabbitmq-c library (in the
librabbitmq/ directory) works fine.

However, the problem occurs when linking the tools (in the tools/
directory): they are linked against the librabbitmq library. They know
that they should link with -lssl -lcrypto (and I couldn't figure out
how) but they don't know they should link with -lz.

Samuel, what is the usual solution for such situations with CMake ?

If you want to reproduce by yourself, here is a minimal defconfig:

BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2015.11-rc1-71-g90d1299.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_14=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_RABBITMQ_C=y
BR2_PACKAGE_POPT=y
# BR2_TARGET_ROOTFS_TAR is not set

(This one produces only the libcrypto -> zlib problem. To produce the
popt problem, you need to add BR2_PACKAGE_GETTEXT=y).

The popt problem is exactly the same: pkg-config is used to detect
popt,  popt.pc contains -lintl, but it isn't used when linking the
tools.

Samuel, help :-)

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

      reply	other threads:[~2016-01-28 11:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  8:45 [Buildroot] [PATCH v2] rabbitmq-c: link against zlib and libintl Joris Lijssens
2016-01-28  8:59 ` Thomas Petazzoni
2016-01-28  9:11   ` Joris Lijssens
2016-01-28 11:06     ` Thomas Petazzoni [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=20160128120600.5d445d77@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