Date: Tue, 19 Feb 2002 16:47:38 +0100 (CET) From: stijn@win.tue.nl To: FreeBSD-gnats-submit@freebsd.org Subject: bin/35119: make(1) variable modifier bug (:L, :U etc) Message-ID: <200202191547.g1JFlcm41029@pcwin002.win.tue.nl>
next in thread | raw e-mail | index | archive | help
>Number: 35119
>Category: bin
>Synopsis: make(1) variable modifier bug (:L, :U etc)
>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: Tue Feb 19 07:50:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Stijn Hoop
>Release: FreeBSD 4.5-RC
>Organization:
>Environment:
System: FreeBSD 4.5-RC #0: Wed Jan 16 04:30:08 CET 2002
>Description:
make(1) has a buglet wrt expanding variables with modifiers. If an expansion
of an undefined variable, with a modifier, is used in an .if statement like so:
.if defined(FOO) && ${FOO:L} == "bar"
make bombs out with a 'Malformed conditional', even if FOO is not defined.
An expansion like this works correctly in the non-modified case:
.if defined(FOO) && ${FOO} == "bar"
performs as expected.
>How-To-Repeat:
Extract the following Makefile to an empty directory and type 'make'. Witness
make bombing out.
--- /dev/null Tue Feb 19 16:40:07 2002
+++ Makefile Tue Feb 19 16:44:15 2002
@@ -0,0 +1,23 @@
+all:
+ ${MAKE} -DTEST_1 result
+ ${MAKE} -DTEST_2 result
+
+.if defined(TEST_1)
+.if defined(FOO) && ${FOO} != "bar"
+result:
+ @echo "FOO != bar"
+.else
+result:
+ @echo "FOO undefined or == bar"
+.endif
+.endif
+
+.if defined(TEST_2)
+.if defined(FOO) && ${FOO:L} != "bar"
+result:
+ @echo "FOO != bar (with case permutation)"
+.else
+result:
+ @echo "FOO undefined or == bar (with case permutation)"
+.endif
+.endif
>Fix:
Unfortunately not available; hacking make is beyond me...
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202191547.g1JFlcm41029>
