WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][TOOLS] libfsimage: portability fixes

To: Aron Griffis <aron@xxxxxx>
Subject: Re: [Xen-devel] [PATCH][TOOLS] libfsimage: portability fixes
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 27 Mar 2008 15:13:41 +0000
Cc: Christoph Egger <Christoph.Egger@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 27 Mar 2008 08:15:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080327150531.GE21257@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Newsgroups: chiark.mail.xen.devel
References: <200803261514.33378.Christoph.Egger@xxxxxxx> <20080327150531.GE21257@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Aron Griffis writes ("Re: [Xen-devel] [PATCH][TOOLS] libfsimage: portability 
fixes"):
> Christoph Egger wrote:  [Wed Mar 26 2008, 10:14:33AM EDT]
> > -${CC:-gcc} -o ext2-test ext2-test.c -lext2fs >/dev/null 2>&1
> > +if test -z ${CC}; then CC="gcc"; fi
> > +${CC} -o ext2-test ext2-test.c -lext2fs >/dev/null 2>&1
> 
> This prevents check-libext2fs from being run outside the
> Makefile.  It will silently fail compilation if $CC isn't set.
> For Bourne shell and cross-platform compatibility, it should be:

${VARIABLE:-defaultvalue} is in SuSv3 (section 2.6.2, `Use Default
Values') and has been in many previous standards.  Any system whose
/bin/sh can't cope is hopelessly broken.

> ${CC-cc} -o ext2-test ext2-test.c -lext2fs >/dev/null 2>&1

However, in this case, ${VARIABLE-defaultvalue} is an adequate
substitute so we should use that.  With a default of gcc, since
without gcc you're doomed anyway.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel