This patch reuses parameters for default.make for the name of the
installation program to be used for egg installation, including options.


felix
From e7b25a1fff103cc876f8abf36e2d8064012d9e9a Mon Sep 17 00:00:00 2001
From: felix <fe...@p.callcc.org>
Date: Tue, 16 Oct 2018 13:34:42 +0200
Subject: [PATCH] Use installation program and options from build system for
 egg installation

Instead of hardcoding the install(1) program and options in chicken-install,
use the associated values from default.make/chicken-config.h.
---
 defaults.make       | 9 +++++++++
 egg-compile.scm     | 6 ++++--
 egg-environment.scm | 3 +++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/defaults.make b/defaults.make
index 7e20b873..47bdfb9a 100644
--- a/defaults.make
+++ b/defaults.make
@@ -408,12 +408,21 @@ endif
 	$(call echo, >>, $@,#ifndef C_TARGET_RC_COMPILER)
 	$(call echo, >>, $@,# define C_TARGET_RC_COMPILER "$(TARGET_RC_COMPILER)")
 	$(call echo, >>, $@,#endif)
+	$(call echo, >>, $@,#ifndef C_TARGET_INSTALL_PROGRAM)
+	$(call echo, >>, $@,# define C_TARGET_INSTALL_PROGRAM "$(INSTALL_PROGRAM)")
+	$(call echo, >>, $@,#endif)
 	$(call echo, >>, $@,#ifndef C_TARGET_CFLAGS)
 	$(call echo, >>, $@,# define C_TARGET_CFLAGS "$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)")
 	$(call echo, >>, $@,#endif)
 	$(call echo, >>, $@,#ifndef C_TARGET_LDFLAGS)
 	$(call echo, >>, $@,# define C_TARGET_LDFLAGS "$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)")
 	$(call echo, >>, $@,#endif)
+	$(call echo, >>, $@,#ifndef C_TARGET_INSTALL_PROGRAM_EXECUTABLE_OPTIONS)
+	$(call echo, >>, $@,# define C_TARGET_INSTALL_PROGRAM_EXECUTABLE_OPTIONS "$(INSTALL_PROGRAM_EXECUTABLE_OPTIONS)")
+	$(call echo, >>, $@,#endif)
+	$(call echo, >>, $@,#ifndef C_TARGET_INSTALL_PROGRAM_FILE_OPTIONS)
+	$(call echo, >>, $@,# define C_TARGET_INSTALL_PROGRAM_FILE_OPTIONS "$(INSTALL_PROGRAM_FILE_OPTIONS)")
+	$(call echo, >>, $@,#endif)
 	$(call echo, >>, $@,#ifndef C_TARGET_FEATURES)
 	$(call echo, >>, $@,# define C_TARGET_FEATURES "$(TARGET_FEATURES)")
 	$(call echo, >>, $@,#endif)
diff --git a/egg-compile.scm b/egg-compile.scm
index 9c1b9f82..f5de6fc2 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -78,12 +78,14 @@
 
 (define (install-executable-command platform)
   (case platform
-    ((unix) "install -m755")
+    ((unix) (string-append default-install-program " " 
+                           default-install-program-executable-flags))
     ((windows) "copy /y")))
 
 (define (install-file-command platform)
   (case platform
-    ((unix) "install -m644")
+    ((unix) (string-append default-install-program " "
+                           default-install-program-data-flags))
     ((windows) "copy /y")))
 
 (define (remove-file-command platform)
diff --git a/egg-environment.scm b/egg-environment.scm
index f27ea097..00de063a 100644
--- a/egg-environment.scm
+++ b/egg-environment.scm
@@ -46,8 +46,11 @@ EOF
 
 (define default-cc (foreign-value "C_TARGET_CC" c-string))
 (define default-cxx (foreign-value "C_TARGET_CXX" c-string))
+(define default-install-program (foreign-value "C_TARGET_INSTALL_PROGRAM" c-string))
 (define default-cflags (foreign-value "C_TARGET_CFLAGS" c-string))
 (define default-ldflags (foreign-value "C_TARGET_LDFLAGS" c-string))
+(define default-install-program-executable-flags (foreign-value "C_TARGET_INSTALL_PROGRAM_EXECUTABLE_OPTIONS" c-string))
+(define default-install-program-data-flags (foreign-value "C_TARGET_INSTALL_PROGRAM_FILE_OPTIONS" c-string))
 (define default-libs (foreign-value "C_TARGET_MORE_LIBS" c-string))
 (define default-libdir (foreign-value "C_TARGET_LIB_HOME" c-string))
 (define default-runlibdir (foreign-value "C_TARGET_RUN_LIB_HOME" c-string))
-- 
2.11.0

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to