diff --git a/collects/compiler/private/collects-path.ss b/collects/compiler/private/collects-path.ss deleted file mode 100644 index 9b06ecfb63..0000000000 --- a/collects/compiler/private/collects-path.ss +++ /dev/null @@ -1,26 +0,0 @@ - -(module collects-path mzscheme - (provide set-collects-path) - - (define label "coLLECTs dIRECTORy:") - - (define set-collects-path - (case-lambda - [() - (let ([v (current-command-line-arguments)]) - (set-collects-path (vector-ref v 0) (vector-ref v 1)))] - [(dest path) - (let-values ([(i o) (open-input-output-file dest 'update)]) - (let ([m (regexp-match-positions label i)] - [path (if (string? path) - (string->path path) - path)]) - (unless m - (error 'set-collects-path - "cannot find collection-path label in executable file")) - (file-position o (cdar m)) - (write-bytes (path->bytes path) o) - (write-byte 0 o) - (close-input-port i) - (close-output-port o)))]))) - \ No newline at end of file diff --git a/src/mred/Makefile.in b/src/mred/Makefile.in index a36e8d266c..45aef71cfc 100644 --- a/src/mred/Makefile.in +++ b/src/mred/Makefile.in @@ -238,7 +238,7 @@ install_wx_xt: cd ..; rm -f $(prefix)/bin/mred $(MAKE) @MRLIBINSTALL@ cd ..; $(ICP) mred/mred `(cd $(prefix); pwd)`/bin/ - $(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/bin/mred" ../collects + $(MZSCHEME) -mvqu "$(srcdir)/../mzscheme/collects-path.ss" "$(prefix)/bin/mred" ../collects LIBIDIR=$(prefix)/lib BUILDINFO=$(LIBIDIR)/buildinfo @@ -266,7 +266,7 @@ install_wx_mac: if [ ! -d $(prefix)/collects/launcher ] ; then mkdir $(prefix)/collects/launcher ; fi cd ..; $(ICP) -r mred/Starter.app $(prefix)/collects/launcher/. if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "@executable_path/../../../PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "@executable_path/../../../lib/PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "$(prefix)/MrEd.app/Contents/MacOS/MrEd" ; fi - $(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/MrEd.app/Contents/MacOS/MrEd" ../../../collects + $(MZSCHEME) -mvqu "$(srcdir)/../mzscheme/collects-path.ss" "$(prefix)/MrEd.app/Contents/MacOS/MrEd" ../../../collects install: $(MAKE) install_@WXVARIANT@ @@ -290,7 +290,7 @@ install-lib3m: install-3m_wx_xt: cd ..; $(ICP) mred/mred3m $(prefix)/bin/ - $(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/bin/mred" ../collects + $(MZSCHEME) -mvqu "$(srcdir)/../mzscheme/collects-path.ss" "$(prefix)/bin/mred" ../collects $(MAKE) @MRLIBINSTALL@3m install-3m_wx_mac: @@ -306,7 +306,7 @@ install-3m_wx_mac: if [ ! -d $(prefix)/collects/launcher ] ; then mkdir $(prefix)/collects/launcher ; fi cd ..; $(ICP) -r mred/Starter3m.app $(prefix)/collects/launcher/. if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "@executable_path/../../../PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "@executable_path/../../../lib/PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "$(prefix)/MrEd3m.app/Contents/MacOS/MrEd3m" ; fi - $(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/MrEd3m.app/Contents/MacOS/MrEd3m" ../../../collects + $(MZSCHEME) -mvqu "$(srcdir)/../mzscheme/collects-path.ss" "$(prefix)/MrEd3m.app/Contents/MacOS/MrEd3m" ../../../collects install-3m: $(MAKE) install-3m_@WXVARIANT@ diff --git a/src/mzscheme/Makefile.in b/src/mzscheme/Makefile.in index 4fad643d14..25ec86b5ab 100644 --- a/src/mzscheme/Makefile.in +++ b/src/mzscheme/Makefile.in @@ -266,7 +266,7 @@ install: install-3m-basic: cd ..; $(ICP) mzscheme/mzscheme3m $(prefix)/bin/mzscheme3m cd ..; $(ICP) mzscheme/mzdyn3m.o $(prefix)/lib/mzdyn3m.o - ./mzscheme -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/bin/mzscheme3m" ../collects + ./mzscheme -mvqu "$(srcdir)/collects-path.ss" "$(prefix)/bin/mzscheme3m" ../collects install-3m@NOT_OSX@: $(MAKE) install-3m-basic @@ -282,7 +282,7 @@ unix-install: cd ..; $(ICP) mzscheme/libmzgc.@LIBSFX@ $(LIBIDIR)/libmzgc.@LIBSFX@ cd ..; $(ICP) mzscheme/libmzscheme.@LIBSFX@ $(LIBIDIR)/libmzscheme.@LIBSFX@ cd ..; $(ICP) mzscheme/mzscheme "$(BINDIR)/mzscheme" - ./mzscheme -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(BINDIR)/mzscheme" ../collects + ./mzscheme -mvqu "$(srcdir)/collects-path.ss" "$(BINDIR)/mzscheme" ../collects cd ..; echo 'CC=@CC@' > $(BUILDINFO) cd ..; echo 'CFLAGS=@CFLAGS@ @PREFLAGS@ @COMPFLAGS@' >> $(BUILDINFO) cd ..; echo 'OPTIONS=@OPTIONS@' >> $(BUILDINFO) diff --git a/src/mzscheme/collects-path.ss b/src/mzscheme/collects-path.ss new file mode 100644 index 0000000000..0a091ee652 --- /dev/null +++ b/src/mzscheme/collects-path.ss @@ -0,0 +1,25 @@ + +;; This module is executed by the install process to update +;; the embedded path to "collects" in an executable. + +(module collects-path mzscheme + + (define label "coLLECTs dIRECTORy:") + + (let ([dest (vector-ref (current-command-line-arguments) 0)] + [path (vector-ref (current-command-line-arguments) 1)]) + (let-values ([(i o) (open-input-output-file dest 'update)]) + (let ([m (regexp-match-positions label i)] + [path (if (string? path) + (string->path path) + path)]) + (unless m + (error 'set-collects-path + "cannot find collection-path label in executable file")) + (file-position o (cdar m)) + (write-bytes (path->bytes path) o) + (write-byte 0 o) + (close-input-port i) + (close-output-port o))))) + + \ No newline at end of file