From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 14 13:30:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F21106568B for ; Wed, 14 Oct 2009 13:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C8B2A8FC23 for ; Wed, 14 Oct 2009 13:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9EDU2VI026283 for ; Wed, 14 Oct 2009 13:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9EDU220026280; Wed, 14 Oct 2009 13:30:02 GMT (envelope-from gnats) Resent-Date: Wed, 14 Oct 2009 13:30:02 GMT Resent-Message-Id: <200910141330.n9EDU220026280@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, FUCHIGAMI Masachika Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41DD1065720 for ; Wed, 14 Oct 2009 13:26:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id B222F8FC24 for ; Wed, 14 Oct 2009 13:26:20 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n9EDQKLm098631 for ; Wed, 14 Oct 2009 13:26:20 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n9EDQK4Z098630; Wed, 14 Oct 2009 13:26:20 GMT (envelope-from nobody) Message-Id: <200910141326.n9EDQK4Z098630@www.freebsd.org> Date: Wed, 14 Oct 2009 13:26:20 GMT From: FUCHIGAMI Masachika To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/139601: make(1): variable substitution for $@ in dependency source fails X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2009 13:30:03 -0000 >Number: 139601 >Category: bin >Synopsis: make(1): variable substitution for $@ in dependency source fails >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 14 13:30:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: FUCHIGAMI Masachika >Release: FreeBSD 7.0-RELEASE i386 >Organization: >Environment: FreeBSD inca 7.0-RELEASE FreeBSD 7.0-RELEASE #15: Tue Aug 25 08:58:13 JST 2009 root@inca:/usr/src/sys/i386/compile/INCA i386 >Description: local variable substitution in dependency source fails when $@ is used in another variable name ( e.g. ${$(@)_SRC} ). make(1) delayes load-time variable substitution for local variables by expanding local variables to itself ( $@ -> $@ ), but make(1) does not delay variables containing local variables. >How-To-Repeat: -- Makefile foo=bar foo: $($@).txt -- % touch bar.txt % make foo make: don't know how to make .txt. Stop >Fix: *** var.c 2006-07-18 06:05:27.000000000 +0900 --- var.c 2009-10-14 21:43:55.000000000 +0900 *************** *** 1924,1929 **** --- 1924,1937 ---- return (value); } } + if( vlen >=1 && strchr( vname, '$' ) != NULL ) { + value = emalloc( consumed + 1 ); + strncpy(value, vp->input, consumed); + value[consumed] = '\0'; + + *freeResult = TRUE; + return (value); + } *freeResult = FALSE; return (vp->err ? var_Error : varNoError); *************** *** 2019,2024 **** --- 2027,2040 ---- return (value); } } + if( vlen >=1 && strchr( vname, '$' ) != NULL ) { + value = emalloc( consumed + 1 ); + strncpy(value, vp->input, consumed); + value[consumed] = '\0'; + + *freeResult = TRUE; + return (value); + } } else { /* * Check for D and F forms of local variables since we're in >Release-Note: >Audit-Trail: >Unformatted: