From owner-svn-src-head@FreeBSD.ORG Wed May 1 23:58:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8247C11; Wed, 1 May 2013 23:58:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B123B1AC1; Wed, 1 May 2013 23:58:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41NwdQ7074236; Wed, 1 May 2013 23:58:39 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41NwdCB074235; Wed, 1 May 2013 23:58:39 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305012358.r41NwdCB074235@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 1 May 2013 23:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250164 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 23:58:39 -0000 Author: sjg Date: Wed May 1 23:58:39 2013 New Revision: 250164 URL: http://svnweb.freebsd.org/changeset/base/250164 Log: Local hack to allow smooth transition for ports. bsd.port.mk can set .MAKE.FreeBSD_UL=yes to cause :L and :U to have their old behavior. This should be reverted when 8.3 is EOL. PR: 173299 Reviewed by: obrien Modified: head/contrib/bmake/var.c Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Wed May 1 23:04:29 2013 (r250163) +++ head/contrib/bmake/var.c Wed May 1 23:58:39 2013 (r250164) @@ -140,6 +140,17 @@ __RCSID("$NetBSD: var.c,v 1.173 2013/02/ #include "job.h" /* + * XXX transition hack for FreeBSD ports. + * bsd.port.mk can set .MAKE.FreeBSD_UL=yes + * to cause us to treat :[LU] as aliases for :t[lu] + * To be reverted when ports converts to :t[lu] (when 8.3 is EOL) + */ +#define MAKE_FREEBSD_UL ".MAKE.FreeBSD_UL" +#ifdef MAKE_FREEBSD_UL +static int FreeBSD_UL = FALSE; +#endif + +/* * This lets us tell if we have replaced the original environ * (which we cannot free). */ @@ -965,6 +976,11 @@ Var_Set(const char *name, const char *va setenv(MAKE_LEVEL_SAFE, tmp, 1); #endif } +#ifdef MAKE_FREEBSD_UL + if (strcmp(MAKE_FREEBSD_UL, name) == 0) { + FreeBSD_UL = getBoolean(MAKE_FREEBSD_UL, FALSE); + } +#endif out: @@ -2660,8 +2676,24 @@ ApplyModifiers(char *nstr, const char *t free(loop.str); break; } - case 'D': case 'U': +#ifdef MAKE_FREEBSD_UL + if (FreeBSD_UL) { + int nc = tstr[1]; + + /* we have to be careful, since :U is used internally */ + if (nc == ':' || nc == endc) { + char *dp = bmake_strdup(nstr); + for (newStr = dp; *dp; dp++) + *dp = toupper((unsigned char)*dp); + cp = tstr + 1; + termc = *cp; + break; /* yes inside the conditional */ + } + /* FALLTHROUGH */ + } +#endif + case 'D': { Buffer buf; /* Buffer for patterns */ int wantit; /* want data in buffer */ @@ -2721,6 +2753,17 @@ ApplyModifiers(char *nstr, const char *t break; } case 'L': +#ifdef MAKE_FREEBSD_UL + if (FreeBSD_UL) { + char *dp = bmake_strdup(nstr); + for (newStr = dp; *dp; dp++) + *dp = tolower((unsigned char)*dp); + cp = tstr + 1; + termc = *cp; + break; + } + /* FALLTHROUGH */ +#endif { if ((v->flags & VAR_JUNK) != 0) v->flags |= VAR_KEEP;