From: Aron Griffis <aron@hp.com>
To: Christoph Egger <Christoph.Egger@amd.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH][TOOLS] libfsimage: portability fixes
Date: Thu, 27 Mar 2008 11:05:31 -0400 [thread overview]
Message-ID: <20080327150531.GE21257@fc.hp.com> (raw)
In-Reply-To: <200803261514.33378.Christoph.Egger@amd.com>
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 <<EOF
> #include <ext2fs/ext2fs.h>
> @@ -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
next prev parent reply other threads:[~2008-03-27 15:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 14:14 [PATCH][TOOLS] libfsimage: portability fixes Christoph Egger
2008-03-27 10:54 ` Ian Jackson
2008-03-27 15:13 ` Christoph Egger
2008-03-27 15:36 ` Ian Jackson
2008-03-27 16:23 ` John Levon
2008-03-28 10:08 ` Christoph Egger
2008-03-28 10:42 ` Ian Jackson
2008-03-28 12:40 ` Christoph Egger
2008-03-28 14:19 ` Ian Jackson
2008-03-27 11:05 ` Ian Jackson
2008-03-27 15:16 ` Christoph Egger
2008-03-27 16:26 ` John Levon
2008-03-27 15:05 ` Aron Griffis [this message]
2008-03-27 15:13 ` Ian Jackson
2008-03-27 15:56 ` Aron Griffis
-- strict thread matches above, loose matches on Subject: below --
2008-03-27 15:36 Christoph Egger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080327150531.GE21257@fc.hp.com \
--to=aron@hp.com \
--cc=Christoph.Egger@amd.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.