Date: Mon, 14 Feb 2011 07:21:02 GMT From: Garrett Cooper <gcooper@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/154769: [make] :L modifier broken in quoted strings Message-ID: <201102140721.p1E7L2DA044003@red.freebsd.org> Resent-Message-ID: <201102140730.p1E7U9la031034@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 154769 >Category: bin >Synopsis: [make] :L modifier broken in quoted strings >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 14 07:30:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: CURRENT / 8.1-RELEASE >Organization: n/a >Environment: FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r218082M: Sun Jan 30 00:20:08 PST 2011 gcooper@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA amd64 FreeBSD toaster.local 8.1-RELEASE FreeBSD 8.1-RELEASE #0 r216175: Mon Dec 6 01:40:05 PST 2010 gcooper@toaster.local:/usr/obj/usr/src/sys/BREADBOX i386 >Description: Quoted variables don't appear to expand properly with some operators like :L at least. Both CURRENT and 8.1-RELEASE show the same behavior with FreeBSD's make, which is the conditional appears "malformed"... > cat Makefile.1 FOO?= bar .if "${FOO:L}" == "bar" .warning "match!" .else .warning "no match!" .endif > make -f Makefile.1 FOO=bar "Makefile.1", line 2: Malformed conditional ("${FOO:L}" == "bar") "Makefile.1", line 3: "match!" .. unquoting the variable works though without the malformed conditional noise... > cat Makefile.2 FOO?= bar .if ${FOO:L} == "bar" .warning "match!" .else .warning "no match!" .endif > make -f Makefile.2 FOO=bar "Makefile", line 3: warning: "match!" make: no target to make. bmake (NetBSD's make) doesn't have this malformed conditional issue... $ bmake -f Makefile.1 FOO=bar bmake: "Makefile.1" line 6: warning: "no match!" .. but the problem is that bmake doesn't correctly evaluate the expansion to be true when quoted or not quoted; that's a separate bug for the NetBSD folks though. >How-To-Repeat: Repeat as shown above. >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102140721.p1E7L2DA044003>