Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/3] package/rsyslog: Fix linking against postgresql
Date: Sat, 11 Apr 2015 14:07:39 +0200	[thread overview]
Message-ID: <20150411120739.GF4221@free.fr> (raw)
In-Reply-To: <XnsA4798AC8357A8berndkuhlsPkbjNfxxIA@bernd-kuhls.de>

Bernd, All,

On 2015-04-11 13:38 +0200, Bernd Kuhls spake thusly:
> Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote
> in news:20150411124226.726fde30 at free-electrons.com: 
> 
> > Dear Bernd Kuhls,
> > 
> > On Sat, 11 Apr 2015 09:52:16 +0200, Bernd Kuhls wrote:
> >> Configure misses libm and libpthread when checking for postgresql.
> >> Patching configure.ac did not fix the problem so we patch configure
> >> directly, 
> > 
> > Hum, why?
> > 
> > It seems a bit backward to remove AUTORECONF = YES to then add a patch
> > that modifies the configure script directly.
> 
> Hi,
> 
> I tried to add "-lm -lpthread" to line 615 in configure.ac:
> 
> -     PGSQL_LIBS="-L`$PG_CONFIG --libdir` -lpq"
> +     PGSQL_LIBS="-L`$PG_CONFIG --libdir` -lm -lpthread -lpq"
> 
> Original configure, line 17388, looks like this before autoreconf
> 
> LIBS="-lpq -L`$PG_CONFIG --libdir`
> 
> and, as line 17865, it still looks the same causing postgresql detection
> to fail... 
> 
> Please note that -lpq is on the first position in this variable, I have no
> idea how to change this line in configure without patching that file
> directly. 

That's because this line is generated from the 5th argument to
AC_CHECK_LIB, which contains the 'other-libraries':

    https://www.gnu.org/software/autoconf/manual/autoconf.html#Libraries

    If linking with library results in unresolved symbols that would be
    resolved by linking with additional libraries, give those libraries
    as the other-libraries argument, separated by spaces: e.g., -lXt
    -lX11. Otherwise, this macro may fail to detect that library is
    present, because linking the test program can fail with unresolved
    symbols. The other-libraries argument should be limited to cases
    where it is desirable to test for one library in the presence of
    another that is not already in LIBS.

The part you wanted change is the third argument of AC_CHECK_LIB, which
is the 'action-if-found', and thus gets run only if the check is OK,
which can occure, given that those extra libs are not passed in
'other-libraries'.

The correct and definitive solution would be to fully use pg_config to
get the libraries we need to link to.

Unfortunately, pg_config is a binary, so we provide our own minimalist
one, which does not implement --libs.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2015-04-11 12:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11  7:52 [Buildroot] [PATCH 1/3] package/rsyslog: Autoreconf is not necessary anymore Bernd Kuhls
2015-04-11  7:52 ` [Buildroot] [PATCH 2/3] package/rsyslog: Fix linking against postgresql Bernd Kuhls
2015-04-11 10:05   ` Yann E. MORIN
2015-04-11 10:42   ` Thomas Petazzoni
2015-04-11 11:38     ` Bernd Kuhls
2015-04-11 12:07       ` Yann E. MORIN [this message]
2015-04-11 12:15         ` Thomas Petazzoni
2015-04-11 12:23           ` Yann E. MORIN
2015-08-09 10:55             ` Bernd Kuhls
2015-08-09 11:16               ` Thomas Petazzoni
2015-04-11  7:52 ` [Buildroot] [PATCH 3/3] package/rsyslog: bump version to 8.9.0 Bernd Kuhls
2015-04-11 18:00   ` Thomas Petazzoni
2015-04-11  9:17 ` [Buildroot] [PATCH 1/3] package/rsyslog: Autoreconf is not necessary anymore Yann E. MORIN

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=20150411120739.GF4221@free.fr \
    --to=yann.morin.1998@free.fr \
    --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