aboutsummaryrefslogtreecommitdiff
path: root/package/exim/exim.mk
diff options
context:
space:
mode:
authorGravatar Luca Ceresoli <luca@lucaceresoli.net>2014-07-04 17:56:24 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-15 21:29:13 +0200
commita27c0117a471e9cb7fe491923572eed3dd03907a (patch)
treefe7eb048d8b54e110203fc63a7cb68de59fd0dcc /package/exim/exim.mk
parentfbcfbf66b5c8c2753df69d6f7de2cc857cf69ce1 (diff)
downloadbuildroot-a27c0117a471e9cb7fe491923572eed3dd03907a.tar.gz
buildroot-a27c0117a471e9cb7fe491923572eed3dd03907a.tar.bz2
exim: allow using a custom configuration file
exim has lots of options configurable before the build process. It's not useful to have all of them exposed in Buildroot, yet users may need to tweak them. Allow the user to pass an entire configuration file to make exim totally reconfigurable without bloating the Buildroot menus. [Thomas: remove "for exim" from Config.in options prompts.] Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/exim/exim.mk')
-rw-r--r--package/exim/exim.mk25
1 files changed, 24 insertions, 1 deletions
diff --git a/package/exim/exim.mk b/package/exim/exim.mk
index 0f9c6af784..2e51a0d9b9 100644
--- a/package/exim/exim.mk
+++ b/package/exim/exim.mk
@@ -30,7 +30,12 @@ define exim-config-add # variable-name, variable-value
echo "$1=$2" >>$(@D)/Local/Makefile
endef
-define EXIM_CONFIGURE_CMDS
+define EXIM_USE_CUSTOM_CONFIG_FILE
+ $(INSTALL) -m 0644 $(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE) \
+ $(@D)/Local/Makefile
+endef
+
+define EXIM_USE_DEFAULT_CONFIG_FILE
$(INSTALL) -m 0644 $(@D)/src/EDITME $(@D)/Local/Makefile
$(call exim-config-change,BIN_DIRECTORY,/usr/sbin)
$(call exim-config-change,CONFIGURE_FILE,/etc/exim/configure)
@@ -41,6 +46,9 @@ define EXIM_CONFIGURE_CMDS
$(call exim-config-change,PCRE_CONFIG,no)
$(call exim-config-change,HAVE_ICONV,no)
$(call exim-config-unset,EXIM_MONITOR)
+endef
+
+define EXIM_CONFIGURE_TOOLCHAIN
$(call exim-config-add,CC,$(TARGET_CC))
$(call exim-config-add,CFLAGS,$(TARGET_CFLAGS))
$(call exim-config-add,AR,$(TARGET_AR) cq)
@@ -49,6 +57,21 @@ define EXIM_CONFIGURE_CMDS
$(call exim-config-add,HOSTCFLAGS,$(HOSTCFLAGS))
endef
+ifeq ($(BR2_PACKAGE_EXIM_CUSTOM_CONFIG),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE)),)
+$(error No exim configuration file specified, check your BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE setting)
+endif
+define EXIM_CONFIGURE_CMDS
+ $(EXIM_USE_CUSTOM_CONFIG_FILE)
+ $(EXIM_CONFIGURE_TOOLCHAIN)
+endef
+else # CUSTOM_CONFIG
+define EXIM_CONFIGURE_CMDS
+ $(EXIM_USE_DEFAULT_CONFIG_FILE)
+ $(EXIM_CONFIGURE_TOOLCHAIN)
+endef
+endif # CUSTOM_CONFIG
+
# exim needs a bit of love to build statically
ifeq ($(BR2_PREFER_STATIC_LIB),y)
EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"