diff mbox

syslog-ng: Specify location of libesmtp

Message ID 1445328991-29416-1-git-send-email-judge.packham@gmail.com
State Accepted
Commit 6e088b101d3981c0b57250a70e45a0fe349172bf
Headers show

Commit Message

Chris Packham Oct. 20, 2015, 8:16 a.m. UTC
If --with-libesmtp is omitted a host tool is invoked to detect the
location of the library and headers, which is obviously the wrong thing
for a cross-compile environment. Explicitly add --with-libesmtp to
resolve this.

Fixes:
http://git.buildroot.net/buildroot/commit/?id=539acb7500588d0a277357cf831c9f25f770578d
http://git.buildroot.net/buildroot/commit/?id=01f41585a78406f6e830d5eaf4413a983812a299

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
 package/syslog-ng/syslog-ng.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Korsgaard Oct. 20, 2015, 9:36 a.m. UTC | #1
>>>>> "Chris" == Chris Packham <judge.packham@gmail.com> writes:

 > If --with-libesmtp is omitted a host tool is invoked to detect the
 > location of the library and headers, which is obviously the wrong thing
 > for a cross-compile environment. Explicitly add --with-libesmtp to
 > resolve this.

 > Fixes:
 > http://git.buildroot.net/buildroot/commit/?id=539acb7500588d0a277357cf831c9f25f770578d
 > http://git.buildroot.net/buildroot/commit/?id=01f41585a78406f6e830d5eaf4413a983812a299

 > Signed-off-by: Chris Packham <judge.packham@gmail.com>

Committed, thanks.
Chris Packham Oct. 20, 2015, 9:40 a.m. UTC | #2
Hi Peter,

On Tue, Oct 20, 2015 at 10:36 PM, Peter Korsgaard <peter@korsgaard.com> wrote:
>>>>>> "Chris" == Chris Packham <judge.packham@gmail.com> writes:
>
>  > If --with-libesmtp is omitted a host tool is invoked to detect the
>  > location of the library and headers, which is obviously the wrong thing
>  > for a cross-compile environment. Explicitly add --with-libesmtp to
>  > resolve this.
>
>  > Fixes:
>  > http://git.buildroot.net/buildroot/commit/?id=539acb7500588d0a277357cf831c9f25f770578d
>  > http://git.buildroot.net/buildroot/commit/?id=01f41585a78406f6e830d5eaf4413a983812a299

Oops this is the url of the HEAD commit not the url of the build
result. This should have been

  http://autobuild.buildroot.net/results/b82/b8224ea52d962c62ead367343d68bf98a4b9e883/
  http://autobuild.buildroot.net/results/445/445270aed4c79cde75d54d49d13ffad9d684c61b/

Probably doesn't matter but If you want you could revert and fix up
the commit message to correct the URL.
Peter Korsgaard Oct. 20, 2015, 10:03 a.m. UTC | #3
>>>>> "Chris" == Chris Packham <judge.packham@gmail.com> writes:

Hi,

>> 
 >> > Fixes:
 >> > http://git.buildroot.net/buildroot/commit/?id=539acb7500588d0a277357cf831c9f25f770578d
 >> > http://git.buildroot.net/buildroot/commit/?id=01f41585a78406f6e830d5eaf4413a983812a299

 > Oops this is the url of the HEAD commit not the url of the build
 > result. This should have been

 >   http://autobuild.buildroot.net/results/b82/b8224ea52d962c62ead367343d68bf98a4b9e883/
 >   http://autobuild.buildroot.net/results/445/445270aed4c79cde75d54d49d13ffad9d684c61b/

 > Probably doesn't matter but If you want you could revert and fix up
 > the commit message to correct the URL.

Gaah, you're right - I can't believe I didn't notice that :/

I'll leave it as it is.
Peter Seiderer Oct. 20, 2015, 6:57 p.m. UTC | #4
Hello Chris,

On Tue, 20 Oct 2015 21:16:31 +1300, Chris Packham <judge.packham@gmail.com> wrote:

> If --with-libesmtp is omitted a host tool is invoked to detect the
> location of the library and headers, which is obviously the wrong thing
> for a cross-compile environment. Explicitly add --with-libesmtp to
> resolve this.
> 
> Fixes:
> http://git.buildroot.net/buildroot/commit/?id=539acb7500588d0a277357cf831c9f25f770578d
> http://git.buildroot.net/buildroot/commit/?id=01f41585a78406f6e830d5eaf4413a983812a299
> 
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
> ---
>  package/syslog-ng/syslog-ng.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk
> index 7371060..2bbace8 100644
> --- a/package/syslog-ng/syslog-ng.mk
> +++ b/package/syslog-ng/syslog-ng.mk
> @@ -37,6 +37,7 @@ endif
>  ifeq ($(BR2_PACKAGE_LIBESMTP),y)
>  SYSLOG_NG_DEPENDENCIES += libesmtp
>  SYSLOG_NG_CONF_OPTS += --enable-smtp
> +SYSLOG_NG_CONF_OPTS += --with-libesmtp="$(STAGING_DIR)/usr"
>  else
>  SYSLOG_NG_CONF_OPTS += --disable-smtp
>  endif

The buildroot package libestmp provides a libesmtp-config script, but
it is installed into

	host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/bin/libesmtp-config

where it is not found by the syslog-ng configure script... 

Would a more portable solution be to add this search path (or fix the install
location of libestmp-config) for the syslog-ng configure call (libesmtp-config
--libs gives '-pthread -L[...]/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib
-lesmtp -lssl -lcrypto -ldl')?

Regards,
Peter
Peter Korsgaard Oct. 20, 2015, 7:32 p.m. UTC | #5
>>>>> "Peter" == Peter Seiderer <ps.report@gmx.net> writes:

Hi,

 >> SYSLOG_NG_CONF_OPTS += --disable-smtp
 >> endif

 > The buildroot package libestmp provides a libesmtp-config script, but
 > it is installed into

 > 	host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/bin/libesmtp-config

 > where it is not found by the syslog-ng configure script... 

Yes, $(STAGING_DIR)/usr/bin, similar to the other *-config scripts.

 > Would a more portable solution be to add this search path (or fix the install
 > location of libestmp-config) for the syslog-ng configure call (libesmtp-config
 > --libs gives '-pthread -L[...]/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib
 > -lesmtp -lssl -lcrypto -ldl')?

$(STAGING_DIR)/usr/bin contains binaries for the target (and *-config
scripts), so it shouldn't be added to the path, but another approach is
indeed to fix the configure script to look elsewhere for the script,
similar to how a bunch of packages allow the path to sdl-config to be
overridden through the SDL_CONFIG environment variable.
Chris Packham Oct. 21, 2015, 7:41 a.m. UTC | #6
On Wed, Oct 21, 2015 at 8:32 AM, Peter Korsgaard <peter@korsgaard.com> wrote:
>>>>>> "Peter" == Peter Seiderer <ps.report@gmx.net> writes:
>
> Hi,
>
>  >> SYSLOG_NG_CONF_OPTS += --disable-smtp
>  >> endif
>
>  > The buildroot package libestmp provides a libesmtp-config script, but
>  > it is installed into
>
>  >      host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/bin/libesmtp-config
>
>  > where it is not found by the syslog-ng configure script...
>
> Yes, $(STAGING_DIR)/usr/bin, similar to the other *-config scripts.
>
>  > Would a more portable solution be to add this search path (or fix the install
>  > location of libestmp-config) for the syslog-ng configure call (libesmtp-config
>  > --libs gives '-pthread -L[...]/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib
>  > -lesmtp -lssl -lcrypto -ldl')?
>
> $(STAGING_DIR)/usr/bin contains binaries for the target (and *-config
> scripts), so it shouldn't be added to the path, but another approach is
> indeed to fix the configure script to look elsewhere for the script,
> similar to how a bunch of packages allow the path to sdl-config to be
> overridden through the SDL_CONFIG environment variable.

The way the test is implemented in configure.ac libestmp-config is
invoked directly so it would need to be on the path. Or I could look
at an upstream patch to change this to something that can be
overridden. I'd almost prefer if libesmtp had pkg-config support which
integrates better with autotools and buildroot has existing support
for.
Thomas Petazzoni Oct. 21, 2015, 8:27 a.m. UTC | #7
Dear Chris Packham,

On Wed, 21 Oct 2015 20:41:54 +1300, Chris Packham wrote:

> The way the test is implemented in configure.ac libestmp-config is
> invoked directly so it would need to be on the path. Or I could look
> at an upstream patch to change this to something that can be
> overridden. I'd almost prefer if libesmtp had pkg-config support which
> integrates better with autotools and buildroot has existing support
> for.

As Peter suggested, the way we usually fix that is by replacing the
direct invocation of <foo>-config in configure.ac by
${FOO_CONFIG:foo-config}, so that it can be overridden in the
environment.

However, the current --with-<foo> solution that you have used is fine
for me. We do use this solution for numerous packages, so I'm fine with
using it as well for syslog-ng.

Best regards,

Thomas
Peter Korsgaard Oct. 21, 2015, 9:45 a.m. UTC | #8
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Dear Chris Packham,
 > On Wed, 21 Oct 2015 20:41:54 +1300, Chris Packham wrote:

 >> The way the test is implemented in configure.ac libestmp-config is
 >> invoked directly so it would need to be on the path. Or I could look
 >> at an upstream patch to change this to something that can be
 >> overridden. I'd almost prefer if libesmtp had pkg-config support which
 >> integrates better with autotools and buildroot has existing support
 >> for.

 > As Peter suggested, the way we usually fix that is by replacing the
 > direct invocation of <foo>-config in configure.ac by
 > ${FOO_CONFIG:foo-config}, so that it can be overridden in the
 > environment.

 > However, the current --with-<foo> solution that you have used is fine
 > for me. We do use this solution for numerous packages, so I'm fine with
 > using it as well for syslog-ng.

Agreed. The only potential issue is for static linking as
libestmp-config --libs may return more libraries than the hardcoded
-lesmtp, but I guess the autobuilders will tell us if that is the case.
diff mbox

Patch

diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk
index 7371060..2bbace8 100644
--- a/package/syslog-ng/syslog-ng.mk
+++ b/package/syslog-ng/syslog-ng.mk
@@ -37,6 +37,7 @@  endif
 ifeq ($(BR2_PACKAGE_LIBESMTP),y)
 SYSLOG_NG_DEPENDENCIES += libesmtp
 SYSLOG_NG_CONF_OPTS += --enable-smtp
+SYSLOG_NG_CONF_OPTS += --with-libesmtp="$(STAGING_DIR)/usr"
 else
 SYSLOG_NG_CONF_OPTS += --disable-smtp
 endif