From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aron Griffis Subject: Re: [PATCH][TOOLS] libfsimage: portability fixes Date: Thu, 27 Mar 2008 11:05:31 -0400 Message-ID: <20080327150531.GE21257@fc.hp.com> References: <200803261514.33378.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <200803261514.33378.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Christoph Egger wrote: [Wed Mar 26 2008, 10:14:33AM EDT] > diff -r 966c04d42e94 tools/libfsimage/Makefile > --- a/tools/libfsimage/Makefile Wed Mar 26 09:12:57 2008 +0000 > +++ b/tools/libfsimage/Makefile Wed Mar 26 17:12:55 2008 +0100 > @@ -2,7 +2,7 @@ include $(XEN_ROOT)/tools/Rules.mk > include $(XEN_ROOT)/tools/Rules.mk > > SUBDIRS-y = common ufs reiserfs iso9660 fat > -SUBDIRS-y += $(shell env CC="$(CC)" ./check-libext2fs) > +SUBDIRS-y += $(shell $(SHELL) env CC="$(CC)" ./check-libext2fs) As Ian asked, what was this intended to do? It's certainly wrong: $ /bin/sh env CC=gcc ./check-libext2fs /usr/bin/env: /usr/bin/env: cannot execute binary file > diff -r 966c04d42e94 tools/libfsimage/check-libext2fs > --- a/tools/libfsimage/check-libext2fs Wed Mar 26 09:12:57 2008 +0000 > +++ b/tools/libfsimage/check-libext2fs Wed Mar 26 17:12:55 2008 +0100 > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/bin/sh > > cat >ext2-test.c < #include > @@ -9,7 +9,9 @@ int main() > } > EOF > > -${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 > + > if [ $? = 0 ]; then > echo ext2fs-lib > else 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: ${CC-cc} -o ext2-test ext2-test.c -lext2fs >/dev/null 2>&1 Aron