From 53904ae543591a46688650003085978669d67c13 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 5 Sep 2014 15:42:32 -0700 Subject: [PATCH] Apply LDFLAGS when building tests Signed-off-by: Michael Forney Signed-off-by: Theodore Ts'o --- e2fsck/Makefile.in | 17 +++++++++-------- lib/ext2fs/Makefile.in | 23 ++++++++++++----------- lib/ss/Makefile.in | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in index 3ab2d8e..b1ce222 100644 --- a/e2fsck/Makefile.in +++ b/e2fsck/Makefile.in @@ -138,34 +138,35 @@ crc32table.h: gen_crc32table tst_sigcatcher: $(srcdir)/sigcatcher.c sigcatcher.o $(E) " CC $@" - $(Q) $(CC) $(BUILD_LDFLAGS) $(ALL_CFLAGS) $(RDYNAMIC) \ + $(Q) $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(RDYNAMIC) \ $(srcdir)/sigcatcher.c -DDEBUG -o tst_sigcatcher tst_problem: $(srcdir)/problem.c $(srcdir)/problem.h $(LIBEXT2FS) \ $(DEPLIBCOM_ERR) - $(Q) $(CC) $(BUILD_LDFLAGS) $(ALL_CFLAGS) -o tst_problem \ + $(Q) $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o tst_problem \ $(srcdir)/problem.c -DUNITTEST $(LIBEXT2FS) $(LIBCOM_ERR) \ $(LIBINTL) $(SYSLIBS) tst_crc32: $(srcdir)/crc32.c $(LIBEXT2FS) $(DEPLIBCOM_ERR) - $(Q) $(CC) $(BUILD_LDFLAGS) $(ALL_CFLAGS) -o tst_crc32 $(srcdir)/crc32.c \ + $(Q) $(CC) $(ALL_LDFLAGS) $(ALL_CFLAGS) -o tst_crc32 $(srcdir)/crc32.c \ -DUNITTEST $(LIBEXT2FS) $(LIBCOM_ERR) $(SYSLIBS) tst_refcount: ea_refcount.c $(DEPLIBCOM_ERR) $(E) " LD $@" $(Q) $(CC) -o tst_refcount $(srcdir)/ea_refcount.c \ - $(ALL_CFLAGS) -DTEST_PROGRAM $(LIBCOM_ERR) $(LIBEXT2FS) \ - $(SYSLIBS) + $(ALL_CFLAGS) $(ALL_LDFLAGS) -DTEST_PROGRAM \ + $(LIBCOM_ERR) $(LIBEXT2FS) $(SYSLIBS) tst_logfile: $(srcdir)/logfile.c $(E) " LD $@" - $(Q) $(CC) -o tst_logfile $(srcdir)/logfile.c $(ALL_CFLAGS) \ - -DTEST_PROGRAM $(SYSLIBS) + $(Q) $(CC) -o tst_logfile $(srcdir)/logfile.c \ + $(ALL_CFLAGS) $(ALL_LDFLAGS) -DTEST_PROGRAM $(SYSLIBS) tst_region: region.c $(DEPLIBCOM_ERR) $(E) " LD $@" $(Q) $(CC) -o tst_region $(srcdir)/region.c \ - $(ALL_CFLAGS) -DTEST_PROGRAM $(LIBCOM_ERR) $(SYSLIBS) + $(ALL_CFLAGS) $(ALL_LDFLAGS) -DTEST_PROGRAM \ + $(LIBCOM_ERR) $(SYSLIBS) check:: tst_refcount tst_region tst_crc32 tst_problem $(TESTENV) ./tst_refcount diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in index b631489..847c26b 100644 --- a/lib/ext2fs/Makefile.in +++ b/lib/ext2fs/Makefile.in @@ -253,39 +253,40 @@ tst_badblocks: tst_badblocks.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) tst_icount: $(srcdir)/icount.c $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o tst_icount $(srcdir)/icount.c -DDEBUG $(ALL_CFLAGS) \ + $(Q) $(CC) -o tst_icount $(srcdir)/icount.c -DDEBUG \ + $(ALL_CFLAGS) $(ALL_LDFLAGS) \ $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_iscan: tst_iscan.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o tst_iscan tst_iscan.o $(ALL_LDFLAGS) $(STATIC_LIBEXT2FS) \ - $(STATIC_LIBCOM_ERR) $(SYSLIBS) + $(Q) $(CC) -o tst_iscan tst_iscan.o $(ALL_LDFLAGS) \ + $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_getsize: tst_getsize.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o tst_getsize tst_getsize.o $(STATIC_LIBEXT2FS) \ - $(STATIC_LIBCOM_ERR) $(SYSLIBS) + $(Q) $(CC) -o tst_getsize tst_getsize.o $(ALL_LDFLAGS) \ + $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_ismounted: $(srcdir)/ismounted.c $(STATIC_LIBEXT2FS) \ $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" $(Q) $(CC) -o tst_ismounted $(srcdir)/ismounted.c \ - $(STATIC_LIBEXT2FS) -DDEBUG $(ALL_CFLAGS) \ + $(STATIC_LIBEXT2FS) -DDEBUG $(ALL_CFLAGS) $(ALL_LDFLAGS) \ $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_byteswap: tst_byteswap.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o tst_byteswap tst_byteswap.o $(STATIC_LIBEXT2FS) \ - $(STATIC_LIBCOM_ERR) $(SYSLIBS) + $(Q) $(CC) -o tst_byteswap tst_byteswap.o $(ALL_LDFLAGS) \ + $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_bitops: tst_bitops.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o tst_bitops tst_bitops.o $(ALL_CFLAGS) \ + $(Q) $(CC) -o tst_bitops tst_bitops.o $(ALL_CFLAGS) $(ALL_LDFLAGS) \ $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_getsectsize: tst_getsectsize.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o tst_sectgetsize tst_getsectsize.o \ + $(Q) $(CC) -o tst_sectgetsize tst_getsectsize.o $(ALL_LDFLAGS) \ $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS) tst_types.o: $(srcdir)/tst_types.c ext2_types.h @@ -304,7 +305,7 @@ tst_fs_struct.o: $(srcdir)/tst_fs_struct.c $(srcdir)/ext2fs.h tst_fs_struct: tst_fs_struct.o $(E) " LD $@" - $(Q) $(CC) -o tst_fs_struct tst_fs_struct.o $(SYSLIBS) + $(Q) $(CC) -o tst_fs_struct tst_fs_struct.o $(ALL_LDFLAGS) $(SYSLIBS) tst_inode_size.o: $(srcdir)/tst_inode_size.c $(srcdir)/ext2_fs.h diff --git a/lib/ss/Makefile.in b/lib/ss/Makefile.in index a9c7e25..0120e56 100644 --- a/lib/ss/Makefile.in +++ b/lib/ss/Makefile.in @@ -159,7 +159,7 @@ uninstall:: test_ss: test_ss.o test_cmd.o $(DEPLIBSS) $(DEPLIBCOM_ERR) $(E) " LD $@" - $(Q) $(CC) -o $@ test_ss.o test_cmd.o $(ALL_CFLAGS) \ + $(Q) $(CC) -o $@ test_ss.o test_cmd.o $(ALL_CFLAGS) $(ALL_LDFLAGS) \ $(LIBSS) $(LIBCOM_ERR) $(SYSLIBS) check:: all test_ss -- 1.8.3.1