simplify cross-compilation with a #:cross-target
option
This commit is contained in:
parent
8a1d196ff3
commit
6c3971172a
|
@ -248,13 +248,6 @@ spaces, etc.):
|
||||||
@item{@racket[#:pkgs (list _string* ...)] --- packages to install;
|
@item{@racket[#:pkgs (list _string* ...)] --- packages to install;
|
||||||
defaults to the @tt{PKGS} makefile variable}
|
defaults to the @tt{PKGS} makefile variable}
|
||||||
|
|
||||||
@item{@racket[#:racket _string-or-false] --- path to a native Racket
|
|
||||||
executable when using the client machine for cross-compilation; if
|
|
||||||
the value is @racket[#f], the the Racket executable generated for
|
|
||||||
the client machine is used to prepare the installer; a
|
|
||||||
non-@racket[#f] typically must be combined with
|
|
||||||
@racket[#:configure] arguments to set up cross-compilation}
|
|
||||||
|
|
||||||
@item{@racket[#:dist-base-url _string] --- a URL that is used to
|
@item{@racket[#:dist-base-url _string] --- a URL that is used to
|
||||||
construct a default for @racket[#:doc-search] and
|
construct a default for @racket[#:doc-search] and
|
||||||
@racket[#:dist-catalogs], where the constructed values are
|
@racket[#:dist-catalogs], where the constructed values are
|
||||||
|
@ -316,14 +309,33 @@ spaces, etc.):
|
||||||
shown, for example, in the Virtual Box GUI); if provided, the
|
shown, for example, in the Virtual Box GUI); if provided, the
|
||||||
virtual machine is started and stopped on the server as needed}
|
virtual machine is started and stopped on the server as needed}
|
||||||
|
|
||||||
@item{@racket[#:platform <symbol>] --- @racket['unix],
|
@item{@racket[#:platform _symbol] --- @racket['unix],
|
||||||
@racket['macosx], @racket['windows], or @racket['windows/bash]
|
@racket['macosx], @racket['windows], or @racket['windows/bash]
|
||||||
(which means @racket['windows] though an SSH server providing
|
(which means @racket['windows] though an SSH server providing
|
||||||
@exec{bash}, such as Cygwin's); defaults to @racket[(system-type)]}
|
@exec{bash}, such as Cygwin's); the @racket[_symbol] names
|
||||||
|
the client machine's system, not the target for cross-compilation;
|
||||||
|
defaults to @racket[(system-type)]}
|
||||||
|
|
||||||
@item{@racket[#:configure (list _string ...)] --- arguments to
|
@item{@racket[#:configure (list _string ...)] --- arguments to
|
||||||
@exec{configure}}
|
@exec{configure}}
|
||||||
|
|
||||||
|
@item{@racket[#:cross-target _string*] --- specifies a target for
|
||||||
|
cross-compilation, which adds @DFlag{host}@tt{=}@racket[_string*]
|
||||||
|
to the start of the list of @exec{configure} arguments; in
|
||||||
|
addition, if no @racket[#:racket] value is provided, a native
|
||||||
|
@exec{racket} executable for the client machine is created (by
|
||||||
|
using @exec{configure} with no arguments) and used for
|
||||||
|
cross-compilation in the same way as a @racket[#:racket] value}
|
||||||
|
|
||||||
|
@item{@racket[#:racket _string-or-false] --- an absolute path to a
|
||||||
|
native Racket executable to use for compilation, especially
|
||||||
|
cross-compilation; if the value is @racket[#f], then the Racket
|
||||||
|
executable generated for the client machine is used to prepare the
|
||||||
|
installer, or a client-native executable is generated
|
||||||
|
automatically if @racket[#:cross-target] is specified; a
|
||||||
|
non-@racket[#f] value for @racket[#:racket] is propagated to
|
||||||
|
@racket[#:configure] via @DFlag{enable-racket}}
|
||||||
|
|
||||||
@item{@racket[#:bits _integer] --- @racket[32] or @racket[64];
|
@item{@racket[#:bits _integer] --- @racket[32] or @racket[64];
|
||||||
affects Visual Studio mode}
|
affects Visual Studio mode}
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,7 @@
|
||||||
(case kw
|
(case kw
|
||||||
[(#:pkgs) (and (list? val) (andmap simple-string? val))]
|
[(#:pkgs) (and (list? val) (andmap simple-string? val))]
|
||||||
[(#:racket) (or (not val) (string? val))]
|
[(#:racket) (or (not val) (string? val))]
|
||||||
|
[(#:cross-target) (simple-string? val)]
|
||||||
[(#:doc-search) (string? val)]
|
[(#:doc-search) (string? val)]
|
||||||
[(#:dist-name) (string? val)]
|
[(#:dist-name) (string? val)]
|
||||||
[(#:dist-base) (simple-string? val)]
|
[(#:dist-base) (simple-string? val)]
|
||||||
|
@ -190,7 +191,7 @@
|
||||||
(and (string? s)
|
(and (string? s)
|
||||||
;; No spaces, quotes, or other things that could
|
;; No spaces, quotes, or other things that could
|
||||||
;; break a command-line, path, or URL construction:
|
;; break a command-line, path, or URL construction:
|
||||||
(regexp-match #rx"^[-a-zA-Z0-9.]*$" s)))
|
(regexp-match #rx"^[-a-zA-Z0-9._]*$" s)))
|
||||||
|
|
||||||
(define (email? s)
|
(define (email? s)
|
||||||
(and (string? s)
|
(and (string? s)
|
||||||
|
|
|
@ -300,6 +300,12 @@
|
||||||
(format "~a=~a" (car e) (cadr e)))))
|
(format "~a=~a" (car e) (cadr e)))))
|
||||||
(list "/bin/sh" "-c" (apply ~a args))))
|
(list "/bin/sh" "-c" (apply ~a args))))
|
||||||
(define j (or (get-opt c '#:j) 1))
|
(define j (or (get-opt c '#:j) 1))
|
||||||
|
(define cross-target (get-opt c '#:cross-target))
|
||||||
|
(define given-racket (and cross-target
|
||||||
|
(get-opt c '#:racket)))
|
||||||
|
(define need-native-racket? (and cross-target
|
||||||
|
(not given-racket)))
|
||||||
|
(define built-native-racket "cross/racket/racket3m") ; relative to build directory
|
||||||
(try-until-ready c host port user server-port 'unix (sh "echo hello"))
|
(try-until-ready c host port user server-port 'unix (sh "echo hello"))
|
||||||
(ssh-script
|
(ssh-script
|
||||||
host port user
|
host port user
|
||||||
|
@ -313,11 +319,25 @@
|
||||||
(and pull?
|
(and pull?
|
||||||
(sh "cd " (q dir) " ; "
|
(sh "cd " (q dir) " ; "
|
||||||
"git pull"))
|
"git pull"))
|
||||||
|
(and need-native-racket?
|
||||||
|
(sh "cd " (q dir) " ; "
|
||||||
|
"make native-for-cross"))
|
||||||
(sh "cd " (q dir) " ; "
|
(sh "cd " (q dir) " ; "
|
||||||
"make -j " j " client"
|
"make -j " j " client"
|
||||||
(client-args c server server-port 'unix readme)
|
(client-args c server server-port 'unix readme)
|
||||||
" JOB_OPTIONS=\"-j " j "\""
|
" JOB_OPTIONS=\"-j " j "\""
|
||||||
" CONFIGURE_ARGS_qq=" (qq (get-opt c '#:configure null) 'unix))))
|
(if need-native-racket?
|
||||||
|
(~a " PLAIN_RACKET=`pwd`/racket/src/build/" built-native-racket)
|
||||||
|
"")
|
||||||
|
" CONFIGURE_ARGS_qq=" (qq (append
|
||||||
|
(if cross-target
|
||||||
|
(list (~a "--enable-racket="
|
||||||
|
(or given-racket
|
||||||
|
(~a "`pwd`/" built-native-racket)))
|
||||||
|
(~a "--host=" cross-target))
|
||||||
|
null)
|
||||||
|
(get-opt c '#:configure null))
|
||||||
|
'unix))))
|
||||||
|
|
||||||
(define (windows-build c platform host port user server server-port repo clean? pull? readme)
|
(define (windows-build c platform host port user server server-port repo clean? pull? readme)
|
||||||
(define dir (get-path-opt c '#:dir "build\\plt" #:localhost (current-directory)))
|
(define dir (get-path-opt c '#:dir "build\\plt" #:localhost (current-directory)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user