diff options
| author | Petter Mabäcker <petter@technux.se> | 2015-07-19 11:11:26 +0200 |
|---|---|---|
| committer | Andrei Gherzan <andrei@gherzan.ro> | 2015-07-19 14:53:27 +0200 |
| commit | 7457bf182c8fd550ec877ecd786a3edd16e65495 (patch) | |
| tree | 520967d212ca388f842424c6a44ff600a59d44bf | |
| parent | b78459f260f4c122a83482d269c755b8c3c096c3 (diff) | |
| download | meta-raspberrypi-7457bf182c8fd550ec877ecd786a3edd16e65495.tar.gz | |
wiringpi: Bump SRCREV
Update wiringpi to latest revision. Due to a refactoring of the build
procedure in wiringpi the integration patch 'makefile-install.patch'
didn't apply anymore. While migrating that patch it was simplified and
generated using 'git format-patch' instead, to make it easier to maintain
the patch in the future.
[Support #60]
Signed-off-by: Petter Mabäcker <petter@technux.se>
Acked-by: Andrei Gherzan <andrei@gherzan.ro>
3 files changed, 435 insertions, 206 deletions
diff --git a/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch b/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch new file mode 100644 index 0000000..c5ba270 --- /dev/null +++ b/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch | |||
| @@ -0,0 +1,429 @@ | |||
| 1 | From b0d82bc7cc90db41aa4f7012bbe3009f0b8ab11d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se> | ||
| 3 | Date: Sat, 18 Jul 2015 23:20:05 +0200 | ||
| 4 | Subject: [PATCH] Add initial cross compile support | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Petter Mabäcker <petter@technux.se> | ||
| 12 | --- | ||
| 13 | devLib/Makefile | 58 +++++++++++++++++++++++++-------------------- | ||
| 14 | examples/Gertboard/Makefile | 22 ++++++++++------- | ||
| 15 | examples/Makefile | 19 +++++++++------ | ||
| 16 | examples/PiFace/Makefile | 22 ++++++++++------- | ||
| 17 | examples/PiGlow/Makefile | 4 ++-- | ||
| 18 | examples/q2w/Makefile | 5 ++-- | ||
| 19 | gpio/Makefile | 31 +++++++++++++----------- | ||
| 20 | wiringPi/Makefile | 56 ++++++++++++++++++++++++------------------- | ||
| 21 | 8 files changed, 124 insertions(+), 93 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/devLib/Makefile b/devLib/Makefile | ||
| 24 | index d62b532..c7c7884 100644 | ||
| 25 | --- a/devLib/Makefile | ||
| 26 | +++ b/devLib/Makefile | ||
| 27 | @@ -22,18 +22,22 @@ | ||
| 28 | ################################################################################# | ||
| 29 | |||
| 30 | VERSION=$(shell cat ../VERSION) | ||
| 31 | -DESTDIR=/usr | ||
| 32 | -PREFIX=/local | ||
| 33 | +DESTDIR?=/usr | ||
| 34 | +PREFIX?=/local | ||
| 35 | |||
| 36 | -STATIC=libwiringPiDev.a | ||
| 37 | -DYNAMIC=libwiringPiDev.so.$(VERSION) | ||
| 38 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 39 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 40 | |||
| 41 | -#DEBUG = -g -O0 | ||
| 42 | -DEBUG = -O2 | ||
| 43 | -CC = gcc | ||
| 44 | -INCLUDE = -I. | ||
| 45 | -DEFS = -D_GNU_SOURCE | ||
| 46 | -CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 47 | +BASE_NAME=libwiringPiDev | ||
| 48 | +STATIC=$(BASE_NAME).a | ||
| 49 | +DYNAMIC=$(BASE_NAME).so.$(VERSION) | ||
| 50 | + | ||
| 51 | +#DEBUG ?= -g -O0 | ||
| 52 | +DEBUG ?= -O2 | ||
| 53 | +CC ?= gcc | ||
| 54 | +INCLUDE ?= -I. | ||
| 55 | +DEFS ?= -D_GNU_SOURCE | ||
| 56 | +CFLAGS ?= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 57 | |||
| 58 | LIBS = | ||
| 59 | |||
| 60 | @@ -60,16 +64,16 @@ $(STATIC): $(OBJ) | ||
| 61 | |||
| 62 | $(DYNAMIC): $(OBJ) | ||
| 63 | @echo "[Link (Dynamic)]" | ||
| 64 | - @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ) | ||
| 65 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) | ||
| 66 | |||
| 67 | .c.o: | ||
| 68 | @echo [Compile] $< | ||
| 69 | - @$(CC) -c $(CFLAGS) $< -o $@ | ||
| 70 | + @$(CC) -c $(CFLAGS) -fPIC $< -o $@ | ||
| 71 | |||
| 72 | .PHONY: clean | ||
| 73 | clean: | ||
| 74 | @echo "[Clean]" | ||
| 75 | - @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.* | ||
| 76 | + @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a | ||
| 77 | |||
| 78 | .PHONY: tags | ||
| 79 | tags: $(SRC) | ||
| 80 | @@ -80,22 +84,22 @@ tags: $(SRC) | ||
| 81 | .PHONY: install | ||
| 82 | install: $(DYNAMIC) | ||
| 83 | @echo "[Install Headers]" | ||
| 84 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 85 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 86 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 87 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 88 | @echo "[Install Dynamic Lib]" | ||
| 89 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 90 | - @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) | ||
| 91 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so | ||
| 92 | - @ldconfig | ||
| 93 | + @install -m 0755 -d $(LIB_DIR) | ||
| 94 | + @install -m 0755 $(BASE_NAME).so $(LIB_DIR)/$(DYNAMIC) | ||
| 95 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so | ||
| 96 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 97 | |||
| 98 | .PHONY: install-static | ||
| 99 | install-static: $(STATIC) | ||
| 100 | @echo "[Install Headers]" | ||
| 101 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 102 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 103 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 104 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 105 | @echo "[Install Static Lib]" | ||
| 106 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 107 | - @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib | ||
| 108 | + @install -m 0755 -d $(LIB_DIR) | ||
| 109 | + @install -m 0644 $(STATIC) $(LIB_DIR) | ||
| 110 | |||
| 111 | .PHONY: install-deb | ||
| 112 | install-deb: $(DYNAMIC) | ||
| 113 | @@ -110,9 +114,11 @@ install-deb: $(DYNAMIC) | ||
| 114 | .PHONY: uninstall | ||
| 115 | uninstall: | ||
| 116 | @echo "[UnInstall]" | ||
| 117 | - @cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS) | ||
| 118 | - @cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.* | ||
| 119 | - @ldconfig | ||
| 120 | + @cd $(INCLUDE_DIR) && rm -f $(HEADERS) | ||
| 121 | + @rm -f $(LIB_DIR)/$(STATIC) | ||
| 122 | + @rm -f $(LIB_DIR)/$(DYNAMIC) | ||
| 123 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so | ||
| 124 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 125 | |||
| 126 | |||
| 127 | .PHONY: depend | ||
| 128 | diff --git a/examples/Gertboard/Makefile b/examples/Gertboard/Makefile | ||
| 129 | index 7569261..b0c32e0 100644 | ||
| 130 | --- a/examples/Gertboard/Makefile | ||
| 131 | +++ b/examples/Gertboard/Makefile | ||
| 132 | @@ -5,14 +5,20 @@ | ||
| 133 | # Copyright (c) 2013 Gordon Henderson | ||
| 134 | ################################################################################# | ||
| 135 | |||
| 136 | -#DEBUG = -g -O0 | ||
| 137 | -DEBUG = -O3 | ||
| 138 | -CC = gcc | ||
| 139 | -INCLUDE = -I/usr/local/include | ||
| 140 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 141 | - | ||
| 142 | -LDFLAGS = -L/usr/local/lib | ||
| 143 | -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 144 | +DESTDIR?=/usr | ||
| 145 | +PREFIX?=/local | ||
| 146 | + | ||
| 147 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 148 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 149 | + | ||
| 150 | +#DEBUG ?= -g -O0 | ||
| 151 | +DEBUG ?= -O3 | ||
| 152 | +CC ?= gcc | ||
| 153 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 154 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 155 | + | ||
| 156 | +LDFLAGS ?= -L$(LIB_DIR) | ||
| 157 | +LDLIBS ?= -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 158 | |||
| 159 | # Should not alter anything below this line | ||
| 160 | ############################################################################### | ||
| 161 | diff --git a/examples/Makefile b/examples/Makefile | ||
| 162 | index c9967dc..c2f8b9d 100644 | ||
| 163 | --- a/examples/Makefile | ||
| 164 | +++ b/examples/Makefile | ||
| 165 | @@ -22,15 +22,20 @@ | ||
| 166 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. | ||
| 167 | ################################################################################# | ||
| 168 | |||
| 169 | +DESTDIR?=/usr | ||
| 170 | +PREFIX?=/local | ||
| 171 | |||
| 172 | -#DEBUG = -g -O0 | ||
| 173 | -DEBUG = -O3 | ||
| 174 | -CC = gcc | ||
| 175 | -INCLUDE = -I/usr/local/include | ||
| 176 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 177 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 178 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 179 | |||
| 180 | -LDFLAGS = -L/usr/local/lib | ||
| 181 | -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 182 | +#DEBUG ?= -g -O0 | ||
| 183 | +DEBUG ?= -O3 | ||
| 184 | +CC ?= gcc | ||
| 185 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 186 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 187 | + | ||
| 188 | +LDFLAGS ?= -L$(LIB_DIR) | ||
| 189 | +LDLIBS ?= -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 190 | |||
| 191 | # Should not alter anything below this line | ||
| 192 | ############################################################################### | ||
| 193 | diff --git a/examples/PiFace/Makefile b/examples/PiFace/Makefile | ||
| 194 | index 0bde334..fc14c0c 100644 | ||
| 195 | --- a/examples/PiFace/Makefile | ||
| 196 | +++ b/examples/PiFace/Makefile | ||
| 197 | @@ -23,14 +23,20 @@ | ||
| 198 | ################################################################################# | ||
| 199 | |||
| 200 | |||
| 201 | -#DEBUG = -g -O0 | ||
| 202 | -DEBUG = -O3 | ||
| 203 | -CC = gcc | ||
| 204 | -INCLUDE = -I/usr/local/include | ||
| 205 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 206 | - | ||
| 207 | -LDFLAGS = -L/usr/local/lib | ||
| 208 | -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 209 | +DESTDIR?=/usr | ||
| 210 | +PREFIX?=/local | ||
| 211 | + | ||
| 212 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 213 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 214 | + | ||
| 215 | +#DEBUG ?= -g -O0 | ||
| 216 | +DEBUG ?= -O3 | ||
| 217 | +CC ?= gcc | ||
| 218 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 219 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 220 | + | ||
| 221 | +LDFLAGS ?= -L$(LIB_DIR) | ||
| 222 | +LDLIBS ?= -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 223 | |||
| 224 | # Should not alter anything below this line | ||
| 225 | ############################################################################### | ||
| 226 | diff --git a/examples/PiGlow/Makefile b/examples/PiGlow/Makefile | ||
| 227 | index 8d31141..482c9e7 100644 | ||
| 228 | --- a/examples/PiGlow/Makefile | ||
| 229 | +++ b/examples/PiGlow/Makefile | ||
| 230 | @@ -26,10 +26,10 @@ | ||
| 231 | #DEBUG = -g -O0 | ||
| 232 | DEBUG = -O3 | ||
| 233 | CC = gcc | ||
| 234 | -INCLUDE = -I/usr/local/include | ||
| 235 | +INCLUDE = -I../wiringPi -I../wiringPiDev | ||
| 236 | CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 237 | |||
| 238 | -LDFLAGS = -L/usr/local/lib | ||
| 239 | +LDFLAGS = -L../wiringPi -L../wiringPiDev | ||
| 240 | LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 241 | |||
| 242 | # Should not alter anything below this line | ||
| 243 | diff --git a/examples/q2w/Makefile b/examples/q2w/Makefile | ||
| 244 | index 150c825..0544aa3 100644 | ||
| 245 | --- a/examples/q2w/Makefile | ||
| 246 | +++ b/examples/q2w/Makefile | ||
| 247 | @@ -22,14 +22,13 @@ | ||
| 248 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. | ||
| 249 | ################################################################################# | ||
| 250 | |||
| 251 | - | ||
| 252 | #DEBUG = -g -O0 | ||
| 253 | DEBUG = -O3 | ||
| 254 | CC = gcc | ||
| 255 | -INCLUDE = -I/usr/local/include | ||
| 256 | +INCLUDE = -I../wiringPi -I../devLib | ||
| 257 | CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 258 | |||
| 259 | -LDFLAGS = -L/usr/local/lib | ||
| 260 | +LDFLAGS = -L../wiringPi -L../devLib | ||
| 261 | LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 262 | |||
| 263 | ############################################################################### | ||
| 264 | diff --git a/gpio/Makefile b/gpio/Makefile | ||
| 265 | index 449986e..95af1ad 100644 | ||
| 266 | --- a/gpio/Makefile | ||
| 267 | +++ b/gpio/Makefile | ||
| 268 | @@ -23,16 +23,20 @@ | ||
| 269 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. | ||
| 270 | ################################################################################# | ||
| 271 | |||
| 272 | -DESTDIR=/usr | ||
| 273 | -PREFIX=/local | ||
| 274 | +DESTDIR?=/usr | ||
| 275 | +PREFIX?=/local | ||
| 276 | |||
| 277 | -#DEBUG = -g -O0 | ||
| 278 | -DEBUG = -O2 | ||
| 279 | -CC = gcc | ||
| 280 | -INCLUDE = -I$(DESTDIR)$(PREFIX)/include | ||
| 281 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 282 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 283 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 284 | +BIN_DIR?=$(DESTDIR)$(PREFIX)/bin | ||
| 285 | |||
| 286 | -LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib | ||
| 287 | +#DEBUG ?= -g -O0 | ||
| 288 | +DEBUG ?= -O2 | ||
| 289 | +CC ?= gcc | ||
| 290 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 291 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 292 | + | ||
| 293 | +LDFLAGS = -L$(LIB_DIR) | ||
| 294 | LIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 295 | |||
| 296 | # May not need to alter anything below this line | ||
| 297 | @@ -68,11 +72,10 @@ tags: $(SRC) | ||
| 298 | .PHONY: install | ||
| 299 | install: gpio | ||
| 300 | @echo "[Install]" | ||
| 301 | - @cp gpio $(DESTDIR)$(PREFIX)/bin | ||
| 302 | - @chown root.root $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 303 | - @chmod 4755 $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 304 | - @mkdir -p $(DESTDIR)$(PREFIX)/man/man1 | ||
| 305 | - @cp gpio.1 $(DESTDIR)$(PREFIX)/man/man1 | ||
| 306 | + @install -d $(BIN_DIR) | ||
| 307 | + @install -m 4755 -o root -g root gpio $(BIN_DIR) | ||
| 308 | + @install -d $(DESTDIR)$(PREFIX)/share/man/man1 | ||
| 309 | + @install -m 644 -o root -g root gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1 | ||
| 310 | |||
| 311 | .PHONY: install-deb | ||
| 312 | install-deb: gpio | ||
| 313 | @@ -83,7 +86,7 @@ install-deb: gpio | ||
| 314 | .PHONY: uninstall | ||
| 315 | uninstall: | ||
| 316 | @echo "[UnInstall]" | ||
| 317 | - @rm -f $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 318 | + @rm -f $(BIN_DIR)/gpio | ||
| 319 | @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1 | ||
| 320 | |||
| 321 | .PHONY: depend | ||
| 322 | diff --git a/wiringPi/Makefile b/wiringPi/Makefile | ||
| 323 | index 015a894..5fc0659 100644 | ||
| 324 | --- a/wiringPi/Makefile | ||
| 325 | +++ b/wiringPi/Makefile | ||
| 326 | @@ -22,18 +22,22 @@ | ||
| 327 | ################################################################################# | ||
| 328 | |||
| 329 | VERSION=$(shell cat ../VERSION) | ||
| 330 | -DESTDIR=/usr | ||
| 331 | -PREFIX=/local | ||
| 332 | +DESTDIR?=/usr | ||
| 333 | +PREFIX?=/local | ||
| 334 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 335 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 336 | |||
| 337 | -STATIC=libwiringPi.a | ||
| 338 | -DYNAMIC=libwiringPi.so.$(VERSION) | ||
| 339 | +BASE_NAME=libwiringPi | ||
| 340 | +STATIC=$(BASE_NAME).a | ||
| 341 | +DYNAMIC=$(BASE_NAME).so.$(VERSION) | ||
| 342 | |||
| 343 | -#DEBUG = -g -O0 | ||
| 344 | -DEBUG = -O2 | ||
| 345 | -CC = gcc | ||
| 346 | -INCLUDE = -I. | ||
| 347 | -DEFS = -D_GNU_SOURCE | ||
| 348 | +#DEBUG ?= -g -O0 | ||
| 349 | CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 350 | +DEBUG ?= -O2 | ||
| 351 | +CC ?= gcc | ||
| 352 | +DEFS = -D_GNU_SOURCE | ||
| 353 | +INCLUDE ?= -I. | ||
| 354 | +CFLAGS ?= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 355 | |||
| 356 | LIBS = | ||
| 357 | |||
| 358 | @@ -83,17 +87,17 @@ $(STATIC): $(OBJ) | ||
| 359 | |||
| 360 | $(DYNAMIC): $(OBJ) | ||
| 361 | @echo "[Link (Dynamic)]" | ||
| 362 | - @$(CC) -shared -Wl,-soname,libwiringPi.so -o libwiringPi.so.$(VERSION) -lpthread $(OBJ) | ||
| 363 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) | ||
| 364 | |||
| 365 | .c.o: | ||
| 366 | @echo [Compile] $< | ||
| 367 | - @$(CC) -c $(CFLAGS) $< -o $@ | ||
| 368 | + @$(CC) -c $(CFLAGS) -fPIC $< -o $@ | ||
| 369 | |||
| 370 | |||
| 371 | .PHONY: clean | ||
| 372 | clean: | ||
| 373 | @echo "[Clean]" | ||
| 374 | - @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPi.* | ||
| 375 | + @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a | ||
| 376 | |||
| 377 | .PHONY: tags | ||
| 378 | tags: $(SRC) | ||
| 379 | @@ -104,22 +108,22 @@ tags: $(SRC) | ||
| 380 | .PHONY: install | ||
| 381 | install: $(DYNAMIC) | ||
| 382 | @echo "[Install Headers]" | ||
| 383 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 384 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 385 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 386 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 387 | @echo "[Install Dynamic Lib]" | ||
| 388 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 389 | - @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) | ||
| 390 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so | ||
| 391 | - @ldconfig | ||
| 392 | + @install -m 0755 -d $(LIB_DIR) | ||
| 393 | + @install -m 0755 $(BASE_NAME).so $(LIB_DIR)/$(DYNAMIC) | ||
| 394 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so | ||
| 395 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 396 | |||
| 397 | .PHONY: install-static | ||
| 398 | install-static: $(STATIC) | ||
| 399 | @echo "[Install Headers]" | ||
| 400 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 401 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 402 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 403 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 404 | @echo "[Install Static Lib]" | ||
| 405 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 406 | - @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib | ||
| 407 | + @install -m 0755 -d $(LIB_DIR) | ||
| 408 | + @install -m 0644 $(STATIC) $(LIB_DIR) | ||
| 409 | |||
| 410 | .PHONY: install-deb | ||
| 411 | install-deb: $(DYNAMIC) | ||
| 412 | @@ -134,9 +138,11 @@ install-deb: $(DYNAMIC) | ||
| 413 | .PHONY: uninstall | ||
| 414 | uninstall: | ||
| 415 | @echo "[UnInstall]" | ||
| 416 | - @cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS) | ||
| 417 | - @cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPi.* | ||
| 418 | - @ldconfig | ||
| 419 | + @cd $(INCLUDE_DIR) && rm -f $(HEADERS) | ||
| 420 | + @rm -f $(LIB_DIR)/$(STATIC) | ||
| 421 | + @rm -f $(LIB_DIR)/$(DYNAMIC) | ||
| 422 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so | ||
| 423 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 424 | |||
| 425 | |||
| 426 | .PHONY: depend | ||
| 427 | -- | ||
| 428 | 1.9.1 | ||
| 429 | |||
diff --git a/recipes-devtools/wiringPi/files/Makefiles-install.patch b/recipes-devtools/wiringPi/files/Makefiles-install.patch deleted file mode 100644 index cd13064..0000000 --- a/recipes-devtools/wiringPi/files/Makefiles-install.patch +++ /dev/null | |||
| @@ -1,202 +0,0 @@ | |||
| 1 | diff --git a/examples/Makefile b/examples/Makefile | ||
| 2 | index defd510..b84f3de 100644 | ||
| 3 | --- a/examples/Makefile | ||
| 4 | +++ b/examples/Makefile | ||
| 5 | @@ -26,10 +26,10 @@ | ||
| 6 | #DEBUG = -g -O0 | ||
| 7 | DEBUG = -O3 | ||
| 8 | CC = gcc | ||
| 9 | -INCLUDE = -I/usr/local/include | ||
| 10 | +INCLUDE = -I../wiringPi | ||
| 11 | CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 12 | |||
| 13 | -LDFLAGS = -L/usr/local/lib | ||
| 14 | +LDFLAGS = -L../wiringPi | ||
| 15 | LDLIBS = -lwiringPi -lpthread -lm | ||
| 16 | |||
| 17 | # Should not alter anything below this line | ||
| 18 | diff --git a/gpio/Makefile b/gpio/Makefile | ||
| 19 | index a043962..b1539d9 100644 | ||
| 20 | --- a/gpio/Makefile | ||
| 21 | +++ b/gpio/Makefile | ||
| 22 | @@ -23,13 +23,16 @@ | ||
| 23 | ################################################################################# | ||
| 24 | |||
| 25 | |||
| 26 | +DESTDIR?=/usr | ||
| 27 | +PREFIX?=/local | ||
| 28 | + | ||
| 29 | #DEBUG = -g -O0 | ||
| 30 | -DEBUG = -O2 | ||
| 31 | -CC = gcc | ||
| 32 | -INCLUDE = -I/usr/local/include | ||
| 33 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 34 | +DEBUG ?= -O2 | ||
| 35 | +CC ?= gcc | ||
| 36 | +INCLUDE ?= -I../wiringPi | ||
| 37 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 38 | |||
| 39 | -LDFLAGS = -L/usr/local/lib | ||
| 40 | +LDFLAGS ?= -L../wiringPi | ||
| 41 | LIBS = -lwiringPi -lpthread -lm | ||
| 42 | |||
| 43 | # May not need to alter anything below this line | ||
| 44 | @@ -61,17 +64,16 @@ tags: $(SRC) | ||
| 45 | .PHONEY: install | ||
| 46 | install: | ||
| 47 | @echo "[Install]" | ||
| 48 | - @cp gpio /usr/local/bin | ||
| 49 | - @chown root.root /usr/local/bin/gpio | ||
| 50 | - @chmod 4755 /usr/local/bin/gpio | ||
| 51 | - @mkdir -p /usr/local/man/man1 | ||
| 52 | - @cp gpio.1 /usr/local/man/man1 | ||
| 53 | + @install -d $(DESTDIR)$(PREFIX)/bin | ||
| 54 | + @install -m 4755 -o root -g root gpio $(DESTDIR)$(PREFIX)/bin | ||
| 55 | + @install -d $(DESTDIR)$(PREFIX)/share/man/man1 | ||
| 56 | + @install -m 644 -o root -g root gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1 | ||
| 57 | |||
| 58 | .PHONEY: uninstall | ||
| 59 | uninstall: | ||
| 60 | @echo "[UnInstall]" | ||
| 61 | - @rm -f /usr/local/bin/gpio | ||
| 62 | - @rm -f /usr/local/man/man1/gpio.1 | ||
| 63 | + @rm -f $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 64 | + @rm -f $(DESTDIR)$(PREFIX)/share/man/man1/gpio.1 | ||
| 65 | |||
| 66 | .PHONEY: depend | ||
| 67 | depend: | ||
| 68 | diff --git a/wiringPi/Makefile b/wiringPi/Makefile | ||
| 69 | index c6a4555..2c7ae82 100644 | ||
| 70 | --- a/wiringPi/Makefile | ||
| 71 | +++ b/wiringPi/Makefile | ||
| 72 | @@ -25,17 +25,20 @@ DYN_VERS_MAJ=1 | ||
| 73 | DYN_VERS_MIN=0 | ||
| 74 | |||
| 75 | VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN) | ||
| 76 | -DESTDIR=/usr | ||
| 77 | -PREFIX=/local | ||
| 78 | +DESTDIR?=/usr | ||
| 79 | +PREFIX?=/local | ||
| 80 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 81 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 82 | |||
| 83 | -STATIC=libwiringPi.a | ||
| 84 | -DYNAMIC=libwiringPi.so.$(VERSION) | ||
| 85 | +BASE_NAME=libwiringPi | ||
| 86 | +STATIC=$(BASE_NAME).a | ||
| 87 | +DYNAMIC=$(BASE_NAME).so.$(VERSION) | ||
| 88 | |||
| 89 | #DEBUG = -g -O0 | ||
| 90 | -DEBUG = -O2 | ||
| 91 | -CC = gcc | ||
| 92 | -INCLUDE = -I. | ||
| 93 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -fPIC | ||
| 94 | +DEBUG ?= -O2 | ||
| 95 | +CC ?= gcc | ||
| 96 | +INCLUDE ?= -I. | ||
| 97 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -fPIC | ||
| 98 | |||
| 99 | LIBS = | ||
| 100 | |||
| 101 | @@ -67,19 +70,19 @@ $(STATIC): $(OBJ) | ||
| 102 | |||
| 103 | $(DYNAMIC): $(OBJ) | ||
| 104 | @echo "[Link (Dynamic)]" | ||
| 105 | - @$(CC) -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ) | ||
| 106 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) | ||
| 107 | |||
| 108 | i2c: $(OBJ) $(OBJ_I2C) | ||
| 109 | @echo "[Link (Dynamic + I2C)]" | ||
| 110 | - @$(CC) -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ) $(OBJ_I2C) | ||
| 111 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) $(OBJ_I2C) | ||
| 112 | |||
| 113 | .c.o: | ||
| 114 | @echo [Compile] $< | ||
| 115 | - @$(CC) -c $(CFLAGS) $< -o $@ | ||
| 116 | + @$(CC) -c $(CFLAGS) -fPIC $< -o $@ | ||
| 117 | |||
| 118 | .PHONEY: clean | ||
| 119 | clean: | ||
| 120 | - rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPi.* | ||
| 121 | + rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a | ||
| 122 | |||
| 123 | .PHONEY: tags | ||
| 124 | tags: $(SRC) | ||
| 125 | @@ -89,45 +92,46 @@ tags: $(SRC) | ||
| 126 | .PHONEY: install | ||
| 127 | install: $(DYNAMIC) | ||
| 128 | @echo "[Install]" | ||
| 129 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 130 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 131 | - @install -m 0644 wiringPi.h $(DESTDIR)$(PREFIX)/include | ||
| 132 | - @install -m 0644 wiringSerial.h $(DESTDIR)$(PREFIX)/include | ||
| 133 | - @install -m 0644 wiringShift.h $(DESTDIR)$(PREFIX)/include | ||
| 134 | - @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include | ||
| 135 | - @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include | ||
| 136 | - @install -m 0644 softPwm.h $(DESTDIR)$(PREFIX)/include | ||
| 137 | - @install -m 0644 softServo.h $(DESTDIR)$(PREFIX)/include | ||
| 138 | - @install -m 0644 softTone.h $(DESTDIR)$(PREFIX)/include | ||
| 139 | - @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include | ||
| 140 | - @install -m 0644 wiringPiSPI.h $(DESTDIR)$(PREFIX)/include | ||
| 141 | - @install -m 0644 wiringPiI2C.h $(DESTDIR)$(PREFIX)/include | ||
| 142 | - @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib | ||
| 143 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so | ||
| 144 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so.1 | ||
| 145 | - @ldconfig | ||
| 146 | + @install -m 0755 -d $(LIB_DIR) | ||
| 147 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 148 | + @install -m 0644 wiringPi.h $(INCLUDE_DIR) | ||
| 149 | + @install -m 0644 wiringSerial.h $(INCLUDE_DIR) | ||
| 150 | + @install -m 0644 wiringShift.h $(INCLUDE_DIR) | ||
| 151 | + @install -m 0644 gertboard.h $(INCLUDE_DIR) | ||
| 152 | + @install -m 0644 piNes.h $(INCLUDE_DIR) | ||
| 153 | + @install -m 0644 softPwm.h $(INCLUDE_DIR) | ||
| 154 | + @install -m 0644 softServo.h $(INCLUDE_DIR) | ||
| 155 | + @install -m 0644 softTone.h $(INCLUDE_DIR) | ||
| 156 | + @install -m 0644 lcd.h $(INCLUDE_DIR) | ||
| 157 | + @install -m 0644 wiringPiSPI.h $(INCLUDE_DIR) | ||
| 158 | + @install -m 0644 wiringPiI2C.h $(INCLUDE_DIR) | ||
| 159 | + @install -m 0755 $(BASE_NAME).so $(LIB_DIR)/$(DYNAMIC) | ||
| 160 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so | ||
| 161 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 162 | |||
| 163 | .PHONEY: install-static | ||
| 164 | install-static: $(STATIC) | ||
| 165 | @echo "[Install Static]" | ||
| 166 | - @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib | ||
| 167 | + @install -m 0644 $(STATIC) $(LIB_DIR) | ||
| 168 | |||
| 169 | .PHONEY: uninstall | ||
| 170 | uninstall: | ||
| 171 | @echo "[UnInstall]" | ||
| 172 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringPi.h | ||
| 173 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringSerial.h | ||
| 174 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringShift.h | ||
| 175 | - @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h | ||
| 176 | - @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h | ||
| 177 | - @rm -f $(DESTDIR)$(PREFIX)/include/softPwm.h | ||
| 178 | - @rm -f $(DESTDIR)$(PREFIX)/include/softServo.h | ||
| 179 | - @rm -f $(DESTDIR)$(PREFIX)/include/softTone.h | ||
| 180 | - @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h | ||
| 181 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiSPI.h | ||
| 182 | - @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiI2C.h | ||
| 183 | - @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPi.* | ||
| 184 | - @ldconfig | ||
| 185 | + @rm -f $(INCLUDE_DIR)/wiringPi.h | ||
| 186 | + @rm -f $(INCLUDE_DIR)/wiringSerial.h | ||
| 187 | + @rm -f $(INCLUDE_DIR)/wiringShift.h | ||
| 188 | + @rm -f $(INCLUDE_DIR)/gertboard.h | ||
| 189 | + @rm -f $(INCLUDE_DIR)/piNes.h | ||
| 190 | + @rm -f $(INCLUDE_DIR)/softPwm.h | ||
| 191 | + @rm -f $(INCLUDE_DIR)/softServo.h | ||
| 192 | + @rm -f $(INCLUDE_DIR)/softTone.h | ||
| 193 | + @rm -f $(INCLUDE_DIR)/lcd.h | ||
| 194 | + @rm -f $(INCLUDE_DIR)/wiringPiSPI.h | ||
| 195 | + @rm -f $(INCLUDE_DIR)/wiringPiI2C.h | ||
| 196 | + @rm -f $(LIB_DIR)/$(STATIC) | ||
| 197 | + @rm -f $(LIB_DIR)/$(DYNAMIC) | ||
| 198 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so | ||
| 199 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 200 | |||
| 201 | |||
| 202 | .PHONEY: depend | ||
diff --git a/recipes-devtools/wiringPi/wiringpi_git.bb b/recipes-devtools/wiringPi/wiringpi_git.bb index b2e3e91..21b5294 100644 --- a/recipes-devtools/wiringPi/wiringpi_git.bb +++ b/recipes-devtools/wiringPi/wiringpi_git.bb | |||
| @@ -4,28 +4,30 @@ SECTION = "devel/libs" | |||
| 4 | LICENSE = "LGPLv3+" | 4 | LICENSE = "LGPLv3+" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02" | 5 | LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02" |
| 6 | 6 | ||
| 7 | SRCREV = "98bcb20d9391ebde24f9eb1244f0d238fb1a1dab" | 7 | SRCREV = "5edd177112c99416f68ba3e8c6c4db6ed942e796" |
| 8 | 8 | ||
| 9 | S = "${WORKDIR}/git" | 9 | S = "${WORKDIR}/git" |
| 10 | 10 | ||
| 11 | SRC_URI = "\ | 11 | SRC_URI = "\ |
| 12 | git://git.drogon.net/wiringPi \ | 12 | git://git.drogon.net/wiringPi \ |
| 13 | file://Makefiles-install.patch \ | 13 | file://0001-Add-initial-cross-compile-support.patch \ |
| 14 | " | 14 | " |
| 15 | 15 | ||
| 16 | COMPATIBLE_MACHINE = "raspberrypi" | 16 | COMPATIBLE_MACHINE = "raspberrypi" |
| 17 | 17 | ||
| 18 | CFLAGS_prepend = "-I${S}/wiringPi" | 18 | CFLAGS_prepend = "-I${S}/wiringPi -I${S}/devLib" |
| 19 | 19 | ||
| 20 | EXTRA_OEMAKE += "'INCLUDE_DIR=${D}${includedir}' 'LIB_DIR=${D}${libdir}'" | 20 | EXTRA_OEMAKE += "'INCLUDE_DIR=${D}${includedir}' 'LIB_DIR=${D}${libdir}'" |
| 21 | EXTRA_OEMAKE += "'DESTDIR=${D}/usr' 'PREFIX=""'" | 21 | EXTRA_OEMAKE += "'DESTDIR=${D}/usr' 'PREFIX=""'" |
| 22 | 22 | ||
| 23 | do_compile() { | 23 | do_compile() { |
| 24 | oe_runmake -C devLib | ||
| 24 | oe_runmake -C wiringPi | 25 | oe_runmake -C wiringPi |
| 25 | oe_runmake -C gpio 'LDFLAGS=${LDFLAGS} -L${S}/wiringPi' | 26 | oe_runmake -C gpio 'LDFLAGS=${LDFLAGS} -L${S}/wiringPi -L${S}/devLib' |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | do_install() { | 29 | do_install() { |
| 30 | oe_runmake -C devLib install | ||
| 29 | oe_runmake -C wiringPi install | 31 | oe_runmake -C wiringPi install |
| 30 | oe_runmake -C gpio install | 32 | oe_runmake -C gpio install |
| 31 | } | 33 | } |
