cs: make build without "cs" suffix use "compiled" directly
When building RacketCS as just "racket", put compiled files in "compiled" instead of a platform-specific subdirectory.
This commit is contained in:
parent
8bed64f44f
commit
9498c521cf
15
INSTALL.txt
15
INSTALL.txt
|
@ -178,13 +178,14 @@ More Instructions: Building Racket-on-Chez
|
|||
==========================================
|
||||
|
||||
The `make cs` target (or `make cs-as-is` for a rebuild, or `nmake
|
||||
win32-cs` on Windows with Visual Studio) builds an experimental
|
||||
variant of Racket that runs on Chez Scheme. By default, the
|
||||
executables for the Racket-on-Chez variant all have a "cs" or "CS"
|
||||
suffix, so they coexist with a traditional Racket build. You can
|
||||
remove the "cs" suffix by providing `RACKETCS_SUFFIX=""` to `make`.
|
||||
(One day, if the experiment goes well, the default for
|
||||
`RACKETCS_SUFFIX with change from "cs" to "".)
|
||||
win32-cs` on Windows with Visual Studio) builds a variant of Racket
|
||||
that runs on Chez Scheme. By default, the executables for the
|
||||
Racket-on-Chez variant all have a "cs" or "CS" suffix, and they
|
||||
coexist with a traditional Racket build by keeping compiled files in a
|
||||
machine-specific subdirectory of the "compiled" directory. You can
|
||||
remove the "cs" suffix and the subdirectory in "compiled" by providing
|
||||
`RACKETCS_SUFFIX=""` to `make`. (One day, if all goes well, the
|
||||
default for `RACKETCS_SUFFIX` will change from "cs" to "".)
|
||||
|
||||
Building Racket-on-Chez requires an existing Racket and Chez Scheme.
|
||||
If you use `make cs` with no further arguments, then the build process
|
||||
|
|
18
Makefile
18
Makefile
|
@ -282,9 +282,12 @@ cs-base:
|
|||
cs-as-is:
|
||||
$(MAKE) cs CS_SETUP_TARGET=in-place-setup
|
||||
|
||||
CS_CONFIG_TARGET = no-cfg-cs
|
||||
RACKET_GIVEN_ARGS = RACKET="$(RACKET_BUILT_FOR_CS)" CS_CONFIG_TARGET=run-cfg-cs SETUP_BOOT_MODE=--boot
|
||||
|
||||
cs-after-racket:
|
||||
if [ "$(RACKET)" = "" ] ; \
|
||||
then $(MAKE) cs-after-racket-with-racket RACKET="$(RACKET_BUILT_FOR_CS)" SETUP_BOOT_MODE=--boot ; \
|
||||
then $(MAKE) cs-after-racket-with-racket $(RACKET_GIVEN_ARGS) ; \
|
||||
else $(MAKE) cs-after-racket-with-racket RACKET="$(RACKET)" ; fi
|
||||
|
||||
RACKETCS_SUFFIX_CONFIG = MORE_CONFIGURE_ARGS="$(MORE_CONFIGURE_ARGS) --enable-csdefault" PLAIN_RACKET="$(PLAIN_RACKET)3m"
|
||||
|
@ -296,7 +299,7 @@ racket-then-cs:
|
|||
|
||||
racket-configured-then-cs:
|
||||
$(MAKE) plain-base BASE_INSTALL_TARGET=nothing-after-base
|
||||
$(MAKE) cs-after-racket-with-racket RACKET="$(RACKET_BUILT_FOR_CS)" SETUP_BOOT_MODE=--boot
|
||||
$(MAKE) cs-after-racket-with-racket $(RACKET_GIVEN_ARGS)
|
||||
|
||||
cs-only:
|
||||
$(MAKE) racket/src/build/Makefile SRC_MAKEFILE_CONFIG=cfg-cs
|
||||
|
@ -327,9 +330,16 @@ cs-after-racket-with-abs-paths:
|
|||
nothing-after-base:
|
||||
echo base done
|
||||
|
||||
racket/src/build/cs/Makefile: racket/src/cs/c/configure racket/src/cs/c/Makefile.in
|
||||
racket/src/build/cs/Makefile: racket/src/cs/c/configure racket/src/cs/c/Makefile.in racket/src/cfg-cs
|
||||
mkdir -p cd racket/src/build/cs
|
||||
cd racket/src/build/cs; ../../cs/c/configure
|
||||
cd racket/src/build/cs; ../../cs/c/configure $(CONFIGURE_ARGS_qq) $(MORE_CONFIGURE_ARGS)
|
||||
$(MAKE) $(CS_CONFIG_TARGET)
|
||||
|
||||
run-cfg-cs:
|
||||
cd racket/src/build; ../../cs/cfg-cs $(CONFIGURE_ARGS_qq) $(MORE_CONFIGURE_ARGS)
|
||||
|
||||
no-cfg-cs:
|
||||
echo done
|
||||
|
||||
scheme-src:
|
||||
$(MAKE) racket/src/build/ChezScheme
|
||||
|
|
|
@ -19,7 +19,7 @@ RUMBLE_UNSAFE_COMP = --unsafe
|
|||
COMPILE_FILE = $(SCHEME) --script compile-file.ss $(UNSAFE_COMP) $(COMPRESS_COMP) $(DEBUG_COMP) --dest "$(BUILDDIR)"
|
||||
COMPILE_FILE_DEPS = compile-file.ss include.ss place-register.ss
|
||||
|
||||
RACKET_SETUP_ARGS = ../../bin/racket ../collects ../etc 0 false
|
||||
RACKET_SETUP_ARGS = ../../bin/racket ../collects ../etc 0 true false
|
||||
|
||||
PRIMITIVES_TABLES = primitive/kernel.ss primitive/unsafe.ss primitive/flfxnum.ss \
|
||||
primitive/paramz.ss primitive/extfl.ss primitive/network.ss \
|
||||
|
|
|
@ -131,10 +131,10 @@ racket.boot: racket.so
|
|||
EMBED_DEPS = $(srcdir)/embed-boot.rkt
|
||||
|
||||
racketcs@NOT_OSX@: raw_racketcs racket.boot $(EMBED_DEPS)
|
||||
$(RACKET) $(srcdir)/embed-boot.rkt @COMPRESS_COMP@ raw_racketcs racketcs $(SCHEME_INC) racket.boot
|
||||
$(BOOTSTRAP_RACKET) $(srcdir)/embed-boot.rkt @COMPRESS_COMP@ raw_racketcs racketcs $(SCHEME_INC) racket.boot
|
||||
|
||||
gracketcs@NOT_OSX@: raw_gracketcs racket.boot $(EMBED_DEPS)
|
||||
$(RACKET) $(srcdir)/embed-boot.rkt @COMPRESS_COMP@ raw_gracketcs gracketcs $(SCHEME_INC) racket.boot
|
||||
$(BOOTSTRAP_RACKET) $(srcdir)/embed-boot.rkt @COMPRESS_COMP@ raw_gracketcs gracketcs $(SCHEME_INC) racket.boot
|
||||
|
||||
BOOT_OBJS = boot.o $(SCHEME_INC)/kernel.o rktio/librktio.a
|
||||
|
||||
|
@ -165,7 +165,7 @@ $(GRACKET_BIN): grmain.o $(RKTFW) $(GRAPPSKEL)
|
|||
/usr/bin/install_name_tool -change "Racket.framework/Versions/$(FWVERSION)_CS/Racket" "@executable_path/../../../Racket.framework/Versions/$(FWVERSION)_CS/Racket" $(GRACKET_BIN)
|
||||
|
||||
$(GRAPPSKEL): $(srcdir)/../../mac/osx_appl.rkt $(srcdir)/../../racket/src/schvers.h $(srcdir)/../../mac/icon/GRacket.icns
|
||||
env $(RACKET) $(srcdir)/../../mac/osx_appl.rkt $(srcdir)/../.. "CS"
|
||||
$(BOOTSTRAP_RACKET) $(srcdir)/../../mac/osx_appl.rkt $(srcdir)/../.. "CS"
|
||||
|
||||
BOOT_FILES = $(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot racket.boot
|
||||
FW_BOOT_DEST = Racket.framework/Versions/$(FWVERSION)_CS/boot
|
||||
|
@ -178,7 +178,7 @@ $(RKTFW): $(BOOT_OBJS) $(BOOT_FILES)
|
|||
mkdir -p Racket.framework/Versions/$(FWVERSION)_CS/boot
|
||||
cp $(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot $(FW_BOOT_DEST)
|
||||
cp racket.boot $(FW_BOOT_DEST)
|
||||
$(RACKET) $(srcdir)/adjust-compress.rkt @COMPRESS_COMP@ $(FW_BOOT_DEST)/petite.boot $(FW_BOOT_DEST)/scheme.boot $(FW_BOOT_DEST)/racket.boot
|
||||
$(BOOTSTRAP_RACKET) $(srcdir)/adjust-compress.rkt @COMPRESS_COMP@ $(FW_BOOT_DEST)/petite.boot $(FW_BOOT_DEST)/scheme.boot $(FW_BOOT_DEST)/racket.boot
|
||||
|
||||
# ----------------------------------------
|
||||
# Common
|
||||
|
@ -186,11 +186,12 @@ $(RKTFW): $(BOOT_OBJS) $(BOOT_FILES)
|
|||
DEF_COLLECTS_DIR = -DINITIAL_COLLECTS_DIRECTORY='"'"`cd $(srcdir)/../../../collects; pwd`"'"'
|
||||
DEF_CONFIG_DIR = -DINITIAL_CONFIG_DIRECTORY='"'"`cd $(srcdir)/../../..; pwd`/etc"'"'
|
||||
DEF_C_DIRS = $(DEF_COLLECTS_DIR) $(DEF_CONFIG_DIR)
|
||||
COMP_SUBDIR = -DCS_COMPILED_SUBDIR=@CS_COMPILED_SUBDIR@
|
||||
|
||||
MAIN_DEPS = $(srcdir)/main.c $(srcdir)/boot.h $(srcdir)/../../start/config.inc
|
||||
|
||||
main.o: $(MAIN_DEPS)
|
||||
$(CC) $(CFLAGS) $(DEF_C_DIRS) -c -o main.o $(srcdir)/main.c
|
||||
$(CC) $(CFLAGS) $(DEF_C_DIRS) $(COMP_SUBDIR) -c -o main.o $(srcdir)/main.c
|
||||
|
||||
grmain.o: $(srcdir)/grmain.c $(MAIN_DEPS) $(srcdir)/../../start/gui_filter.inc
|
||||
$(CC) $(CFLAGS) $(DEF_C_DIRS) -c -o grmain.o $(srcdir)/grmain.c
|
||||
|
@ -255,6 +256,6 @@ macos-install-gracket:
|
|||
/usr/bin/install_name_tool -change "@executable_path/Racket.framework/Versions/$(FWVERSION)_CS/Racket" "@FRAMEWORK_PREFIX@Racket.framework/Versions/$(FWVERSION)_CS/Racket" $(DESTDIR)"$(bindir)/racket$(CS_INSTALLED)"
|
||||
rm -rf $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app"
|
||||
$(ICP) -r "GRacketCS.app" $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app"
|
||||
$(RACKET) "$(srcdir)/../../mac/rename-app.rkt" $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app" "GRacketCS" "GRacket$(CS_GR_INSTALLED)" no-up
|
||||
$(BOOTSTRAP_RACKET) "$(srcdir)/../../mac/rename-app.rkt" $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app" "GRacketCS" "GRacket$(CS_GR_INSTALLED)" no-up
|
||||
/usr/bin/install_name_tool -change "@executable_path/../../../../racket/Racket.framework/Versions/$(FWVERSION)_CS/Racket" "@FRAMEWORK_PREFIX@Racket.framework/Versions/$(FWVERSION)_CS/Racket" $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app/Contents/MacOS/GRacket$(CS_GR_INSTALLED)"
|
||||
$(RACKET) "$(srcdir)/../../racket/collects-path.rkt" $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app/Contents/MacOS/GRacket$(CS_GR_INSTALLED)" ../../../../collects ../../../../etc
|
||||
$(RACKET) -cu "$(srcdir)/../../racket/collects-path.rkt" $(DESTDIR)"$(libpltdir)/GRacket$(CS_GR_INSTALLED).app/Contents/MacOS/GRacket$(CS_GR_INSTALLED)" ../../../../collects ../../../../etc
|
||||
|
|
|
@ -81,7 +81,7 @@ static void init_foreign()
|
|||
void racket_boot(int argc, char **argv, char *self, long segment_offset,
|
||||
char *coldir, char *configdir,
|
||||
int pos1, int pos2, int pos3,
|
||||
int is_gui)
|
||||
int cs_compiled_subdir, int is_gui)
|
||||
/* exe argument already stripped from argv */
|
||||
{
|
||||
#if !defined(RACKET_USE_FRAMEWORK) || !defined(RACKET_AS_BOOT)
|
||||
|
@ -133,6 +133,7 @@ void racket_boot(int argc, char **argv, char *self, long segment_offset,
|
|||
l = Scons(Sbytevector(argv[i]), l);
|
||||
}
|
||||
l = Scons(Sbytevector(is_gui ? "true" : "false"), l);
|
||||
l = Scons(Sbytevector(cs_compiled_subdir ? "true" : "false"), l);
|
||||
sprintf(segment_offset_s, "%ld", segment_offset);
|
||||
l = Scons(Sbytevector(segment_offset_s), l);
|
||||
l = Scons(Sbytevector(configdir), l);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
void racket_boot(int argc, char **argv, char *self, long segment_offset,
|
||||
char *coldir, char *configdir,
|
||||
int pos1, int pos2, int pos3,
|
||||
int is_gui);
|
||||
int cs_compiled_subdir, int is_gui);
|
||||
|
|
8
racket/src/cs/c/configure
vendored
8
racket/src/cs/c/configure
vendored
|
@ -622,6 +622,7 @@ ac_includes_default="\
|
|||
|
||||
ac_subst_vars='LTLIBOBJS
|
||||
LIBOBJS
|
||||
CS_COMPILED_SUBDIR
|
||||
CS_INSTALLED
|
||||
FRAMEWORK_PREFIX
|
||||
FRAMEWORK_INSTALL_DIR
|
||||
|
@ -2538,6 +2539,12 @@ if test "${enable_csdefault}" = "yes" ; then
|
|||
CS_INSTALLED=""
|
||||
fi
|
||||
|
||||
CS_COMPILED_SUBDIR=1
|
||||
if test "${enable_csdefault}" = "yes" ; then
|
||||
CS_COMPILED_SUBDIR=0
|
||||
fi
|
||||
|
||||
|
||||
############## Install targets ################
|
||||
|
||||
PREFIX_PATH_RELATIVE=/../..
|
||||
|
@ -4441,6 +4448,7 @@ CPPFLAGS="$CPPFLAGS $PREFLAGS"
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
makefiles="Makefile"
|
||||
|
|
|
@ -79,6 +79,12 @@ if test "${enable_csdefault}" = "yes" ; then
|
|||
CS_INSTALLED=""
|
||||
fi
|
||||
|
||||
CS_COMPILED_SUBDIR=1
|
||||
if test "${enable_csdefault}" = "yes" ; then
|
||||
CS_COMPILED_SUBDIR=0
|
||||
fi
|
||||
|
||||
|
||||
############## Install targets ################
|
||||
|
||||
PREFIX_PATH_RELATIVE=/../..
|
||||
|
@ -419,6 +425,7 @@ AC_SUBST(SCHEME_CONFIG_ARGS)
|
|||
AC_SUBST(FRAMEWORK_INSTALL_DIR)
|
||||
AC_SUBST(FRAMEWORK_PREFIX)
|
||||
AC_SUBST(CS_INSTALLED)
|
||||
AC_SUBST(CS_COMPILED_SUBDIR)
|
||||
|
||||
makefiles="Makefile"
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ static int scheme_utf8_encode(unsigned int *path, int zero_offset, int len,
|
|||
# define RACKET_IS_GUI 0
|
||||
#endif
|
||||
|
||||
#ifndef CS_COMPILED_SUBDIR
|
||||
# define CS_COMPILED_SUBDIR 1
|
||||
#endif
|
||||
|
||||
#define XFORM_SKIP_PROC /* empty */
|
||||
|
||||
#include "../../start/config.inc"
|
||||
|
@ -128,7 +132,7 @@ int main(int argc, char **argv)
|
|||
racket_boot(argc, argv, self, segment_offset,
|
||||
extract_coldir(), extract_configdir(),
|
||||
pos1, pos2, pos3,
|
||||
RACKET_IS_GUI);
|
||||
CS_COMPILED_SUBDIR, RACKET_IS_GUI);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -56,22 +56,25 @@
|
|||
the-command-line-arguments/maybe-bytes))
|
||||
|
||||
(seq
|
||||
(unless (>= (length the-command-line-arguments) 5)
|
||||
(error 'racket "expected `self`, `collects`, and `libs` paths plus `segment-offset` and `is-gui?` to start"))
|
||||
(unless (>= (length the-command-line-arguments) 6)
|
||||
(error 'racket "expected `self`, `collects`, and `libs` paths plus `segment-offset`, `cs-compiled-subdir?`, and `is-gui?` to start"))
|
||||
(set-exec-file! (path->complete-path (car the-command-line-arguments))))
|
||||
(define init-collects-dir (let ([s (cadr the-command-line-arguments)])
|
||||
(if (equal? s "") 'disable (string->path s))))
|
||||
(define init-config-dir (string->path (or (getenv "PLTCONFIGDIR")
|
||||
(caddr the-command-line-arguments))))
|
||||
(define segment-offset (#%string->number (list-ref the-command-line-arguments 3)))
|
||||
(define gracket? (string=? "true" (list-ref the-command-line-arguments 4)))
|
||||
(define cs-compiled-subdir? (string=? "true" (list-ref the-command-line-arguments 4)))
|
||||
(define gracket? (string=? "true" (list-ref the-command-line-arguments 5)))
|
||||
|
||||
(seq
|
||||
(when (foreign-entry? "racket_exit")
|
||||
(#%exit-handler (foreign-procedure "racket_exit" (int) void))))
|
||||
|
||||
(define compiled-file-paths
|
||||
(list (string->path (string-append "compiled/"
|
||||
(list (string->path (cond
|
||||
[cs-compiled-subdir?
|
||||
(string-append "compiled/"
|
||||
(cond
|
||||
[(getenv "PLT_ZO_PATH")
|
||||
=> (lambda (s)
|
||||
|
@ -80,7 +83,8 @@
|
|||
(error 'racket "PLT_ZO_PATH environment variable is not a valid path"))
|
||||
s)]
|
||||
[platform-independent-zo-mode? "cs"]
|
||||
[else (symbol->string (machine-type))])))))
|
||||
[else (symbol->string (machine-type))]))]
|
||||
[else "compiled"]))))
|
||||
(define user-specific-search-paths? #t)
|
||||
(define load-on-demand? #t)
|
||||
|
||||
|
@ -216,7 +220,7 @@
|
|||
(define remaining-command-line-arguments '#())
|
||||
|
||||
(seq
|
||||
(let flags-loop ([args (list-tail the-command-line-arguments 5)]
|
||||
(let flags-loop ([args (list-tail the-command-line-arguments 6)]
|
||||
[saw (hasheq)])
|
||||
;; An element of `args` can become `(cons _arg _within-arg)`
|
||||
;; due to splitting multiple flags with a single "-"
|
||||
|
|
Loading…
Reference in New Issue
Block a user