summaryrefslogtreecommitdiff
path: root/package/exim
diff options
context:
space:
mode:
authorBernd Kuhls <bernd.kuhls@t-online.de>2015-07-25 15:36:55 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-26 15:09:08 +0200
commit20f2627c4c0403f3b98f8b5ea470a24d3ac4ce83 (patch)
tree23997957192b06c583f393532081b78d9ce9e2f9 /package/exim
parent37ba45c6c2824a12a281a221b1730b7ee59a561d (diff)
package/exim: Fix compilation error with musl
Fixes 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 misdetects the needed style for ip_options, only OPTSTYLE == 2 works. Since musl does not provide any macro[1] to detect it we need to pretend to be darwin in order to fix the compile bug. [1] http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> [Luca: simplify by using only one sed invocation] Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/exim')
-rw-r--r--package/exim/exim.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/exim/exim.mk b/package/exim/exim.mk
index ed6a309972..002ffd294f 100644
--- a/package/exim/exim.mk
+++ b/package/exim/exim.mk
@@ -80,6 +80,15 @@ define EXIM_REMOVE_LIBNSL_FROM_MAKEFILE
endef
endif
+# musl does not provide struct ip_options nor struct ip_opts (but it is
+# available with both glibc and uClibc)
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+define EXIM_FIX_IP_OPTIONS_FOR_MUSL
+ $(SED) 's/#define GLIBC_IP_OPTIONS/#define DARWIN_IP_OPTIONS/' \
+ $(@D)/OS/os.h-Linux
+endef
+endif
+
define EXIM_CONFIGURE_TOOLCHAIN
$(call exim-config-add,CC,$(TARGET_CC))
$(call exim-config-add,CFLAGS,$(TARGET_CFLAGS))
@@ -88,6 +97,7 @@ define EXIM_CONFIGURE_TOOLCHAIN
$(call exim-config-add,HOSTCC,$(HOSTCC))
$(call exim-config-add,HOSTCFLAGS,$(HOSTCFLAGS))
$(EXIM_REMOVE_LIBNSL_FROM_MAKEFILE)
+ $(EXIM_FIX_IP_OPTIONS_FOR_MUSL)
endef
ifneq ($(call qstrip,$(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE)),)