From owner-freebsd-questions@FreeBSD.ORG Thu Aug 7 18:54:23 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A27701065670 for ; Thu, 7 Aug 2008 18:54:23 +0000 (UTC) (envelope-from carpetsmoker@rwxrwxrwx.net) Received: from mail.rwxrwxrwx.net (rwxrwxrwx.net [82.93.23.199]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5758FC19 for ; Thu, 7 Aug 2008 18:54:22 +0000 (UTC) (envelope-from carpetsmoker@rwxrwxrwx.net) Received: from localhost (localhost [127.0.0.1]) by mail.rwxrwxrwx.net (Postfix) with ESMTP id EDECB6D4D1; Thu, 7 Aug 2008 20:58:01 +0200 (CEST) Received: from mail.rwxrwxrwx.net ([127.0.0.1]) by localhost (mail.rwxrwxrwx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yszxrK+ncg7S; Thu, 7 Aug 2008 20:57:57 +0200 (CEST) Received: from rwxrwxrwx.net (phong [192.168.100.13]) by mail.rwxrwxrwx.net (Postfix) with ESMTPSA id 4B0CE6D443; Thu, 7 Aug 2008 20:57:57 +0200 (CEST) Date: Thu, 7 Aug 2008 20:54:29 +0200 From: Martin Tournoij To: freebsd-questions@freebsd.org Message-ID: <20080807185429.GA27898@rwxrwxrwx.net> Mail-Followup-To: freebsd-questions@freebsd.org, mk@adminlife.net References: <489AAC87.8040200@adminlife.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <489AAC87.8040200@adminlife.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: mk@adminlife.net Subject: Re: Add CONFIGURE_ARGS option for port in make.conf X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2008 18:54:23 -0000 On Thu, Aug 07, 2008 at 10:04:23AM +0200, Matthias Kellermann wrote: > Hi list, > > I want to compile a port with an option that is not controllable through > the FreeBSD Makefile or with make config. > > The specific port is lang/php4 and the option I want to add is > --with-mime-magic (I know, php4 is old and not supported after 8.8.08 > and --with-mime-magic is deprecated, but thats another story...). > > So I added an option to make.conf(5): > > .if ${.CURDIR:M*/lang/php4} > CONFIGURE_ARGS+=--with-mime-magic > .endif > > Unfortonately, this does not work. > > When I add this option in the Makefile it works. The relevant part looks > like this: > > CONFIGURE_ARGS= --enable-versioning \ > --with-mime-magic \ > --enable-memory-limit \ > --with-layout=GNU \ > --with-config-file-scan-dir=${PREFIX}/etc/php \ > --disable-all \ > --program-prefix="" > > Any ideas whats wrong here? > > Regards, > Matthias /etc/make.conf is read first, from make(1): First of all, the initial list of specifications will be read from the system makefile, sys.mk, unless inhibited with the -r option. The standard sys.mk as shipped with FreeBSD also handles make.conf(5) So if the port uses VAR= instead of VAR+= (Or VAR?=) then settings in /etc/make.conf will have no effect. AFAIK there is no pretty workaround, you will need to edit the Makefile. For a more structual solution, ports should use CONFIGURE_ARGS+= instead of CONFIGURE_ARGS, or a a new variable can be added, where the user can set custom configure arguments (i.e. LOCAL_CONFIGURE_ARGS). -- Martin Tournoij carpetsmoker@rwxrwxrwx.net http://www.daemonforums.org QOTD: Do not overtax your powers.