From: Carlos Maddela Date: Fri, 23 Dec 2016 02:10:17 +1100 Subject: Fix position of LDFLAGS in link commands. Description: Fix position of LDFLAGS in link commands. magicrescue builds without dupemap on Ubuntu because the conftest_link() function in the configure script fails to link with the gdbm library, due to the position of the LDFLAGS in the link command. Reordering fixes the problem. . The same fix is also required in the Makefile, otherwise the package will fail to build. Author: Carlos Maddela --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- Makefile.in | 10 +++++----- configure | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index ee9038f..a977a90 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,19 +18,19 @@ all: $(PROGRAMS) docs # program targets magicrescue: $(MAGICRESCUE_OBJS) - $(CC) -o $@ $(LDFLAGS) $(MAGICRESCUE_OBJS) + $(CC) -o $@ $(MAGICRESCUE_OBJS) $(LDFLAGS) dupemap: $(DUPEMAP_OBJS) - $(CC) -o $@ $(LDFLAGS) $(DBM_LDFLAGS) $(DUPEMAP_OBJS) + $(CC) -o $@ $(DUPEMAP_OBJS) $(LDFLAGS) $(DBM_LDFLAGS) tools/inputseek: $(INPUTSEEK_OBJS) - $(CC) -o $@ $(LDFLAGS) $(INPUTSEEK_OBJS) + $(CC) -o $@ $(INPUTSEEK_OBJS) $(LDFLAGS) tools/safecat: $(SAFECAT_OBJS) - $(CC) -o $@ $(LDFLAGS) $(SAFECAT_OBJS) + $(CC) -o $@ $(SAFECAT_OBJS) $(LDFLAGS) tools/textextract: $(TEXTEXTRACT_OBJS) - $(CC) -o $@ $(LDFLAGS) $(TEXTEXTRACT_OBJS) + $(CC) -o $@ $(TEXTEXTRACT_OBJS) $(LDFLAGS) # implicit targets .c.o: diff --git a/configure b/configure index 90b2f06..a479ba1 100755 --- a/configure +++ b/configure @@ -63,9 +63,9 @@ EOF } conftest_link() { - echo "$CC -o conftest $LDFLAGS conftest.o" >&5 + echo "$CC -o conftest conftest.o $LDFLAGS" >&5 echo >&5 - $CC -o conftest $LDFLAGS conftest.o >&5 2>&5 \ + $CC -o conftest conftest.o $LDFLAGS >&5 2>&5 \ && [ -x conftest ] && ./conftest 2>&5 }