Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2013 19:03:38 +0000
From:      Chris Rees <utisoft@gmail.com>
To:        java@freebsd.org, Greg Lewis <glewis@eyesbeyond.com>, hq@freebsd.org
Subject:   bsd.java.mk removing != assignments
Message-ID:  <CADLo838E%2B_-ZLRTmA9uGkLDk8tR3sUG97iGxFaKBFSAAbrH7CA@mail.gmail.com>

index | next in thread | raw e-mail

Hi all,

Way back, when kris@ was working on speeding up make index, he
replaced many of the != assignments in bsd.java.mk with clever sh
incantations.

His reasoning was that you can't use make's variable modifiers with
variables; i.e. one cannot use ${FOO:M${BAR}} where BAR is a variable.
However... because inside a for loop the variables are simply replaced
with strings, one *can* use these variables in this way;

FOO=jamaica ecuador java
BAR=ecuador
.for b in ${BAR}
COFFEE=${FOO:M$b}
.endfor

returns ${COFFEE} containing ecuador.

tl;dr, one can replace the != sh magic with the equivalent and much
shorter make logic in the two patches [1,2].

At the same time, I've removed the final != assignments in the
variable checking section and replaced them with the equivalent Make
idiom [3].

A svn diff of all the changes together is at [4].  I've done some
basic testing, but what else would be needed to implement these
changes?

[I'll also do some make index benchmarks to see what speed difference it makes].

Chris

[1] http://www.bayofrum.net/cgi-bin/fossil/portsMk/fdiff?v1=1bb44aeca134c2d0&v2=4f75cb395c347169

[2] http://www.bayofrum.net/cgi-bin/fossil/portsMk/fdiff?v1=4f75cb395c347169&v2=521279991ab2810b

[3] http://www.bayofrum.net/cgi-bin/fossil/portsMk/fdiff?v1=521279991ab2810ba6f2297164ddf044ec4c972b&v2=899672c495f90022612ee78c53bcc91866e1edf9

[4] http://www.bayofrum.net/~crees/patches/bsd-java-mk-remove-bang.diff


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo838E%2B_-ZLRTmA9uGkLDk8tR3sUG97iGxFaKBFSAAbrH7CA>