From patchwork Fri Jul 4 15:56:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 367133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id F226614009C for ; Sat, 5 Jul 2014 01:57:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1414A8C6A7; Fri, 4 Jul 2014 15:57:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pPA5e-d2eSEb; Fri, 4 Jul 2014 15:57:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 695668BFC5; Fri, 4 Jul 2014 15:57:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 06F051BF9B6 for ; Fri, 4 Jul 2014 15:57:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0081A8BFFA for ; Fri, 4 Jul 2014 15:57:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fZwKdGAuoYrL for ; Fri, 4 Jul 2014 15:57:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from srv-hp10.netsons.net (unknown [94.141.22.72]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3B16B8BD5B for ; Fri, 4 Jul 2014 15:57:05 +0000 (UTC) Received: from host138-62-static.18-80-b.business.telecomitalia.it ([80.18.62.138]:47594 helo=wallace.comelit.it) by srv-hp10.netsons.net with esmtpa (Exim 4.82) (envelope-from ) id 1X35r4-000ndC-VJ; Fri, 04 Jul 2014 17:57:00 +0200 From: Luca Ceresoli To: buildroot@busybox.net Date: Fri, 4 Jul 2014 17:56:24 +0200 Message-Id: <1404489386-7523-2-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404489386-7523-1-git-send-email-luca@lucaceresoli.net> References: <1404489386-7523-1-git-send-email-luca@lucaceresoli.net> X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - busybox.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Cc: bernd.kuhls@t-online.de, Luca Ceresoli Subject: [Buildroot] [PATCH 1/3] exim: allow using a custom configuration file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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. Signed-off-by: Luca Ceresoli --- package/exim/Config.in | 25 +++++++++++++++++++++++++ package/exim/exim.mk | 25 ++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/package/exim/Config.in b/package/exim/Config.in index a71106b..fb41ccb 100644 --- a/package/exim/Config.in +++ b/package/exim/Config.in @@ -8,3 +8,28 @@ config BR2_PACKAGE_EXIM Cambridge for use on Unix systems connected to the Internet. http://www.exim.org/ + +if BR2_PACKAGE_EXIM + +config BR2_PACKAGE_EXIM_CUSTOM_CONFIG + bool "Use a custom configuration file for exim" + help + By default Buildroot generates configuration file for exim with + reasonable settings. + Enable this option if you want to override the configuration file + generated by Buildroot with a customized file. Then set the path + to your configuration file in BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE. + +config BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE + string "Custom configuration file for exim" + depends on BR2_PACKAGE_EXIM_CUSTOM_CONFIG + help + Specify a file to use as the exim configuration file. + + This file shall comply with the syntax defined in the exim + documentation (http://www.exim.org/docs.html). + Buildroot will generate a configuration file composed of the + content of the file you provide plus the toolchain-related + settings needed for cross-compilation. + +endif diff --git a/package/exim/exim.mk b/package/exim/exim.mk index 0f9c6af..2e51a0d 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"