Skip to content

Commit

Permalink
Makefile: support both cross-platform and non-cross installers
Browse files Browse the repository at this point in the history
In non-cross mode, `-C` needs to go after `-G` and `-X` when setting
up a "bundle" directory to turn into an installer, because that mode
needs to use foreign libraries (such as SQLite) at build time, and it
can use the instances that are being set up for the installer.

Meanwhile, improve the advice for setting `PLAIN_RACKET` to use `-C`
for a cross-platform build mode, even though things tend to work
anyway without it.
  • Loading branch information
mflatt committed Apr 26, 2017
1 parent 6de3659 commit d469265
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
12 changes: 8 additions & 4 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,14 @@ libraries. See the documentation for `raco setup' for information on
the options.

For cross compilation, add configuration options to
`CONFIGURE_ARGS_qq="..."' as described in the "README" of "racket/src",
but also add a `PLAIN_RACKET=...' argument for the top-level makefile
to specify the same executable as in an `--enable-racket=...' for
`configure'.
`CONFIGURE_ARGS_qq="..."' as described in the "README" of
"racket/src", but also add a `PLAIN_RACKET=...' argument for the
top-level makefile to specify the same executable as in an
`--enable-racket=...' for `configure'. In general, the `PLAIN_RACKET`
setting should have the form `PLAIN_RACKET="... -C"` to ensure that
cross-compilation mode is used and that any foreign libraries needed
for build time can be found, but many cross-compilation scenarios work
without `-C`.

Installing Packages
-------------------
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ REMOTE_USER_AUTO = --catalog $(SVR_CAT) $(USER_AUTO_OPTIONS)
REMOTE_INST_AUTO = --catalog $(SVR_CAT) --scope installation $(X_AUTO_OPTIONS)
CONFIG_MODE_q = "$(CONFIG)" "$(CONFIG_MODE)"
BUNDLE_CONFIG = bundle/racket/etc/config.rktd
BUNDLE_RACO_FLAGS = -C -G bundle/racket/etc -X bundle/racket/collects -A bundle/user -l raco
BUNDLE_RACO_FLAGS = -G bundle/racket/etc -X bundle/racket/collects -C -A bundle/user -l raco
BUNDLE_RACO = $(PLAIN_RACKET) $(BUNDLE_RACO_FLAGS)
WIN32_BUNDLE_RACO = $(WIN32_PLAIN_RACKET) $(BUNDLE_RACO_FLAGS)
IN_BUNDLE_RACO = bundle/racket/bin/raco
Expand Down
4 changes: 3 additions & 1 deletion pkgs/racket-doc/scribblings/reference/startup.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ flags:
@racket[(find-system-path 'config-dir)] and
@racket[(find-system-path 'collects-dir)] to be the results of
@racket[(find-system-path 'host-config-dir)] and
@racket[(find-system-path 'host-collects-dir)], respectively.}
@racket[(find-system-path 'host-collects-dir)], respectively.
If @FlagFirst{C} or @DFlagFirst{cross} is provided multiple
times, only the first instance has an effect.}

@item{@FlagFirst{N} @nonterm{file} or @DFlagFirst{name}
@nonterm{file} : sets the name of the executable as reported
Expand Down
12 changes: 7 additions & 5 deletions racket/src/racket/cmdline.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1311,11 +1311,13 @@ static int run_from_cmd_line(int argc, char *_argv[],
was_config_flag = 1;
break;
case 'C':
cross_compile = 1;
scheme_set_cross_compile_mode(1);
was_config_flag = 1;
host_config_path = config_path;
host_collects_path = collects_path;
if (!cross_compile) {
cross_compile = 1;
scheme_set_cross_compile_mode(1);
was_config_flag = 1;
host_config_path = config_path;
host_collects_path = collects_path;
}
break;
case 'U':
scheme_set_ignore_user_paths(1);
Expand Down

0 comments on commit d469265

Please sign in to comment.