public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use CFLAGS in src/Makefile
@ 2010-01-02 22:16 Christian Kujau
  2010-01-06 16:39 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Kujau @ 2010-01-02 22:16 UTC (permalink / raw)
  To: xfs

Hi,

while compiling xfstests after configuring with a different CFLAGS value, 
gcc fails in ./src:

[...]
make[2]: Entering directory `/usr/local/src/xfstests-git/src'
gcc -g -O2 -DDEBUG  -I../include -DVERSION=\"1.0.0\" -L/opt/xfsprogs/lib  
-DREAD iopat.c -o preallo_rw_pattern_reader
iopat.c:21:21: error: xfs/xfs.h: No such file or directory
[...]

Somehow CFLAGS isn't passed to gcc, but "GCFLAGS" is. I'm not too savvy 
with the xfstests build system, but in include/builddefs.in we see:

   # Global, Platform, Local CFLAGS
   CFLAGS += $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)

...thus I'm proposing the following fix:


--- xfstests-git/src/Makefile.orig	2010-01-02 14:01:32.692011000 -0800
+++ xfstests-git/src/Makefile	2010-01-02 14:04:13.352011000 -0800
@@ -97,10 +97,10 @@ dmiperf: dmiperf.o
 	$(LINKTEST) $(LIBATTR) $(LDLIBS)
 
 preallo_rw_pattern_reader:
-	$(CC) $(GCFLAGS) $(LDFLAGS) -DREAD iopat.c -o preallo_rw_pattern_reader
+	$(CC) $(CFLAGS) $(LDFLAGS) -DREAD iopat.c -o preallo_rw_pattern_reader
 
 preallo_rw_pattern_writer:
-	$(CC) $(GCFLAGS) $(LDFLAGS) -DWRITE iopat.c -o preallo_rw_pattern_writer
+	$(CC) $(CFLAGS) $(LDFLAGS) -DWRITE iopat.c -o preallo_rw_pattern_writer
 
 ftrunc: ftrunc.o
 	$(LINKTEST)


Thanks,
Christian.
-- 
BOFH excuse #267:

The UPS is on strike.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] use CFLAGS in src/Makefile
  2010-01-02 22:16 [PATCH] use CFLAGS in src/Makefile Christian Kujau
@ 2010-01-06 16:39 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-01-06 16:39 UTC (permalink / raw)
  To: Christian Kujau; +Cc: xfs

On Sat, Jan 02, 2010 at 02:16:08PM -0800, Christian Kujau wrote:
> Hi,
> 
> while compiling xfstests after configuring with a different CFLAGS value, 
> gcc fails in ./src:
> 
> [...]
> make[2]: Entering directory `/usr/local/src/xfstests-git/src'
> gcc -g -O2 -DDEBUG  -I../include -DVERSION=\"1.0.0\" -L/opt/xfsprogs/lib  
> -DREAD iopat.c -o preallo_rw_pattern_reader
> iopat.c:21:21: error: xfs/xfs.h: No such file or directory
> [...]
> 
> Somehow CFLAGS isn't passed to gcc, but "GCFLAGS" is. I'm not too savvy 
> with the xfstests build system, but in include/builddefs.in we see:
> 
>    # Global, Platform, Local CFLAGS
>    CFLAGS += $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)
> 
> ...thus I'm proposing the following fix:

This looks correct, or at least better than what we had before.
But I really dislike how we defeat the abstraction used for compiling
all the other tools.

What might be better is to add a small
preallo_rw_pattern_writer.c file that just contains:

#define WRITE
#include iopat.c

and the same for the reader side and use the normal rules to compile
the program.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-06 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-02 22:16 [PATCH] use CFLAGS in src/Makefile Christian Kujau
2010-01-06 16:39 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox