1 static/shared: use available libraries when linking our tools/examples/testsuite
3 For a shared-only build, static libraries do not exist, so the build fails as
4 soon as we try to link either of our tools, examples or testsuite utils.
6 Use whatever libraries are available, with a preference toward using shared
9 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
11 diff -durN nettle-2.7.1.orig/config.make.in nettle-2.7.1/config.make.in
12 --- nettle-2.7.1.orig/config.make.in 2013-05-28 16:21:53.000000000 +0200
13 +++ nettle-2.7.1/config.make.in 2014-12-12 19:56:07.031292752 +0100
15 PACKAGE_VERSION = @PACKAGE_VERSION@
17 SHLIBCFLAGS = @SHLIBCFLAGS@
18 +@IF_STATIC@LIBS_EXT = .a
19 +@IF_SHARED@LIBS_EXT = .so
21 LIBNETTLE_MAJOR = @LIBNETTLE_MAJOR@
22 LIBNETTLE_MINOR = @LIBNETTLE_MINOR@
23 diff -durN nettle-2.7.1.orig/tools/Makefile.in nettle-2.7.1/tools/Makefile.in
24 --- nettle-2.7.1.orig/tools/Makefile.in 2013-05-28 16:21:54.000000000 +0200
25 +++ nettle-2.7.1/tools/Makefile.in 2014-12-12 19:57:12.499805574 +0100
27 DISTFILES = $(SOURCES) Makefile.in input.h misc.h output.h parse.h
29 sexp_conv_OBJS = $(sexp_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
30 -sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.a
31 +sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle$(LIBS_EXT)
32 $(LINK) $(sexp_conv_OBJS) -lnettle $(LIBS) -o $@
34 -nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle.a
35 +nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle$(LIBS_EXT)
36 $(LINK) nettle-lfib-stream.$(OBJEXT) -lnettle $(LIBS) -o $@
38 pkcs1_conv_OBJS = $(pkcs1_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
39 -pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle.a ../libhogweed.a
40 +pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle$(LIBS_EXT) ../libhogweed$(LIBS_EXT)
41 $(LINK) $(pkcs1_conv_OBJS) -lhogweed -lnettle $(LIBS) -o $@
43 # FIXME: Avoid linking with gmp
44 nettle_hash_OBJS = $(nettle_hash_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
45 -nettle-hash$(EXEEXT): $(nettle_hash_OBJS) ../libnettle.a
46 +nettle-hash$(EXEEXT): $(nettle_hash_OBJS) ../libnettle$(LIBS_EXT)
47 $(LINK) $(nettle_hash_OBJS) -lnettle $(LIBS) -o $@
50 diff -durN nettle-2.7.1.orig/examples/Makefile.in nettle-2.7.1/examples/Makefile.in
51 --- nettle-2.7.1.orig/examples/Makefile.in 2013-05-28 16:21:54.000000000 +0200
52 +++ nettle-2.7.1/examples/Makefile.in 2014-12-12 21:54:48.286251022 +0100
54 -lhogweed -lnettle $(BENCH_LIBS) $(LIBS) $(OPENSSL_LIBFLAGS) \
55 -o hogweed-benchmark$(EXEEXT)
57 -$(TARGETS) : io.$(OBJEXT) ../libnettle.a
58 -$(HOGWEED_TARGETS): ../libhogweed.a
59 +$(TARGETS) : io.$(OBJEXT) ../libnettle$(LIBS_EXT)
60 +$(HOGWEED_TARGETS): ../libhogweed$(LIBS_EXT)
63 LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" srcdir="$(srcdir)" \
64 diff -durN nettle-2.7.1.orig/testsuite/Makefile.in nettle-2.7.1/testsuite/Makefile.in
65 --- nettle-2.7.1.orig/testsuite/Makefile.in 2013-05-28 16:21:54.000000000 +0200
66 +++ nettle-2.7.1/testsuite/Makefile.in 2014-12-12 21:55:30.414814549 +0100
68 include $(srcdir)/.test-rules.make
70 $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \
71 - ../libnettle.a @IF_HOGWEED@ ../libhogweed.a
72 + ../libnettle$(LIBS_EXT) @IF_HOGWEED@ ../libhogweed$(LIBS_EXT)