• 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/lm-sensors/0001-static-build.patch
Peter KorsgaardPeter Korsgaard committed 298cd8eaa2103 Feb 2015
Raw file
Source viewDiff to previous
 
1
Add support for static only build
2
​
3
This patch adds support for a BUILD_SHARED_LIB variable that allows to
4
enable/disable the build of the shared library, in order to support
5
static-only builds.
6
​
7
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8
​
9
Index: b/Makefile
10
===================================================================
11
--- a/Makefile
12
+++ b/Makefile
13
@@ -85,6 +85,9 @@
14
 # Build and install static library
15
 BUILD_STATIC_LIB := 1
16
 
17
+# Build and install shared library
18
+BUILD_SHARED_LIB := 1
19
+
20
 # Set these to add preprocessor or compiler flags, or use
21
 # environment variables
22
 # CFLAGS :=
23
Index: b/lib/Module.mk
24
===================================================================
25
--- a/lib/Module.mk
26
+++ b/lib/Module.mk
27
@@ -43,8 +43,14 @@
28
 LIBSTLIBNAME := libsensors.a
29
 LIBSHSONAME := libsensors.so.$(LIBMAINVER)
30
 
31
+ifeq ($(BUILD_SHARED_LIB),1)
32
 LIBTARGETS := $(MODULE_DIR)/$(LIBSHLIBNAME) \
33
               $(MODULE_DIR)/$(LIBSHSONAME) $(MODULE_DIR)/$(LIBSHBASENAME)
34
+LIBDEP_FOR_PROGS := $(LIBSHBASENAME)
35
+else
36
+LIBDEP_FOR_PROGS := $(LIBSTLIBNAME)
37
+endif
38
+
39
 ifeq ($(BUILD_STATIC_LIB),1)
40
 LIBTARGETS += $(MODULE_DIR)/$(LIBSTLIBNAME)
41
 endif
42
@@ -131,9 +137,11 @@
43
 ifeq ($(BUILD_STATIC_LIB),1)
44
    $(INSTALL) -m 644 $(LIB_DIR)/$(LIBSTLIBNAME) $(DESTDIR)$(LIBDIR)
45
 endif
46
+ifeq ($(BUILD_SHARED_LIB),1)
47
    $(INSTALL) -m 755 $(LIB_DIR)/$(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)
48
    $(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME)
49
    $(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME)
50
+endif
51
    @if [ -z "$(DESTDIR)" -a "$(LIBDIR)" != "/usr/lib" -a "$(LIBDIR)" != "/lib" ] ; then \
52
       if [ -e "/usr/lib/$(LIBSHSONAME)" -o -e "/usr/lib/$(LIBSHBASENAME)" ] ; then \
53
         echo '******************************************************************************' ; \
54
Index: b/prog/sensord/Module.mk
55
===================================================================
56
--- a/prog/sensord/Module.mk
57
+++ b/prog/sensord/Module.mk
58
@@ -41,7 +41,7 @@
59
 REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
60
 REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
61
 
62
-$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
63
+$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS)
  • 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.