]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm/mdmon: use CFLAGS when linking
authorMike Frysinger <vapier@gentoo.org>
Mon, 11 Apr 2011 04:54:42 +0000 (14:54 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 11 Apr 2011 04:54:42 +0000 (14:54 +1000)
People often put flags that control ABI options into CFLAGS (like -mcpu)
and don't duplicate them in LDFLAGS because most build systems nowadays
(like autotools) use both when linking.  So make that work with mdadm's
custom build system too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Makefile

index 222358f2d7920665bf5f0f4c1b4b64c76326c2b2..72087bea8139f5b1eff934a8cf8f56b07a1c7742 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -149,10 +149,10 @@ everything-test: all mdadm.static swap_super test_stripe \
 # mdadm.tcc doesn't work..
 
 mdadm : $(OBJS)
-       $(CC) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS)
 
 mdadm.static : $(OBJS) $(STATICOBJS)
-       $(CC) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS)
 
 mdadm.tcc : $(SRCS) $(INCL)
        $(TCC) -o mdadm.tcc $(SRCS)
@@ -172,7 +172,7 @@ mdmon.O2 : $(MON_SRCS) $(INCL) mdmon.h
 
 # use '-z now' to guarantee no dynamic linker interactions with the monitor thread
 mdmon : $(MON_OBJS)
-       $(CC) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS)
 msg.o: msg.c msg.h
 
 test_stripe : restripe.c mdadm.h