git » libjio » commit 4443d07

Allow the user to override the name of the "install" tool to use

author Alberto Bertogli
2009-07-24 23:36:53 UTC
committer Alberto Bertogli
2009-07-24 23:36:53 UTC
parent edfb2c046991b76d16d482a0a23361b17f9820b6

Allow the user to override the name of the "install" tool to use

On some machines (like Solaris ones) the default "install" tool is
incompatible with the GNU/BSD one. This patch allows the user to override
the name of the install tool, so Solaris users can select a GNU/BSD
install.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

INSTALL +2 -1
bindings/preload/Makefile +3 -2
libjio/Makefile +14 -11

diff --git a/INSTALL b/INSTALL
index ff96287..13e479c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -14,7 +14,8 @@ After installing, you need to run "ldconfig" in order to update your dynamic
 library cache.
 
 If the default "make" is not GNU make (like in BSD systems), use "gmake"
-instead.
+instead. If the default "install" is not GNU/BSD compatible (like in Solaris
+systems), use "gmake INSTALL=ginstall".
 
 
 Special builds
diff --git a/bindings/preload/Makefile b/bindings/preload/Makefile
index bfe34b7..318648f 100644
--- a/bindings/preload/Makefile
+++ b/bindings/preload/Makefile
@@ -9,6 +9,7 @@ ALL_CFLAGS = $(CFLAGS) $(MANDATORY_CFLAGS) -fPIC
 
 
 PREFIX = /usr/local
+INSTALL = install
 
 ifneq ($(V), 1)
         NICE_CC = @echo "  CC  $@"; $(CC)
@@ -29,8 +30,8 @@ preload: libjio_preload.o
 	$(NICE_CC) $(ALL_CFLAGS) -c $< -o $@
 
 install: preload
-	install -d $(PREFIX)/lib
-	install -m 0755 libjio_preload.so $(PREFIX)/lib
+	$(INSTALL) -d $(PREFIX)/lib
+	$(INSTALL) -m 0755 libjio_preload.so $(PREFIX)/lib
 
 clean:
 	rm -f libjio_preload.o libjio_preload.so
diff --git a/libjio/Makefile b/libjio/Makefile
index 27125bc..9a82a94 100644
--- a/libjio/Makefile
+++ b/libjio/Makefile
@@ -34,6 +34,9 @@ endif
 PREFIX = /usr/local
 
 
+# install utility, we assume it's GNU/BSD compatible
+INSTALL=install
+
 ifneq ($(V), 1)
         NICE_CC = @echo "  CC  $@"; $(CC)
         NICE_AR = @echo "  AR  $@"; $(AR)
@@ -69,17 +72,17 @@ jiofsck: jiofsck.o libjio.a
 	$(NICE_CC) $(ALL_LDFLAGS) jiofsck.o libjio.a $(LIBS) -o jiofsck
 
 install: all
-	install -d $(PREFIX)/lib
-	install -m 0755 libjio.so $(PREFIX)/lib
-	install -m 0644 libjio.a $(PREFIX)/lib
-	install -d $(PREFIX)/include
-	install -m 0644 libjio.h $(PREFIX)/include
-	install -d $(PREFIX)/lib/pkgconfig
-	install -m 644 libjio.pc $(PREFIX)/lib/pkgconfig
-	install -d $(PREFIX)/bin
-	install -m 0775 jiofsck $(PREFIX)/bin
-	install -d $(PREFIX)/man/man3
-	install -m 0644 libjio.3 $(PREFIX)/man/man3/
+	$(INSTALL) -d $(PREFIX)/lib
+	$(INSTALL) -m 0755 libjio.so $(PREFIX)/lib
+	$(INSTALL) -m 0644 libjio.a $(PREFIX)/lib
+	$(INSTALL) -d $(PREFIX)/include
+	$(INSTALL) -m 0644 libjio.h $(PREFIX)/include
+	$(INSTALL) -d $(PREFIX)/lib/pkgconfig
+	$(INSTALL) -m 644 libjio.pc $(PREFIX)/lib/pkgconfig
+	$(INSTALL) -d $(PREFIX)/bin
+	$(INSTALL) -m 0775 jiofsck $(PREFIX)/bin
+	$(INSTALL) -d $(PREFIX)/man/man3
+	$(INSTALL) -m 0644 libjio.3 $(PREFIX)/man/man3/
 	@echo
 	@echo "Please run ldconfig to update your library cache"
 	@echo