Commit e649a481 authored by Niels Möller's avatar Niels Möller

Fixed link dependency problems with --disable-static.

parent a0ac8543
2013-09-18 Niels Möller <nisse@lysator.liu.se>
* Makefile.in: New stampfiles, libnettle.stamp and
libhogweed.stamp, updated when both static and shared libraries
are rebuilt. Used as link dependencies in subdirectories.
* examples/Makefile.in: Make executable targets depend on
../libnettle.stamp and libhogweed.stamp, not directly on the
static library files.
* testsuite/Makefile.in: Likewise.
* tools/Makefile.in: Likewise.
2013-09-09 Niels Möller <nisse@lysator.liu.se>
* gcm.c [HAVE_NATIVE_gcm_gf_mul_8]: Make use of (optional)
......
......@@ -190,11 +190,13 @@ libnettle.a: $(nettle_OBJS)
-rm -f $@
$(AR) $(ARFLAGS) $@ $(nettle_OBJS)
$(RANLIB) $@
echo nettle > libnettle.stamp
libhogweed.a: $(hogweed_OBJS)
-rm -f $@
$(AR) $(ARFLAGS) $@ $(hogweed_OBJS)
$(RANLIB) $@
echo hogweed > libhogweed.stamp
.c.$(OBJEXT):
$(COMPILE) $(CCPIC_MAYBE) -c $< \
......@@ -210,6 +212,7 @@ $(LIBNETTLE_FORLINK): $(nettle_PURE_OBJS)
&& [ -z "$(LIBNETTLE_SONAME)" ] \
|| { rm -f $(LIBNETTLE_SONAME) \
&& $(LN_S) $(LIBNETTLE_FORLINK) $(LIBNETTLE_SONAME) ; } )
echo nettle > libnettle.stamp
$(LIBHOGWEED_FORLINK): $(hogweed_PURE_OBJS) $(LIBNETTLE_FORLINK)
$(LIBHOGWEED_LINK) $(hogweed_PURE_OBJS) -o $@ $(LIBHOGWEED_LIBS)
......@@ -220,6 +223,7 @@ $(LIBHOGWEED_FORLINK): $(hogweed_PURE_OBJS) $(LIBNETTLE_FORLINK)
&& [ -z "$(LIBHOGWEED_SONAME)" ] \
|| { rm -f $(LIBHOGWEED_SONAME) \
&& $(LN_S) $(LIBHOGWEED_FORLINK) $(LIBHOGWEED_SONAME) ; } )
echo hogweed > libhogweed.stamp
.c.p$(OBJEXT):
$(COMPILE) $(SHLIBCFLAGS) -c $< -o $@ \
......@@ -577,7 +581,7 @@ clean-here:
-rm -f $(TARGETS) $(IMPLICIT_TARGETS) *.$(OBJEXT) *.p$(OBJEXT) *.s \
ecc-192.h ecc-224.h ecc-256.h ecc-384.h ecc-521.h \
eccdata$(EXEEXT_FOR_BUILD) eccdata.stamp
-rm -rf .lib
-rm -rf .lib libnettle.stamp libhogweed.stamp
distclean-here: clean-here
-rm -f config.h stamp-h config.log config.status machine.m4 \
......
......@@ -117,8 +117,8 @@ hogweed-benchmark$(EXEEXT): $(HOGWEED_BENCH_OBJS)
-lhogweed -lnettle $(BENCH_LIBS) $(LIBS) $(OPENSSL_LIBFLAGS) \
-o hogweed-benchmark$(EXEEXT)
$(TARGETS) : io.$(OBJEXT) ../libnettle.a
$(HOGWEED_TARGETS): ../libhogweed.a
$(TARGETS) : io.$(OBJEXT) ../libnettle.stamp
$(HOGWEED_TARGETS): ../libhogweed.stamp
check: $(TS_ALL)
LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" srcdir="$(srcdir)" \
......
......@@ -96,7 +96,7 @@ test-rules:
include $(srcdir)/.test-rules.make
$(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \
../libnettle.a @IF_HOGWEED@ ../libhogweed.a
../libnettle.stamp @IF_HOGWEED@ ../libhogweed.stamp
# For use as, e.g.,
#
......
......@@ -36,23 +36,23 @@ SOURCES = $(sexp_conv_SOURCES) nettle-hash.c nettle-lfib-stream.c pkcs1-conv.c
DISTFILES = $(SOURCES) Makefile.in input.h misc.h output.h parse.h
sexp_conv_OBJS = $(sexp_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.a
sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.stamp
$(LINK) $(sexp_conv_OBJS) -lnettle $(LIBS) -o $@
nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle.a
nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle.stamp
$(LINK) nettle-lfib-stream.$(OBJEXT) -lnettle $(LIBS) -o $@
pkcs1_conv_OBJS = $(pkcs1_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle.a ../libhogweed.a
pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle.stamp ../libhogweed.stamp
$(LINK) $(pkcs1_conv_OBJS) -lhogweed -lnettle $(LIBS) -o $@
# FIXME: Avoid linking with gmp
nettle_hash_OBJS = $(nettle_hash_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
nettle-hash$(EXEEXT): $(nettle_hash_OBJS) ../libnettle.a
nettle-hash$(EXEEXT): $(nettle_hash_OBJS) ../libnettle.stamp
$(LINK) $(nettle_hash_OBJS) -lnettle -o $@
nettle_pbkdf2_OBJS = $(nettle_pbkdf2_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
nettle-pbkdf2$(EXEEXT): $(nettle_pbkdf2_OBJS) ../libnettle.a
nettle-pbkdf2$(EXEEXT): $(nettle_pbkdf2_OBJS) ../libnettle.stamp
$(LINK) $(nettle_pbkdf2_OBJS) -lnettle -o $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment