Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v1] motion: fix static linking of mysql with enabled libz library
Date: Tue, 25 Oct 2016 22:38:52 +0200	[thread overview]
Message-ID: <20161025223852.661271ae@gmx.net> (raw)
In-Reply-To: <20161025220356.2df4024c@free-electrons.com>

Hello Thomas,

On Tue, 25 Oct 2016 22:03:56 +0200, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> Hello,
> 
> On Tue, 25 Oct 2016 21:37:20 +0200, Peter Seiderer wrote:
> > Fixes ([1]):
> > 
> >   checking for mysql_init in -lmysqlclient... no
> >   configure: error: MySQL support can't build without MySQL libraries
> > 
> > [1] http://autobuild.buildroot.net/results/6cf/6cf38698a2a9a041ff375c01ae8898eace17cfb2
> > 
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> 
> Can I say how much I hate when packages don't use pkg-config ? :-)
> 
> 
> > +diff --git a/configure.ac b/configure.ac
> > +index 5782fd6..aa5d9dd 100644
> > +--- a/configure.ac
> > ++++ b/configure.ac
> > +@@ -618,8 +618,8 @@ else
> > + 		#LDFLAGS="-L$MYSQL_LIBDIR"
> > + 		saved_CFLAGS=$CFLAGS
> > + 		saved_LIBS=$LIBS
> > +-		CFLAGS="-I$MYSQL_INCDIR"
> > +-		LIBS="-L$MYSQL_LIBDIR"
> > ++		CFLAGS="-I$MYSQL_INCDIR $CFLAGS"
> > ++		LIBS="-L$MYSQL_LIBDIR $LIBS"
> > + 		AC_CHECK_LIB(mysqlclient,mysql_init,[
> > + 					TEMP_LIBS="$TEMP_LIBS -L$MYSQL_LIBDIR -lmysqlclient -lz"
> 
> Isn't it already linking with -lz here ?
> 
> Why is an additional -lz needed ?

No, the third argument of AC_CHECK_LIB is 'action-if-found', an additional library should be given as
fifth argument (see[2]:

  AC_CHECK_LIB (library, function, [action-if-found], [action-if-not-found], [other-libraries])

This -lz is only evaluated after the check (succeeds)...

Regards,
Peter

[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/Libraries.html

> 
> Thanks,
> 
> Thomas

  reply	other threads:[~2016-10-25 20:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 19:37 [Buildroot] [PATCH v1] motion: fix static linking of mysql with enabled libz library Peter Seiderer
2016-10-25 20:03 ` Thomas Petazzoni
2016-10-25 20:38   ` Peter Seiderer [this message]
2016-10-29 13:59 ` 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=20161025223852.661271ae@gmx.net \
    --to=ps.report@gmx.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