From owner-svn-src-all@FreeBSD.ORG Tue Mar 20 19:03:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C182D1065670; Tue, 20 Mar 2012 19:03:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4AFAA8FC0A; Tue, 20 Mar 2012 19:03:57 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D589346B2D; Tue, 20 Mar 2012 15:03:56 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 646F8B91C; Tue, 20 Mar 2012 15:03:56 -0400 (EDT) From: John Baldwin To: Doug Barton Date: Tue, 20 Mar 2012 10:19:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203162319.q2GNJjx5039482@svn.freebsd.org> <4F678B03.8050307@FreeBSD.org> <4F67A7A9.50003@FreeBSD.org> In-Reply-To: <4F67A7A9.50003@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203201019.40486.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Mar 2012 15:03:56 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , Bruce Evans , svn-src-head@freebsd.org, Chris Rees Subject: Re: svn commit: r233052 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 19:03:57 -0000 On Monday, March 19, 2012 5:39:53 pm Doug Barton wrote: > On 3/19/2012 12:37 PM, Dimitry Andric wrote: > > It would be much nicer to be able to write: > > > > .if defined(FOO) > > .if defined(BAR) > > CFLAGS+= -DFOO_BAR > > .endif > > .endif > > Take a look at /usr/ports/Mk/bsd.port.mk for how this can be done. Hmm, do yoo have a specific example? The bits in I see in bsd.port.mk suffer from the limitation Dimitry raises, e.g.: .if defined(OPTIONS) # include OPTIONSFILE first if exists . if exists(${OPTIONSFILE}) && !make(rmconfig) . include "${OPTIONSFILE}" . endif . if exists(${OPTIONSFILE}.local) . include "${OPTIONSFILE}.local" . endif WITHOUT:= WITH:= . if defined(OPTIONS) REALOPTIONS=${OPTIONS:C/".*"//g} . for O in ${REALOPTIONS} RO:=${O} . if ${RO:L} == off WITHOUT:= ${WITHOUT} ${OPT} . endif . if ${RO:L} == on WITH:= ${WITH} ${OPT} . endif OPT:=${RO} . endfor . endif That is, all the lines that don't start with a . are not indented, and even this indentation is rather horrible (it doesn't nest, and it has the odd structure of 'if defined(OPTIONS) { if defined(OPTIONS) {} }'. -- John Baldwin