From patchwork Thu Sep 25 11:19:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Hundven X-Patchwork-Id: 393317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 29A7714017C for ; Thu, 25 Sep 2014 21:20:35 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=XXVpc/piJIt6SFRYNoGf9Hw5EFjjOfN BE24FqBKItk2+DS4fDnTiAxSUoge4uG12MZo3eIp9OtK0J/vsRodUPcKIgQurLA7 IHVpr0WUfc4y47iz4rnqEE9Qz4aQwptSS/v2Zshst/tt3m/ROHlkz0PdWhDva9XL jf8i+ddkCw90= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=PuiH0T77mfSI9cJP7acBIf5rO2s=; b=QV3VY FJUKTuuCrLvBJs8pz35oU/2TEf77mxksf40LQ5rei5VVFecuxfNGE6qHjhZeV/Sy 7yrqy9dEOhRyY1krVVM4mVE1dCTys2M9F+3eyu//QrW2oAkELYacniv/ulFjqFGE lHEq9EGi5NE7o3xv8xhBOPxvVKVK+HV5CI3+PQ= Received: (qmail 17970 invoked by alias); 25 Sep 2014 11:19:56 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 17802 invoked by uid 89); 25 Sep 2014 11:19:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f170.google.com Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 25 Sep 2014 11:19:54 +0000 Received: by mail-pd0-f170.google.com with SMTP id y13so10500507pdi.1 for ; Thu, 25 Sep 2014 04:19:52 -0700 (PDT) X-Received: by 10.70.129.72 with SMTP id nu8mr24870257pdb.91.1411643992155; Thu, 25 Sep 2014 04:19:52 -0700 (PDT) Received: from fuzzy.hsd1.wa.comcast.net. (c-50-135-131-187.hsd1.wa.comcast.net. [50.135.131.187]) by mx.google.com with ESMTPSA id je2sm1877979pbd.94.2014.09.25.04.19.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Sep 2014 04:19:51 -0700 (PDT) From: Bryan Hundven To: "Yann E. MORIN" Cc: crossgcc@sourceware.org, Bryan Hundven Subject: [PATCH 2/3] scripts/cc: get the right ecj for the gcc version. Date: Thu, 25 Sep 2014 04:19:36 -0700 Message-Id: <1411643977-3339-3-git-send-email-bryanhundven@gmail.com> In-Reply-To: <1411643977-3339-1-git-send-email-bryanhundven@gmail.com> References: <1411643977-3339-1-git-send-email-bryanhundven@gmail.com> X-IsSubscribed: yes If we look at: ftp://gcc.gnu.org/pub/java/ Not all ecj-{MAJOR.MINOR}.jar versions are the same. Grabbing latest is also naive, as it is NOT the latest ;) Since we also have to deal with linaro version numbers, add a helper function to extract the version number in a common way. Signed-off-by: Bryan Hundven --- scripts/build/cc/gcc.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 9dbc41e..3f6d94e 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -2,6 +2,15 @@ # Copyright 2007 Yann E. MORIN # Licensed under the GPL v2. See COPYING in the root of this package +# Discover the ecj version to get +do_get_ecj_version() { + if [ "$(echo ${CT_CC_VERSION} | grep -o 'linaro')" = "linaro" ]; then + echo ${CT_CC_VERSION} | sed -r -e 's/linaro-([0-9]\.[0-9])-.*/\1/' + else + echo "${CT_CC_VERSION%.*}" + fi +} + # Download gcc do_cc_get() { local linaro_version @@ -36,8 +45,9 @@ do_cc_get() { # GCC source tree, which will not be there unless we get it and # put it there ourselves if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then - CT_GetFile ecj-latest .jar ftp://gcc.gnu.org/pub/java \ - ftp://sourceware.org/pub/java + CT_GetFile "ecj-$(do_get_ecj_version)" .jar \ + ftp://gcc.gnu.org/pub/java \ + ftp://sourceware.org/pub/java fi } @@ -56,7 +66,8 @@ do_cc_extract() { if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \ -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" \ ]; then - CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" + CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-$(do_get_ecj_version).jar" \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" fi }