xfs
[Top] [All Lists]

[PATCH] use CFLAGS in src/Makefile

To: xfs@xxxxxxxxxxx
Subject: [PATCH] use CFLAGS in src/Makefile
From: Christian Kujau <lists@xxxxxxxxxxxxxxx>
Date: Sat, 2 Jan 2010 14:16:08 -0800 (PST)
User-agent: Alpine 2.01 (DEB 1266 2009-07-14)
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.

<Prev in Thread] Current Thread [Next in Thread>