[PATCH] use CFLAGS in src/Makefile

Christian Kujau lists at nerdbynature.de
Sat Jan 2 16:16:08 CST 2010


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.




More information about the xfs mailing list