bin/154769: [make] :L modifier broken in quoted strings

Garrett Cooper gcooper at FreeBSD.org
Mon Feb 14 07:30:10 UTC 2011


>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 at 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 at 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:


More information about the freebsd-bugs mailing list