Browse code

Add separate INSTALL_SCRIPT macro and use it to install scripts, This allows packagers to override INSTALL_SCRIPT/INSTALL_BIN to perform additional functionality when installing (e.g strip binary).

Maxim Sobolev authored on 20/05/2008 22:55:55
Showing 2 changed files
... ...
@@ -219,8 +219,8 @@ modules_full_path=$(join  $(modules), $(addprefix /, $(modules_names)))
219 219
 # which utils need compilation (directory path) and which to install
220 220
 # (full path including file name)
221 221
 utils_compile=	utils/gen_ha1 utils/sercmd
222
-utils_install=	utils/gen_ha1/gen_ha1 \
223
-				scripts/mysql/ser_mysql.sh utils/sercmd/sercmd
222
+utils_bin_install=	$(utils_compile)
223
+utils_script_install=	scripts/mysql/ser_mysql.sh
224 224
 
225 225
 
226 226
 ALLDEP=Makefile Makefile.sources Makefile.defs Makefile.rules
... ...
@@ -482,7 +482,7 @@ install-modules: $(modules_prefix)/$(modules_dir)
482 482
 	done; true
483 483
 
484 484
 install-utils: utils $(bin_prefix)/$(bin_dir)
485
-	@for r in $(utils_install) "" ; do \
485
+	@for r in $(utils_bin_install) "" ; do \
486 486
 		if [ -n "$$r" ]; then \
487 487
 			if [ -f "$$r" ]; then \
488 488
 				$(INSTALL_TOUCH) \
... ...
@@ -496,6 +496,20 @@ install-utils: utils $(bin_prefix)/$(bin_dir)
496 496
 			fi ;\
497 497
 		fi ; \
498 498
 	done; true
499
+	@for r in $(utils_script_install) "" ; do \
500
+		if [ -n "$$r" ]; then \
501
+			if [ -f "$$r" ]; then \
502
+				$(INSTALL_TOUCH) \
503
+					$(bin_prefix)/$(bin_dir)/`basename "$$r"` ; \
504
+				$(INSTALL_SCRIPT)  "$$r"  $(bin_prefix)/$(bin_dir) ; \
505
+			else \
506
+				echo "ERROR: $$r not compiled" ; \
507
+				if [ ${err_fail} = 1 ] ; then \
508
+					exit 1; \
509
+				fi ; \
510
+			fi ;\
511
+		fi ; \
512
+	done; true
499 513
 
500 514
 
501 515
 
... ...
@@ -220,6 +220,7 @@ INSTALL_TOUCH = touch          # used to create the file first (good to
220 220
                                #  make solaris install work)
221 221
 INSTALL_CFG = $(INSTALL) -m 644
222 222
 INSTALL_BIN = $(INSTALL) -m 755
223
+INSTALL_SCRIPT = $(INSTALL) -m 755
223 224
 INSTALL_MODULES = $(INSTALL) -m 755
224 225
 INSTALL_LIB = $(INSTALL) -m 755
225 226
 INSTALL_DOC = $(INSTALL) -m 644