git: fix build with with no threads
[buildroot-gz.git] / package / libaio / 0002-src-Makefile-add-ENABLE_SHARED-boolean-to-allow-stat.patch
blob50703c3f53e3ae7a1c4b519b630b9929014c0381
1 From 14dee5707716629b1bc8d06b93cdfe9ea1a3b813 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Mon, 29 Aug 2016 22:14:26 +0200
4 Subject: [PATCH] src/Makefile: add ENABLE_SHARED boolean to allow static-only
5 build
7 Currently, the libaio builds sytem builds a shared library
8 unconditionally. In some environments, this is not possible or
9 desirable. This commit adds a new Makefile variable, ENABLE_SHARED,
10 which defaults to "1" (i.e shared library enabled) and that allows to
11 override this behavior, and therefore to disable the build and
12 installation of the shared library.
14 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15 ---
16 src/Makefile | 9 ++++++++-
17 1 file changed, 8 insertions(+), 1 deletion(-)
19 diff --git a/src/Makefile b/src/Makefile
20 index eadb336..cfab240 100644
21 --- a/src/Makefile
22 +++ b/src/Makefile
23 @@ -8,12 +8,17 @@ SO_CFLAGS=-shared $(CFLAGS)
24 L_CFLAGS=$(CFLAGS)
25 LINK_FLAGS=
26 LINK_FLAGS+=$(LDFLAGS)
27 +ENABLE_SHARED ?= 1
29 soname=libaio.so.1
30 minor=0
31 micro=1
32 libname=$(soname).$(minor).$(micro)
33 -all_targets += libaio.a $(libname)
34 +all_targets += libaio.a
36 +ifeq ($(ENABLE_SHARED),1)
37 +all_targets += $(libname)
38 +endif
40 all: $(all_targets)
42 @@ -55,9 +60,11 @@ $(libname): $(libaio_sobjs) libaio.map
43 install: $(all_targets)
44 install -D -m 644 libaio.h $(includedir)/libaio.h
45 install -D -m 644 libaio.a $(libdir)/libaio.a
46 +ifeq ($(ENABLE_SHARED),1)
47 install -D -m 755 $(libname) $(libdir)/$(libname)
48 ln -sf $(libname) $(libdir)/$(soname)
49 ln -sf $(libname) $(libdir)/libaio.so
50 +endif
52 $(libaio_objs): libaio.h
54 --
55 2.7.4