python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / mpdecimal / 0001-Add-minimal-support-for-enable-disable-shared-static.patch
blob630bbd664229abc56cd830ba035bf4a965964495
1 From c349964887901848fb4cd5db53a5bcb6dae27aaa Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sun, 23 Nov 2014 10:16:33 +0100
4 Subject: [PATCH] Add minimal support for --{enable,disable}-{shared,static}
6 mpdecimal uses autoconf, but not automake or libtool, so this commit
7 adds some basic handling of --{enable,disable}-{shared,static}, so
8 that building the shared library can be disabled in pure static
9 library contexts.
11 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 ---
13 Makefile.in | 6 ++++++
14 configure.ac | 13 +++++++++++++
15 libmpdec/Makefile.in | 11 ++++++++++-
16 3 files changed, 29 insertions(+), 1 deletion(-)
18 diff --git a/Makefile.in b/Makefile.in
19 index 2c91891..0c44f36 100644
20 --- a/Makefile.in
21 +++ b/Makefile.in
22 @@ -9,6 +9,8 @@ LIBSTATIC = @LIBSTATIC@
23 LIBSONAME = @LIBSONAME@
24 LIBSHARED = @LIBSHARED@
25 INSTALL = @INSTALL@
26 +BUILD_SHARED = @BUILD_SHARED@
27 +BUILD_STATIC = @BUILD_STATIC@
29 prefix = @prefix@
30 exec_prefix = @exec_prefix@
31 @@ -32,9 +34,13 @@ install: FORCE
32 $(INSTALL) -d -m 755 $(DESTDIR)$(includedir)
33 $(INSTALL) -m 644 libmpdec/mpdecimal.h $(DESTDIR)$(includedir)
34 $(INSTALL) -d -m 755 $(DESTDIR)$(libdir)
35 +ifeq ($(BUILD_STATIC),yes)
36 $(INSTALL) -m 644 libmpdec/$(LIBSTATIC) $(DESTDIR)$(libdir)
37 +endif
38 +ifeq ($(BUILD_SHARED),yes)
39 $(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)
40 cd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so
41 +endif
42 $(INSTALL) -d -m 755 $(DESTDIR)$(docdir)
43 cp -R doc/* $(DESTDIR)$(docdir)
45 diff --git a/configure.ac b/configure.ac
46 index 7ee8f86..2b3e505 100644
47 --- a/configure.ac
48 +++ b/configure.ac
49 @@ -88,6 +88,19 @@ CFLAGS="$saved_cflags"
50 AC_PROG_INSTALL
51 AC_SUBST(INSTALL)
53 +AC_ARG_ENABLE([shared],
54 + [AS_HELP_STRING([--enable-shared], [build shared library])],
55 + [BUILD_SHARED=$enableval],
56 + [BUILD_SHARED=yes])
58 +AC_ARG_ENABLE([static],
59 + [AS_HELP_STRING([--enable-static], [build static library])],
60 + [BUILD_STATIC=$enableval],
61 + [BUILD_STATIC=yes])
63 +AC_SUBST(BUILD_SHARED)
64 +AC_SUBST(BUILD_STATIC)
66 # _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect:
67 # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
68 AC_MSG_CHECKING(for glibc _FORTIFY_SOURCE/memmove bug)
69 diff --git a/libmpdec/Makefile.in b/libmpdec/Makefile.in
70 index d9619a3..985c73c 100644
71 --- a/libmpdec/Makefile.in
72 +++ b/libmpdec/Makefile.in
73 @@ -7,6 +7,8 @@
74 LIBSTATIC = @LIBSTATIC@
75 LIBSONAME = @LIBSONAME@
76 LIBSHARED = @LIBSHARED@
77 +BUILD_SHARED = @BUILD_SHARED@
78 +BUILD_STATIC = @BUILD_STATIC@
80 CC = @CC@
81 LD = @LD@
82 @@ -32,8 +34,15 @@ ifeq ($(MAKECMDGOALS), profile_use)
83 MPD_LDFLAGS += $(MPD_PUSE)
84 endif
86 +ifeq ($(BUILD_SHARED),yes)
87 +TARGETS += $(LIBSHARED)
88 +endif
90 +ifeq ($(BUILD_STATIC),yes)
91 +TARGETS += $(LIBSTATIC)
92 +endif
94 -default: $(LIBSTATIC) $(LIBSHARED)
95 +default: $(TARGETS)
98 OBJS := basearith.o context.o constants.o convolute.o crt.o mpdecimal.o \
99 --
100 2.1.0