• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/mpdecimal/0001-Add-minimal-support-for-enable-disable-shared-static.patch
Thomas PetazzoniThomas Petazzoni committed 4f7249b281723 Nov 2014
Raw file
Source viewDiff to previous
 
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}
5
​
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.
10
​
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(-)
17
​
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@
28
 
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)
44
 
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)
52
 
53
+AC_ARG_ENABLE([shared],
54
+   [AS_HELP_STRING([--enable-shared], [build shared library])],
55
+   [BUILD_SHARED=$enableval],
56
+   [BUILD_SHARED=yes])
57
+
58
+AC_ARG_ENABLE([static],
59
+   [AS_HELP_STRING([--enable-static], [build static library])],
60
+   [BUILD_STATIC=$enableval],
61
+   [BUILD_STATIC=yes])
62
+
63
+AC_SUBST(BUILD_SHARED)
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.