From owner-svn-src-head@freebsd.org Fri Nov 17 18:34:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 167F3DE08EF; Fri, 17 Nov 2017 18:34:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3E85709BB; Fri, 17 Nov 2017 18:34:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAHIYFDn054002; Fri, 17 Nov 2017 18:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAHIYEXV053999; Fri, 17 Nov 2017 18:34:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711171834.vAHIYEXV053999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 17 Nov 2017 18:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325955 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 325955 X-SVN-Commit-Repository: base 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.25 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: Fri, 17 Nov 2017 18:34:16 -0000 Author: bdrewery Date: Fri Nov 17 18:34:14 2017 New Revision: 325955 URL: https://svnweb.freebsd.org/changeset/base/325955 Log: Fix 'local' to not look in the source tree for the file. Usually 'local' is used along with other rules such as 'no-implicit-rule' or 'dependency' which avoids this problem. It's possible to need to use 'local' while relying on the default rules though for a file which is not in the source tree nor generated in the kernel. Sponsored by: Dell Differential Revision: https://reviews.freebsd.org/D13125 Modified: head/usr.sbin/config/config.h head/usr.sbin/config/configvers.h head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Fri Nov 17 18:16:46 2017 (r325954) +++ head/usr.sbin/config/config.h Fri Nov 17 18:34:14 2017 (r325955) @@ -54,6 +54,7 @@ struct file_list { char *f_clean; /* File list to add to clean rule */ char *f_warn; /* warning message */ const char *f_objprefix; /* prefix string for object name */ + const char *f_srcprefix; /* source prefix such as $S/ */ }; struct files_name { Modified: head/usr.sbin/config/configvers.h ============================================================================== --- head/usr.sbin/config/configvers.h Fri Nov 17 18:16:46 2017 (r325954) +++ head/usr.sbin/config/configvers.h Fri Nov 17 18:34:14 2017 (r325955) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600014 +#define CONFIGVERS 600015 #define MAJOR_VERS(x) ((x) / 100000) Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Fri Nov 17 18:16:46 2017 (r325954) +++ head/usr.sbin/config/mkmakefile.c Fri Nov 17 18:34:14 2017 (r325955) @@ -496,6 +496,10 @@ nextparam:; tp = new_fent(); tp->f_fn = this; tp->f_type = filetype; + if (filetype == LOCAL) + tp->f_srcprefix = ""; + else + tp->f_srcprefix = "$S/"; if (imp_rule) tp->f_flags |= NO_IMPLCT_RULE; if (no_obj) @@ -571,7 +575,8 @@ do_before_depend(FILE *fp) if (tp->f_flags & NO_IMPLCT_RULE) fprintf(fp, "%s ", tp->f_fn); else - fprintf(fp, "$S/%s ", tp->f_fn); + fprintf(fp, "%s%s ", tp->f_srcprefix, + tp->f_fn); lpos += len + 1; } if (lpos != 8) @@ -636,10 +641,7 @@ do_xxfiles(char *tag, FILE *fp) lpos = 8; fputs("\\\n\t", fp); } - if (tp->f_type != LOCAL) - fprintf(fp, "$S/%s ", tp->f_fn); - else - fprintf(fp, "%s ", tp->f_fn); + fprintf(fp, "%s%s ", tp->f_srcprefix, tp->f_fn); lpos += len + 1; } free(suff); @@ -685,18 +687,21 @@ do_rules(FILE *f) else { *cp = '\0'; if (och == 'o') { - fprintf(f, "%s%so:\n\t-cp $S/%so .\n\n", - ftp->f_objprefix, tail(np), np); + fprintf(f, "%s%so:\n\t-cp %s%so .\n\n", + ftp->f_objprefix, tail(np), + ftp->f_srcprefix, np); continue; } if (ftp->f_depends) { - fprintf(f, "%s%so: $S/%s%c %s\n", - ftp->f_objprefix, tail(np), np, och, + fprintf(f, "%s%so: %s%s%c %s\n", + ftp->f_objprefix, tail(np), + ftp->f_srcprefix, np, och, ftp->f_depends); } else { - fprintf(f, "%s%so: $S/%s%c\n", - ftp->f_objprefix, tail(np), np, och); + fprintf(f, "%s%so: %s%s%c\n", + ftp->f_objprefix, tail(np), + ftp->f_srcprefix, np, och); } } compilewith = ftp->f_compilewith; @@ -725,7 +730,8 @@ do_rules(FILE *f) } *cp = och; if (strlen(ftp->f_objprefix)) - fprintf(f, "\t%s $S/%s\n", compilewith, np); + fprintf(f, "\t%s %s%s\n", compilewith, + ftp->f_srcprefix, np); else fprintf(f, "\t%s\n", compilewith);