python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / wiringpi / 0001-Adjust-for-buildroot-build.patch
blob520555c8e8fd57be2c52128de34bef467fe48bea
1 From 17ffb0cb301d4bf6ef900c8698d716f68cb77360 Mon Sep 17 00:00:00 2001
2 From: Peter Seiderer <ps.report@gmx.net>
3 Date: Wed, 2 Dec 2015 00:22:26 +0100
4 Subject: [PATCH] Adjust for buildroot build.
6 - enable CC override
7 - fix devLib/gpio include path for local build (without installing first)
8 - change CFLAGS from '=' to '+=' to honour buildroot given flags
9 - add linker name link for libwiringPiDev and libwiringPi for local linking
10 (without installing first)
11 - fix install linker name link (do not link with absolute path)
12 - add gpio-static linking target
14 Signed-off-by: Peter Seiderer <ps.report@gmx.net>
15 ---
16 devLib/Makefile | 9 +++++----
17 gpio/Makefile | 14 +++++++++-----
18 wiringPi/Makefile | 7 ++++---
19 3 files changed, 18 insertions(+), 12 deletions(-)
21 diff --git a/devLib/Makefile b/devLib/Makefile
22 index cf665d6..3fb41e8 100644
23 --- a/devLib/Makefile
24 +++ b/devLib/Makefile
25 @@ -36,10 +36,10 @@ DYNAMIC=libwiringPiDev.so.$(VERSION)
27 #DEBUG = -g -O0
28 DEBUG = -O2
29 -CC = gcc
30 -INCLUDE = -I.
31 +CC ?= gcc
32 +INCLUDE = -I../wiringPi
33 DEFS = -D_GNU_SOURCE
34 -CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
35 +CFLAGS += $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
37 LIBS =
39 @@ -69,6 +69,7 @@ $(STATIC): $(OBJ)
40 $(DYNAMIC): $(OBJ)
41 $Q echo "[Link (Dynamic)]"
42 $Q $(CC) -shared -Wl,-soname,libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
43 + $Q ln -sf libwiringPiDev.so.$(VERSION) libwiringPiDev.so
45 .c.o:
46 $Q echo [Compile] $<
47 @@ -93,7 +94,7 @@ install: $(DYNAMIC)
48 $Q echo "[Install Dynamic Lib]"
49 $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
50 $Q install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
51 - $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
52 + $Q ln -sf libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so
53 $Q $(LDCONFIG)
55 .PHONY: install-static
56 diff --git a/gpio/Makefile b/gpio/Makefile
57 index f41a005..7095fa5 100644
58 --- a/gpio/Makefile
59 +++ b/gpio/Makefile
60 @@ -32,11 +32,11 @@ endif
62 #DEBUG = -g -O0
63 DEBUG = -O2
64 -CC = gcc
65 -INCLUDE = -I$(DESTDIR)$(PREFIX)/include
66 -CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
67 +CC ?= gcc
68 +INCLUDE = -I../wiringPi -I../devLib
69 +CFLAGS += $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
71 -LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
72 +LDFLAGS = -L../wiringPi -L../devLib
73 LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt
75 # May not need to alter anything below this line
76 @@ -52,9 +52,13 @@ version.h: ../VERSION
77 $Q echo Need to run newVersion above.
79 gpio: $(OBJ)
80 - $Q echo [Link]
81 + $Q echo "[Link (Dynamic)]"
82 $Q $(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
84 +gpio-static: $(OBJ)
85 + $Q echo "[Link (Static)]"
86 + $Q $(CC) -static -o gpio $(OBJ) ../wiringPi/libwiringPi.a ../devLib/libwiringPiDev.a -lpthread
88 .c.o:
89 $Q echo [Compile] $<
90 $Q $(CC) -c $(CFLAGS) $< -o $@
91 diff --git a/wiringPi/Makefile b/wiringPi/Makefile
92 index e1868b9..68c950e 100644
93 --- a/wiringPi/Makefile
94 +++ b/wiringPi/Makefile
95 @@ -36,10 +36,10 @@ DYNAMIC=libwiringPi.so.$(VERSION)
97 #DEBUG = -g -O0
98 DEBUG = -O2
99 -CC = gcc
100 +CC ?= gcc
101 INCLUDE = -I.
102 DEFS = -D_GNU_SOURCE
103 -CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Winline $(INCLUDE) -pipe -fPIC
104 +CFLAGS += $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Winline $(INCLUDE) -pipe -fPIC
106 LIBS = -lm -lpthread -lrt -lcrypt
108 @@ -79,6 +79,7 @@ $(STATIC): $(OBJ)
109 $(DYNAMIC): $(OBJ)
110 $Q echo "[Link (Dynamic)]"
111 $Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(LIBS) $(OBJ)
112 + $Q ln -sf libwiringPi.so.$(VERSION) libwiringPi.so
114 .c.o:
115 $Q echo [Compile] $<
116 @@ -104,7 +105,7 @@ install: $(DYNAMIC)
117 $Q echo "[Install Dynamic Lib]"
118 $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
119 $Q install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)
120 - $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so
121 + $Q ln -sf libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPi.so
122 $Q $(LDCONFIG)
124 .PHONY: install-static
126 2.11.0