From owner-freebsd-java@FreeBSD.ORG Wed Feb 20 19:04:08 2013 Return-Path: Delivered-To: java@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9DE1530; Wed, 20 Feb 2013 19:04:08 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x235.google.com (ie-in-x0235.1e100.net [IPv6:2607:f8b0:4001:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 98061CE8; Wed, 20 Feb 2013 19:04:08 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id 17so10408679iea.12 for ; Wed, 20 Feb 2013 11:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=dYW+mPvsp8KuLdwbF9xaOKHPMTMPGYLSiWn9Os/wD5k=; b=zuxddBRVrGj+A34h/ouBdMN6pXV6K6lj372HWsrGq6W7rtxKC7rAxY0o2HBtMv2JIi Ra/qZcIYv+7+xQQasA0YIuPY5/5aSH20oSz0Vrj/EqEBkiu7mc7M2QgOofS9O1dgc3vY aDsS+3Y3YqBXe0vI15IrSXFVrEoCGpjkrMtgdu8pawD6yRaEb7Sht37DfoaHkfxXAMs4 aYplVer1vW7rcF6UyzKv2hnBhJrSVC8D4N3xhOG5wiTFifiIsamT21ABK2c4u+00h8As J3JGUf4mR3ItdsWbzgYrYw0c+keolPi8bzTLU6k+H5g7uEXli68HTjlwEzI8Xm9C8lCI 8lYw== X-Received: by 10.50.197.170 with SMTP id iv10mr11590042igc.62.1361387048255; Wed, 20 Feb 2013 11:04:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.63.12 with HTTP; Wed, 20 Feb 2013 11:03:38 -0800 (PST) From: Chris Rees Date: Wed, 20 Feb 2013 19:03:38 +0000 Message-ID: Subject: bsd.java.mk removing != assignments To: java@freebsd.org, Greg Lewis , hq@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 19:04:09 -0000 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