From owner-svn-src-all@FreeBSD.ORG Thu May 24 19:48:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 255A61065670; Thu, 24 May 2012 19:48:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC0058FC08; Thu, 24 May 2012 19:48:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OJmFh6056932; Thu, 24 May 2012 19:48:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OJmFlY056929; Thu, 24 May 2012 19:48:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205241948.q4OJmFlY056929@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235927 - head/bin/sh 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: Thu, 24 May 2012 19:48:16 -0000 Author: marcel Date: Thu May 24 19:48:15 2012 New Revision: 235927 URL: http://svn.freebsd.org/changeset/base/235927 Log: Work better with how make/bmake works: 1. Avoid a cd back into ${.CURDIR} to run mkbuiltins when we know make will first cd into ${.OBJDIR}. Keep the cwd to what make sets it to. 2. Don't tell mkbuiltins where to write to (= ${.OBJDIR}), but where to get sources from (= ${.CURDIR}). This to compensate for point 1. This fixes a problem with bmake's mk files that optimize ${.OBJDIR} to expand to "." after changing cwd, not taking into account that the target is pretty much undoing that and not getting the full path to the object tree anymore. Modified: head/bin/sh/Makefile head/bin/sh/mkbuiltins Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu May 24 19:24:31 2012 (r235926) +++ head/bin/sh/Makefile Thu May 24 19:48:15 2012 (r235927) @@ -38,7 +38,7 @@ build-tools: mkinit mknodes mksyntax .ORDER: builtins.c builtins.h builtins.c builtins.h: mkbuiltins builtins.def - cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR} + sh ${.CURDIR}/mkbuiltins ${.CURDIR} init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ redir.c trap.c var.c Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Thu May 24 19:24:31 2012 (r235926) +++ head/bin/sh/mkbuiltins Thu May 24 19:48:15 2012 (r235927) @@ -35,17 +35,17 @@ # $FreeBSD$ temp=`/usr/bin/mktemp -t ka` -havejobs=0 -if grep '^#define[ ]*JOBS[ ]*1' shell.h > /dev/null -then havejobs=1 -fi havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 shift fi -objdir=$1 -exec > ${objdir}/builtins.c +srcdir=$1 +havejobs=0 +if grep '^#define[ ]*JOBS[ ]*1' $srcdir/shell.h > /dev/null +then havejobs=1 +fi +exec > builtins.c cat <<\! /* * This file was generated by the mkbuiltins program. @@ -57,7 +57,7 @@ cat <<\! ! awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \ - print $0}' builtins.def | sed 's/-[hj]//' > $temp + print $0}' $srcdir/builtins.def | sed 's/-[hj]//' > $temp echo 'int (*const builtinfunc[])(int, char **) = {' awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; @@ -74,7 +74,7 @@ awk '{ for (i = 2 ; i <= NF ; i++) { echo ' { NULL, 0, 0 } };' -exec > ${objdir}/builtins.h +exec > builtins.h cat <<\! /* * This file was generated by the mkbuiltins program.