Gordons Projects

--> Projects Top-Level GIT

Makefiles: Honour LDCONFIG from the environment
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Sep 2015 17:16:46 +0000 (17:16 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 12 Sep 2015 19:38:20 +0000 (20:38 +0100)
This is not set in normal shell sessions.

Honouring an existing setting of LDCONFIG allows the caller of ./build
to specify an alternative program to run.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
devLib/Makefile
wiringPi/Makefile

index 9ec163d..38ab9d9 100644 (file)
@@ -25,6 +25,8 @@ VERSION=$(shell cat ../VERSION)
 DESTDIR?=/usr
 PREFIX?=/local
 
+LDCONFIG?=ldconfig
+
 ifneq ($V,1)
 Q ?= @
 endif
@@ -90,7 +92,7 @@ install:      $(DYNAMIC)
        $Q install -m 0755 -d                                           $(DESTDIR)$(PREFIX)/lib
        $Q install -m 0755 libwiringPiDev.so.$(VERSION)                 $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
        $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)  $(DESTDIR)/lib/libwiringPiDev.so
-       $Q ldconfig
+       $Q $(LDCONFIG)
 
 .PHONY:        install-static
 install-static:        $(STATIC)
@@ -116,7 +118,7 @@ uninstall:
        $Q echo "[UnInstall]"
        $Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
        $Q cd $(DESTDIR)$(PREFIX)/lib/     && rm -f libwiringPiDev.*
-       $Q ldconfig
+       $Q $(LDCONFIG)
 
 
 .PHONY:        depend
index c0623ce..5518c9e 100644 (file)
@@ -25,6 +25,8 @@ VERSION=$(shell cat ../VERSION)
 DESTDIR?=/usr
 PREFIX?=/local
 
+LDCONFIG?=ldconfig
+
 ifneq ($V,1)
 Q ?= @
 endif
@@ -114,7 +116,7 @@ install:    $(DYNAMIC)
        $Q install -m 0755 -d                                           $(DESTDIR)$(PREFIX)/lib
        $Q install -m 0755 libwiringPi.so.$(VERSION)                    $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)
        $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)     $(DESTDIR)/lib/libwiringPi.so
-       $Q ldconfig
+       $Q $(LDCONFIG)
 
 .PHONY:        install-static
 install-static:        $(STATIC)
@@ -140,7 +142,7 @@ uninstall:
        $Q echo "[UnInstall]"
        $Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
        $Q cd $(DESTDIR)$(PREFIX)/lib/     && rm -f libwiringPi.*
-       $Q ldconfig
+       $Q $(LDCONFIG)
 
 
 .PHONY:        depend