]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/i2c-tools/0002-Makefile-Add-flag-to-disable-dynamic-library.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / i2c-tools / 0002-Makefile-Add-flag-to-disable-dynamic-library.patch
1 From 9906b2ecb6aec02d6348d6237b784135e6930d0b Mon Sep 17 00:00:00 2001
2 From: Angelo Compagnucci <angelo@amarulasolutions.com>
3 Date: Wed, 6 Dec 2017 10:12:07 +0100
4 Subject: Makefile: Add flag to disable dynamic library
5
6 In such cases where you need to disable entirely the dynamic
7 library compilation, now you can use the BUILD_DYNAMIC_LIB=0
8 flag.
9
10 Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
11 Signed-off-by: Jean Delvare <jdelvare@suse.de>
12 ---
13  Makefile      | 10 +++++++++-
14  lib/Module.mk |  6 +++++-
15  2 files changed, 14 insertions(+), 2 deletions(-)
16
17 diff --git a/Makefile b/Makefile
18 index c85317c..1bb5572 100644
19 --- a/Makefile
20 +++ b/Makefile
21 @@ -32,12 +32,20 @@ CFLAGS              ?= -O2
22  CFLAGS         += -Wall
23  SOCFLAGS       := -fpic -D_REENTRANT $(CFLAGS)
24  
25 -USE_STATIC_LIB ?= 0
26 +BUILD_DYNAMIC_LIB ?= 1
27  BUILD_STATIC_LIB ?= 1
28 +USE_STATIC_LIB ?= 0
29 +
30  ifeq ($(USE_STATIC_LIB),1)
31  BUILD_STATIC_LIB := 1
32  endif
33  
34 +ifeq ($(BUILD_DYNAMIC_LIB),0)
35 +ifeq ($(BUILD_STATIC_LIB),0)
36 +$(error BUILD_DYNAMIC_LIB and BUILD_STATIC_LIB cannot be disabled at the same time)
37 +endif
38 +endif
39 +
40  KERNELVERSION  := $(shell uname -r)
41  
42  .PHONY: all strip clean install uninstall
43 diff --git a/lib/Module.mk b/lib/Module.mk
44 index fd2c8c4..44fa938 100644
45 --- a/lib/Module.mk
46 +++ b/lib/Module.mk
47 @@ -27,9 +27,13 @@ LIB_SHSONAME := $(LIB_SHBASENAME).$(LIB_MAINVER)
48  LIB_SHLIBNAME  := $(LIB_SHBASENAME).$(LIB_VER)
49  LIB_STLIBNAME  := libi2c.a
50  
51 -LIB_TARGETS    := $(LIB_SHLIBNAME)
52  LIB_LINKS      := $(LIB_SHSONAME) $(LIB_SHBASENAME)
53  LIB_OBJECTS    := smbus.o
54 +
55 +LIB_TARGETS    :=
56 +ifeq ($(BUILD_DYNAMIC_LIB),1)
57 +LIB_TARGETS    += $(LIB_SHLIBNAME)
58 +endif
59  ifeq ($(BUILD_STATIC_LIB),1)
60  LIB_TARGETS    += $(LIB_STLIBNAME)
61  LIB_OBJECTS    += smbus.ao
62 -- 
63 2.7.4
64