Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
@ 2015-04-12 11:25 Bernd Kuhls
  2015-04-12 13:23 ` Yann E. MORIN
  2015-04-12 17:39 ` Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Bernd Kuhls @ 2015-04-12 11:25 UTC (permalink / raw)
  To: buildroot

Also add TARGET_MAKE_ENV to EXIM_BUILD_CMDS to enable access to our pkg-config.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
v3: Add comment about TARGET_MAKE_ENV (Baruch)
v2: Use pkg-config to detect openssl (Yann)

 package/exim/exim.mk |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/package/exim/exim.mk b/package/exim/exim.mk
index f39445d..67dbd64 100644
--- a/package/exim/exim.mk
+++ b/package/exim/exim.mk
@@ -9,7 +9,7 @@ EXIM_SOURCE = exim-$(EXIM_VERSION).tar.bz2
 EXIM_SITE = ftp://ftp.exim.org/pub/exim/exim4
 EXIM_LICENSE = GPLv2+
 EXIM_LICENSE_FILES = LICENCE
-EXIM_DEPENDENCIES = pcre berkeleydb
+EXIM_DEPENDENCIES = pcre berkeleydb host-pkgconf
 
 # Modify a variable value. It must already exist in the file, either
 # commented or not.
@@ -62,6 +62,14 @@ define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
 endef
 endif
 
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+EXIM_DEPENDENCIES += openssl
+define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
+	$(call exim-config-change,SUPPORT_TLS,yes)
+	$(call exim-config-change,USE_OPENSSL_PC,openssl)
+endef
+endif
+
 # this specific toolchain lacks libnsl
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_SYNOPSYS_ARC_2014_12),y)
 define EXIM_REMOVE_LIBNSL_FROM_MAKEFILE
@@ -89,6 +97,7 @@ define EXIM_CONFIGURE_CMDS
 	$(EXIM_USE_DEFAULT_CONFIG_FILE)
 	$(EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT)
 	$(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV)
+	$(EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL)
 	$(EXIM_CONFIGURE_TOOLCHAIN)
 endef
 endif # CUSTOM_CONFIG
@@ -101,7 +110,7 @@ endif
 # "The -j (parallel) flag must not be used with make"
 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
 define EXIM_BUILD_CMDS
-	build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS)
+	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS)
 endef
 
 # Need to replicate the LFLAGS in install, as exim still wants to build
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
  2015-04-12 11:25 [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support Bernd Kuhls
@ 2015-04-12 13:23 ` Yann E. MORIN
  2015-04-12 13:44   ` Yann E. MORIN
  2015-04-12 17:39 ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2015-04-12 13:23 UTC (permalink / raw)
  To: buildroot

Bernd, All,

On 2015-04-12 13:25 +0200, Bernd Kuhls spake thusly:
> Also add TARGET_MAKE_ENV to EXIM_BUILD_CMDS to enable access to our pkg-config.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[build-tested only]
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Note that I was not able to test for static builds, because exim is
already broken in that case; this defconfig does not build:

    BR2_arm=y
    BR2_cortex_a7=y
    BR2_STATIC_LIBS=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_PACKAGE_OPENSSL=y
    BR2_PACKAGE_EXIM=y

and fails with this error message:

    /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc
    /arm-linux-musleabi/4.8.3/../../../../arm-linux-musleabi/bin/ld:
    cannot find -lnsl

That's because musl does not provide libnsl. But exim does not disable
libnsl.

A further fix would be to remove use of libnsl when the C library is not
glibc.

This is obviously not related to your patch, however.

Regards,
Yann E. MORIN.

> ---
> v3: Add comment about TARGET_MAKE_ENV (Baruch)
> v2: Use pkg-config to detect openssl (Yann)
> 
>  package/exim/exim.mk |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/package/exim/exim.mk b/package/exim/exim.mk
> index f39445d..67dbd64 100644
> --- a/package/exim/exim.mk
> +++ b/package/exim/exim.mk
> @@ -9,7 +9,7 @@ EXIM_SOURCE = exim-$(EXIM_VERSION).tar.bz2
>  EXIM_SITE = ftp://ftp.exim.org/pub/exim/exim4
>  EXIM_LICENSE = GPLv2+
>  EXIM_LICENSE_FILES = LICENCE
> -EXIM_DEPENDENCIES = pcre berkeleydb
> +EXIM_DEPENDENCIES = pcre berkeleydb host-pkgconf
>  
>  # Modify a variable value. It must already exist in the file, either
>  # commented or not.
> @@ -62,6 +62,14 @@ define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
>  endef
>  endif
>  
> +ifeq ($(BR2_PACKAGE_OPENSSL),y)
> +EXIM_DEPENDENCIES += openssl
> +define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
> +	$(call exim-config-change,SUPPORT_TLS,yes)
> +	$(call exim-config-change,USE_OPENSSL_PC,openssl)
> +endef
> +endif
> +
>  # this specific toolchain lacks libnsl
>  ifeq ($(BR2_TOOLCHAIN_EXTERNAL_SYNOPSYS_ARC_2014_12),y)
>  define EXIM_REMOVE_LIBNSL_FROM_MAKEFILE
> @@ -89,6 +97,7 @@ define EXIM_CONFIGURE_CMDS
>  	$(EXIM_USE_DEFAULT_CONFIG_FILE)
>  	$(EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT)
>  	$(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV)
> +	$(EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL)
>  	$(EXIM_CONFIGURE_TOOLCHAIN)
>  endef
>  endif # CUSTOM_CONFIG
> @@ -101,7 +110,7 @@ endif
>  # "The -j (parallel) flag must not be used with make"
>  # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
>  define EXIM_BUILD_CMDS
> -	build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS)
> +	$(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS)
>  endef
>  
>  # Need to replicate the LFLAGS in install, as exim still wants to build
> -- 
> 1.7.10.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
  2015-04-12 13:23 ` Yann E. MORIN
@ 2015-04-12 13:44   ` Yann E. MORIN
  2015-04-12 13:47     ` Bernd Kuhls
  0 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2015-04-12 13:44 UTC (permalink / raw)
  To: buildroot

Bernd, All,

On 2015-04-12 15:23 +0200, Yann E. MORIN spake thusly:
[--SNIP--]
> Note that I was not able to test for static builds, because exim is
> already broken in that case; this defconfig does not build:
[--SNIP--]
> That's because musl does not provide libnsl. But exim does not disable
> libnsl.
> 
> A further fix would be to remove use of libnsl when the C library is not
> glibc.

Woops, wrong, uClibc also has libnsl...

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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
  2015-04-12 13:44   ` Yann E. MORIN
@ 2015-04-12 13:47     ` Bernd Kuhls
  2015-04-12 13:56       ` Yann E. MORIN
  0 siblings, 1 reply; 7+ messages in thread
From: Bernd Kuhls @ 2015-04-12 13:47 UTC (permalink / raw)
  To: buildroot

"Yann E. MORIN" <yann.morin.1998@free.fr> wrote in 
news:20150412134418.GA21018 at free.fr:

>> A further fix would be to remove use of libnsl when the C library is not
>> glibc.
> 
> Woops, wrong, uClibc also has libnsl...

Hi,

but it is only a stub library without any function:

http://git.uclibc.org/uClibc/tree/docs/Glibc_vs_uClibc_Differences.txt

"uClibc provides a stub libnsl, but has no actual support for Network 
Information Service (NIS)."

Right now I am testing something like this:

-# this specific toolchain lacks libnsl
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_SYNOPSYS_ARC_2014_12),y)
+# only (e)glibc provides libnsl, remove -lnsl for all other toolchains
+# http://bugs.exim.org/show_bug.cgi?id=1564
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)

which fixes your compile bug, just to find another one...

smtp_in.c: In function ?smtp_start_session?:
smtp_in.c:1976:36: error: invalid application of ?sizeof? to incomplete type 
?struct options?
     EXIM_SOCKLEN_T optlen = sizeof(struct ip_options) + MAX_IPOPTLEN;
                                    ^
smtp_in.c:2023:42: error: dereferencing pointer to incomplete type
       uschar *optstart = (uschar *)(ipopt->__data);
                                          ^
smtp_in.c:2053:54: error: dereferencing pointer to incomplete type
                inet_ntoa(*((struct in_addr *)(&(ipopt->faddr))))))

which I am trying to solve right now.

Regards, Bernd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
  2015-04-12 13:47     ` Bernd Kuhls
@ 2015-04-12 13:56       ` Yann E. MORIN
  2015-04-12 14:23         ` Bernd Kuhls
  0 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2015-04-12 13:56 UTC (permalink / raw)
  To: buildroot

Bernd, All,

On 2015-04-12 15:47 +0200, Bernd Kuhls spake thusly:
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote in 
> news:20150412134418.GA21018 at free.fr:
> 
> >> A further fix would be to remove use of libnsl when the C library is not
> >> glibc.
> > 
> > Woops, wrong, uClibc also has libnsl...
> 
> Hi,
> 
> but it is only a stub library without any function:
> 
> http://git.uclibc.org/uClibc/tree/docs/Glibc_vs_uClibc_Differences.txt
> 
> "uClibc provides a stub libnsl, but has no actual support for Network 
> Information Service (NIS)."
> 
> Right now I am testing something like this:
> 
> -# this specific toolchain lacks libnsl
> -ifeq ($(BR2_TOOLCHAIN_EXTERNAL_SYNOPSYS_ARC_2014_12),y)
> +# only (e)glibc provides libnsl, remove -lnsl for all other toolchains
> +# http://bugs.exim.org/show_bug.cgi?id=1564
> +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
> 
> which fixes your compile bug, just to find another one...
> 
> smtp_in.c: In function ?smtp_start_session?:
> smtp_in.c:1976:36: error: invalid application of ?sizeof? to incomplete type 
> ?struct options?
>      EXIM_SOCKLEN_T optlen = sizeof(struct ip_options) + MAX_IPOPTLEN;
>                                     ^
> smtp_in.c:2023:42: error: dereferencing pointer to incomplete type
>        uschar *optstart = (uschar *)(ipopt->__data);
>                                           ^
> smtp_in.c:2053:54: error: dereferencing pointer to incomplete type
>                 inet_ntoa(*((struct in_addr *)(&(ipopt->faddr))))))

Yup, got the same while investigating, too.

> which I am trying to solve right now.

Well, would it not be much simpler to just ditch support for static
builds in exim? I.e. mark it as depends on !static .

Surely, static is for those few fronge architecures, and I doubt running
a mail server on those is a common use-case...

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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
  2015-04-12 13:56       ` Yann E. MORIN
@ 2015-04-12 14:23         ` Bernd Kuhls
  0 siblings, 0 replies; 7+ messages in thread
From: Bernd Kuhls @ 2015-04-12 14:23 UTC (permalink / raw)
  To: buildroot

"Yann E. MORIN" <yann.morin.1998@free.fr> wrote in
news:20150412135643.GB21018 at free.fr: 

>> smtp_in.c: In function ?smtp_start_session?:
>> smtp_in.c:1976:36: error: invalid application of ?sizeof? to incomplete
>> type ?struct options?
>>      EXIM_SOCKLEN_T optlen = sizeof(struct ip_options) + MAX_IPOPTLEN;
> 
> Well, would it not be much simpler to just ditch support for static
> builds in exim? I.e. mark it as depends on !static .

Hi,

this compile bug is unrelated to static/shared linking, here is a fix 
proposal: http://patchwork.ozlabs.org/patch/460496/

For the nsl problem: http://patchwork.ozlabs.org/patch/460495/

Regards, Bernd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support
  2015-04-12 11:25 [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support Bernd Kuhls
  2015-04-12 13:23 ` Yann E. MORIN
@ 2015-04-12 17:39 ` Thomas Petazzoni
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2015-04-12 17:39 UTC (permalink / raw)
  To: buildroot

Dear Bernd Kuhls,

On Sun, 12 Apr 2015 13:25:42 +0200, Bernd Kuhls wrote:
> Also add TARGET_MAKE_ENV to EXIM_BUILD_CMDS to enable access to our pkg-config.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
> v3: Add comment about TARGET_MAKE_ENV (Baruch)
> v2: Use pkg-config to detect openssl (Yann)

Applied, thanks.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-12 17:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 11:25 [Buildroot] [PATCH v3 1/1] package/exim: Add optional OpenSSL support Bernd Kuhls
2015-04-12 13:23 ` Yann E. MORIN
2015-04-12 13:44   ` Yann E. MORIN
2015-04-12 13:47     ` Bernd Kuhls
2015-04-12 13:56       ` Yann E. MORIN
2015-04-12 14:23         ` Bernd Kuhls
2015-04-12 17:39 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox