3c9b186fb932384a98368b3d8ba67c4772ac6b28
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / nettle / 0001-fix-shared-only-build.patch
1 static/shared: use available libraries when linking our tools/examples/testsuite
2
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.
5
6 Use whatever libraries are available, with a preference toward using shared
7 libraries.
8
9 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
10
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
14 @@ -30,6 +30,8 @@
15  PACKAGE_VERSION = @PACKAGE_VERSION@
16  
17  SHLIBCFLAGS = @SHLIBCFLAGS@
18 +@IF_STATIC@LIBS_EXT = .a
19 +@IF_SHARED@LIBS_EXT = .so
20  
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
26 @@ -34,19 +34,19 @@
27  DISTFILES = $(SOURCES) Makefile.in input.h misc.h output.h parse.h
28  
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 $@
33  
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 $@
37  
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 $@
42  
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 $@
48  
49  
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
53 @@ -117,8 +117,8 @@
54         -lhogweed -lnettle $(BENCH_LIBS) $(LIBS) $(OPENSSL_LIBFLAGS) \
55         -o hogweed-benchmark$(EXEEXT)
56  
57 -$(TARGETS) : io.$(OBJEXT) ../libnettle.a
58 -$(HOGWEED_TARGETS): ../libhogweed.a
59 +$(TARGETS) : io.$(OBJEXT) ../libnettle$(LIBS_EXT)
60 +$(HOGWEED_TARGETS): ../libhogweed$(LIBS_EXT)
61  
62  check: $(TS_ALL)
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
67 @@ -96,7 +96,7 @@
68  include $(srcdir)/.test-rules.make
69  
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)
73  
74  # For use as, e.g.,
75  #