From patchwork Tue Jan 18 23:24:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 79376 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1C4DCB7063 for ; Wed, 19 Jan 2011 10:25:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B4A7281B9; Wed, 19 Jan 2011 00:25:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VLrEimgLVTlO; Wed, 19 Jan 2011 00:25:49 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8709F281BA; Wed, 19 Jan 2011 00:25:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 66389281BA for ; Wed, 19 Jan 2011 00:25:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rNg7bShU2pVt for ; Wed, 19 Jan 2011 00:25:14 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.ahsoftware.de (h1047321.serverkompetenz.net [85.214.67.163]) by theia.denx.de (Postfix) with ESMTPS id 23E2A281B9 for ; Wed, 19 Jan 2011 00:25:09 +0100 (CET) Received: by mail.ahsoftware.de (Postfix, from userid 65534) id 5398859806A; Wed, 19 Jan 2011 00:24:59 +0100 (CET) Received: from eiche.ahsoftware (p57B205F8.dip0.t-ipconnect.de [87.178.5.248]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTP id 06619598069; Wed, 19 Jan 2011 00:24:56 +0100 (CET) Received: from krabat.ahsoftware (krabat.ahsoftware [192.168.207.2]) by eiche.ahsoftware (Postfix) with ESMTP id 93BC54043D; Wed, 19 Jan 2011 00:24:52 +0100 (CET) From: Alexander Holler To: u-boot@lists.denx.de Date: Wed, 19 Jan 2011 00:24:40 +0100 Message-Id: <1295393080-6510-1-git-send-email-holler@ahsoftware.de> X-Mailer: git-send-email 1.7.3.4 Cc: ptyser@xes-inc.com Subject: [U-Boot] [PATCH] Print compiler and linker version with the version command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de After years of unsuccessful research I've finally shamelessly stolen other peoples intellectual properties to present the all-new and world-changing updated version command: - U-Boot>> version U-Boot 2010.12-00014-g7435056-dirty (Jan 18 2011 - 23:19:38) MyBoard gcc (GCC) 0.42 (Distro foobar) GNU ld (GNU Binutils) 0.314159265 - May the toolchain bugs rest in peace. Signed-off-by: Alexander Holler --- Makefile | 4 ++++ common/cmd_version.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 9055028..b434212 100644 --- a/Makefile +++ b/Makefile @@ -416,6 +416,10 @@ $(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin $(VERSION_FILE): @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \ '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp + @( printf '#define CC_VERSION_STRING "%s"\n' \ + '$(shell $(CC) --version | head -n 1)' )>> $@.tmp + @( printf '#define LD_VERSION_STRING "%s"\n' \ + '$(shell $(LD) -v | head -n 1)' )>> $@.tmp @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ $(TIMESTAMP_FILE): diff --git a/common/cmd_version.c b/common/cmd_version.c index 7d1b495..83cb11c 100644 --- a/common/cmd_version.c +++ b/common/cmd_version.c @@ -23,18 +23,25 @@ #include #include +#include extern char version_string[]; int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf("\n%s\n", version_string); +#ifdef CC_VERSION_STRING + puts(CC_VERSION_STRING "\n"); +#endif +#ifdef LD_VERSION_STRING + puts(LD_VERSION_STRING "\n"); +#endif return 0; } U_BOOT_CMD( version, 1, 1, do_version, - "print monitor version", + "print monitor, compiler and linker version", "" );