~ chicken-core (chicken-5) 1bc6f5196a7246e48edc3ca6790652d7195674d4
commit 1bc6f5196a7246e48edc3ca6790652d7195674d4
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Tue Mar 9 13:01:13 2010 +0100
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Tue Mar 9 13:01:13 2010 +0100
provide chicken-fetch and chicken-install on windows
diff --git a/Makefile.cygwin b/Makefile.cygwin
index 0fc58e1e..4f0edf8a 100644
--- a/Makefile.cygwin
+++ b/Makefile.cygwin
@@ -36,6 +36,7 @@ SRCDIR = ./
ARCH ?= x86
HACKED_APPLY ?= 1
DLLSINPATH = 1
+INSTALL_FETCH_AND_REMOVE ?= 1
# options
@@ -85,6 +86,14 @@ LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
CHICKEN_CONFIG_H = chicken-config.h
APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
+# Vista doesn't like programs named "install"
+
+INSTALL_PROGRAM = cp
+INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS = -r
+INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS = -r
+INSTALL_PROGRAM_EXECUTABLE_OPTIONS = -r
+INSTALL_PROGRAM_FILE_OPTIONS = -r
+
# select default and internal settings
CUSTOM_CHICKEN_DEFAULTS=1
diff --git a/Makefile.mingw b/Makefile.mingw
index 52ecb90f..547d75d0 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -40,6 +40,7 @@ ARCH ?= x86
WINDOWS = 1
WINDOWS_SHELL = 1
UNAME_SYS = MinGW
+INSTALL_FETCH_AND_REMOVE ?= 1
ifeq ($(ARCH),x86)
HACKED_APPLY ?= 1
diff --git a/Makefile.mingw-msys b/Makefile.mingw-msys
index b78b327e..5e1e957b 100644
--- a/Makefile.mingw-msys
+++ b/Makefile.mingw-msys
@@ -41,6 +41,7 @@ else
HACKED_APPLY =
endif
WINDOWS = 1
+INSTALL_FETCH_AND_REMOVE ?= 1
# file extensions
@@ -70,6 +71,15 @@ LIBUCHICKEN_SO_LIBRARIES = -lm -lws2_32
LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
+# Don't use "install" program as it is broken in some Mingw versions and
+# Vista doesn't like it, anyway.
+
+INSTALL_PROGRAM = cp
+INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS = -r
+INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS = -r
+INSTALL_PROGRAM_EXECUTABLE_OPTIONS = -r
+INSTALL_PROGRAM_FILE_OPTIONS = -r
+
# special files
CHICKEN_CONFIG_H = chicken-config.h
diff --git a/README b/README
index 90c448a4..8039ad19 100644
--- a/README
+++ b/README
@@ -304,6 +304,13 @@
provided (`Makefile.mingw-msys' and `Makefile.mingw').
Please also read the notes below.
+ - On Windows Vista and later versions, programs that have
+ names including the words `setup' or `install' will
+ require administrator rights to execute correctly. For this
+ reason the `chicken-install.exe' and `chicken-uninstall.exe'
+ programs are also available under the names `chicken-fetch.exe'
+ and `chicken-remove.exe', respectively
+
- When installing under the mingw-msys platform, PREFIX must be an
absolute path name (i.e. it must include the drive letter) and
must use forward slashes (no backward slashes).
diff --git a/defaults.make b/defaults.make
index d6d0585d..076a117c 100644
--- a/defaults.make
+++ b/defaults.make
@@ -311,7 +311,9 @@ CSC_PROGRAM = $(PROGRAM_PREFIX)csc$(PROGRAM_SUFFIX)
CSI_PROGRAM = $(PROGRAM_PREFIX)csi$(PROGRAM_SUFFIX)
CHICKEN_PROFILE_PROGRAM = $(PROGRAM_PREFIX)chicken-profile$(PROGRAM_SUFFIX)
CHICKEN_INSTALL_PROGRAM = $(PROGRAM_PREFIX)chicken-install$(PROGRAM_SUFFIX)
+CHICKEN_FETCH_PROGRAM = $(PROGRAM_PREFIX)chicken-fetch$(PROGRAM_SUFFIX)
CHICKEN_UNINSTALL_PROGRAM = $(PROGRAM_PREFIX)chicken-uninstall$(PROGRAM_SUFFIX)
+CHICKEN_REMOVE_PROGRAM = $(PROGRAM_PREFIX)chicken-remove$(PROGRAM_SUFFIX)
CHICKEN_STATUS_PROGRAM = $(PROGRAM_PREFIX)chicken-status$(PROGRAM_SUFFIX)
CHICKEN_BUG_PROGRAM = $(PROGRAM_PREFIX)chicken-bug$(PROGRAM_SUFFIX)
IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures ports files posix srfi-13 srfi-69 extras \
diff --git a/rules.make b/rules.make
index 0faceadc..cc69a16a 100644
--- a/rules.make
+++ b/rules.make
@@ -872,6 +872,10 @@ endif
ifndef STATICBUILD
$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_INSTALL_PROGRAM)$(EXE) "$(DESTDIR)$(IBINDIR)"
$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) "$(DESTDIR)$(IBINDIR)"
+ifneq ($(INSTALL_FETCH_AND_REMOVE),)
+ $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_INSTALL_PROGRAM)$(EXE) "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_FETCH_PROGRAM)"
+ $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_REMOVE_PROGRAM)"
+endif
$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_STATUS_PROGRAM)$(EXE) "$(DESTDIR)$(IBINDIR)"
ifneq ($(POSTINSTALL_PROGRAM),true)
$(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM)"
@@ -880,7 +884,11 @@ ifneq ($(POSTINSTALL_PROGRAM),true)
endif
ifneq ($(CROSS_CHICKEN),1)
ifeq ($(DESTDIR),)
+ifneq ($(INSTALL_FETCH_AND_REMOVE),)
+ -$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_FETCH_PROGRAM) -update-db
+else
-$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -update-db
+endif
else
@echo
@echo "Warning: cannot run chicken-install -update-db when DESTDIR is set"
@@ -974,6 +982,8 @@ uninstall:
"$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM)$(EXE)" \
"$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM)$(EXE)" \
"$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM)$(EXE)" \
+ "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_FETCH_PROGRAM)$(EXE)" \
+ "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_REMOVE_PROGRAM)$(EXE)" \
"$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_STATUS_PROGRAM)$(EXE)" \
"$(DESTDIR)$(IBINDIR)$(SEP)$(CSC_PROGRAM)$(EXE)" \
"$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_BUG_PROGRAM)$(EXE)"
Trap