configure: add --enable-embedfw for Mac OS

Building with `--enable-embedfw` creates executables that link
statically to the Racket runtime system, instead of linking to a
Racket framework, and that embed boot files in the case of Racket CS.

Executables built this way are meant to cooperate better with code
signing.

Related to #2910
This commit is contained in:
Matthew Flatt 2019-11-27 12:35:34 -07:00
parent 85459e5fef
commit 2f4e4c5e6a
17 changed files with 213 additions and 64 deletions

View File

@ -109,12 +109,19 @@
;; Copy libs into place
(install-libs lib-dir types
#:extras-only? (not executables?)
#:no-dlls? (and (eq? 'windows (cross-system-type))
executables?
;; If all executables have "<system>" the the
;; DLL dir, then no base DLLS are needed
(for/and ([f (in-list orig-binaries)])
(current-no-dlls? f))))
#:no-dlls? (and executables?
(case (cross-system-type)
[(windows)
;; If all executables have "<system>" the the
;; DLL dir, then no base DLLS are needed
(for/and ([f (in-list orig-binaries)])
(current-no-dlls? f))]
[(macosx)
;; If no executable refers to a "Racket"
;; framework, then they must embed it
(for/and ([f (in-list orig-binaries)])
(not (get-current-framework-path (app-to-file f) "Racket")))]
[else #f])))
;; Copy collections into place
(unless (null? copy-collects) (make-directory* collects-dir))
(for-each (lambda (dir)
@ -179,7 +186,7 @@
(build-path lib-dir name)))])
(map copy-dll (get-racket-dlls types #:extras-only? extras-only?))))]
[(macosx)
(unless extras-only?
(unless (or extras-only? no-dlls?)
(when (or (memq 'racketcgc types)
(memq 'gracketcgc types))
(copy-framework "Racket" 'cgc lib-dir))
@ -686,6 +693,7 @@
(define (app-to-file b)
(if (and (eq? 'macosx (cross-system-type))
(directory-exists? b)
(regexp-match #rx#"[.][aA][pP][pP]$"
(path->bytes (if (string? b)
(string->path b)

View File

@ -1537,7 +1537,8 @@
(raise x))])
(define old-perms (ensure-writable dest-exe))
(when (and (eq? 'macosx (cross-system-type))
(not unix-starter?))
(not unix-starter?)
(get-current-framework-path (mac-dest->executable dest mred?) "Racket"))
(let ([m (or (assq 'framework-root aux)
(and relative? '(framework-root . #f)))])
(if m

View File

@ -5,9 +5,6 @@ src="../racket/configure.ac"
tgt="../cfg-racket"
if [ ! -e "$src" ]; then echo "abort: did not find $src"; exit 1; fi
echo "Creating $tgt from $src"
if [ -e "$tgt" ]; then
/bin/echo -n "overwriting $tgt, Ctrl-C to abort, enter to continue "; read R;
fi
autoconf "$src" | racket "$0" > "$tgt"
chmod +x "$tgt"
src="../rktio/configure.ac"

View File

@ -23,3 +23,12 @@ else
;;
esac
fi
MACLIBRKT_LINK_MODE=fw
if test "${enable_embedfw}" = "yes" ; then
MACLIBRKT_LINK_MODE=static
fi
AC_SUBST(MACLIBRKT_LINK_MODE)

View File

@ -8,4 +8,5 @@ AC_ARG_ENABLE(xonx, [ --enable-xonx use Unix style (e.g., use Gtk)
AC_ARG_ENABLE(macprefix, [ --enable-macprefix allow --prefix with a Mac OS install])
AC_ARG_ENABLE(libfw, [ --enable-libfw install Mac OS frameworks to /Library/Frameworks])
AC_ARG_ENABLE(userfw, [ --enable-userfw install Mac OS frameworks to ~/Library/Frameworks])
AC_ARG_ENABLE(embedfw, [ --enable-embedfw embed Mac OS framework content in executables])
AC_ARG_ENABLE(mac64, [ --enable-mac64 allow 64-bit Mac OS build (enabled by default)], , enable_mac64=yes)

View File

@ -616,6 +616,7 @@ appsdir
collectsdir
MAKE_INSTALL_PKGSCOPE
INSTALL_PKGSCOPE
MACLIBRKT_LINK_MODE
target_os
target_vendor
target_cpu
@ -679,6 +680,7 @@ enable_xonx
enable_macprefix
enable_libfw
enable_userfw
enable_embedfw
enable_mac64
'
ac_precious_vars='build_alias
@ -1302,6 +1304,7 @@ Optional Features:
--enable-macprefix allow --prefix with a Mac OS install
--enable-libfw install Mac OS frameworks to /Library/Frameworks
--enable-userfw install Mac OS frameworks to ~/Library/Frameworks
--enable-embedfw embed Mac OS framework content in executables
--enable-mac64 allow 64-bit Mac OS build (enabled by default)
Report bugs to the package provider.
@ -1957,6 +1960,11 @@ if test "${enable_userfw+set}" = set; then :
enableval=$enable_userfw;
fi
# Check whether --enable-embedfw was given.
if test "${enable_embedfw+set}" = set; then :
enableval=$enable_embedfw;
fi
# Check whether --enable-mac64 was given.
if test "${enable_mac64+set}" = set; then :
enableval=$enable_mac64;
@ -1993,6 +2001,15 @@ else
fi
MACLIBRKT_LINK_MODE=fw
if test "${enable_embedfw}" = "yes" ; then
MACLIBRKT_LINK_MODE=static
fi
INSTALL_PKGSCOPE=user
MAKE_INSTALL_PKGSCOPE=preserve
if test "${enable_pkgscope}" != "" ; then

View File

@ -747,6 +747,7 @@ libpltdir_rel
libpltdir
appsdir
collectsdir
MACLIBRKT_LINK_MODE
target_os
target_vendor
target_cpu
@ -825,6 +826,7 @@ enable_xonx
enable_macprefix
enable_libfw
enable_userfw
enable_embedfw
enable_mac64
enable_csdefault
enable_cgcdefault
@ -1487,6 +1489,7 @@ Optional Features:
--enable-macprefix allow --prefix with a Mac OS install
--enable-libfw install Mac OS frameworks to /Library/Frameworks
--enable-userfw install Mac OS frameworks to ~/Library/Frameworks
--enable-embedfw embed Mac OS framework content in executables
--enable-mac64 allow 64-bit Mac OS build (enabled by default)
--enable-csdefault use CS as default build
--enable-cgcdefault use CGC as default build (NOT RECOMMENDED)
@ -2787,6 +2790,11 @@ if test "${enable_userfw+set}" = set; then :
enableval=$enable_userfw;
fi
# Check whether --enable-embedfw was given.
if test "${enable_embedfw+set}" = set; then :
enableval=$enable_embedfw;
fi
# Check whether --enable-mac64 was given.
if test "${enable_mac64+set}" = set; then :
enableval=$enable_mac64;
@ -2985,6 +2993,15 @@ else
fi
MACLIBRKT_LINK_MODE=fw
if test "${enable_embedfw}" = "yes" ; then
MACLIBRKT_LINK_MODE=static
fi
if test "${enable_iconv}" = "" ; then
enable_iconv=yes
fi

View File

@ -31,6 +31,8 @@ RACKET = @RACKET@
CS_INSTALLED = @CS_INSTALLED@
NOOP = :
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
@ -240,8 +242,13 @@ RKTFWDIR = Racket.framework/Versions/$(FWVERSION)_CS
RKTFW = $(RKTFWDIR)/Racket
GRAPPSKEL = GRacketCS.app/Contents/Info.plist
# Depending on MACLIBRKT_LINK_MODE, use Framework or statically link the framework's code:
MACLIBRKT_LINK_fw = -F. -framework Racket $(LDFLAGS)
MACLIBRKT_LINK_static = $(BOOT_OBJS) $(LDFLAGS) $(LIBS)
racketcs@OSX@: main.o $(RKTFW)
$(CC) $(CFLAGS) -o racketcs main.o -F. -framework Racket $(LDFLAGS)
$(CC) $(CFLAGS) -o racketcs main.o $(MACLIBRKT_LINK_@MACLIBRKT_LINK_MODE@)
$(MAKE) mac-embed-boot-@MACLIBRKT_LINK_MODE@ EMBED_DEST=racketcs
/usr/bin/install_name_tool -change "Racket.framework/Versions/$(FWVERSION)_CS/Racket" "@executable_path/Racket.framework/Versions/$(FWVERSION)_CS/Racket" racketcs
GRACKET_BIN = GRacketCS.app/Contents/MacOS/GRacketCS
@ -250,7 +257,8 @@ gracketcs@OSX@:
$(MAKE) $(GRACKET_BIN)
$(GRACKET_BIN): grmain.o $(RKTFW) $(GRAPPSKEL)
$(CC) $(CFLAGS) -o $(GRACKET_BIN) grmain.o -F. -framework Racket $(LDFLAGS)
$(CC) $(CFLAGS) -o $(GRACKET_BIN) grmain.o $(MACLIBRKT_LINK_@MACLIBRKT_LINK_MODE@)
$(MAKE) mac-embed-boot-@MACLIBRKT_LINK_MODE@ EMBED_DEST=$(GRACKET_BIN)
/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
@ -270,6 +278,12 @@ $(RKTFW): $(BOOT_OBJ_DEPS) $(BOOT_FILES)
$(SCHEME) --script $(srcdir)/to-vfasl.ss @BOOT_COMPRESS_COMP@ @TT_CROSS_MODE@ racket.boot $(FW_BOOT_DEST)/racket.boot petite scheme
$(BOOTSTRAP_RACKET) $(srcdir)/adjust-compress.rkt @BOOT_COMPRESS_COMP@ $(FW_BOOT_DEST)/petite.boot $(FW_BOOT_DEST)/scheme.boot $(FW_BOOT_DEST)/racket.boot
mac-embed-boot-fw:
$(NOOP)
mac-embed-boot-static:
$(BOOTSTRAP_RACKET) $(srcdir)/embed-boot.rkt @BOOT_COMPRESS_COMP@ "" $(EMBED_DEST) $(FW_BOOT_DEST)/petite.boot $(FW_BOOT_DEST)/scheme.boot $(FW_BOOT_DEST)/racket.boot
# ----------------------------------------
# MinGW

View File

@ -138,16 +138,14 @@ static void init_foreign()
void racket_boot(int argc, char **argv, char *exec_file, char *run_file,
char *boot_exe, long segment_offset,
char *coldir, char *configdir, /* wchar_t * */void *dlldir,
int pos1, int pos2, int pos3,
int is_embedded, int pos1, int pos2, int pos3,
int cs_compiled_subdir, int is_gui,
int wm_is_gracket_or_x11_arg_count,
char *gracket_guid_or_x11_args,
void *dll_open, void *dll_find_object, void *dll_close)
/* exe argument already stripped from argv */
{
#if !defined(RACKET_USE_FRAMEWORK) || !defined(RACKET_AS_BOOT)
int fd;
#endif
#ifdef RACKET_AS_BOOT
int skip_racket_boot = 0;
#endif
@ -173,37 +171,41 @@ void racket_boot(int argc, char **argv, char *exec_file, char *run_file,
}
#ifdef RACKET_USE_FRAMEWORK
fw_path = get_framework_path();
Sregister_boot_file(path_append(fw_path, "petite.boot"));
Sregister_boot_file(path_append(fw_path, "scheme.boot"));
if (!is_embedded) {
fw_path = get_framework_path();
Sregister_boot_file(path_append(fw_path, "petite.boot"));
Sregister_boot_file(path_append(fw_path, "scheme.boot"));
# ifdef RACKET_AS_BOOT
if (!skip_racket_boot)
Sregister_boot_file(path_append(fw_path, "racket.boot"));
# endif
#else
fd = open(boot_exe, O_RDONLY | BOOT_O_BINARY);
{
int fd1, fd2;
fd1 = dup(fd);
lseek(fd1, pos1, SEEK_SET);
Sregister_boot_file_fd("petite", fd1);
fd2 = open(boot_exe, O_RDONLY | BOOT_O_BINARY);
lseek(fd2, pos2, SEEK_SET);
Sregister_boot_file_fd("scheme", fd2);
# ifdef RACKET_AS_BOOT
if (!skip_racket_boot) {
fd = open(boot_exe, O_RDONLY | BOOT_O_BINARY);
lseek(fd, pos3, SEEK_SET);
Sregister_boot_file_fd("racket", fd);
}
if (!skip_racket_boot)
Sregister_boot_file(path_append(fw_path, "racket.boot"));
# endif
}
#endif
if (is_embedded) {
fd = open(boot_exe, O_RDONLY | BOOT_O_BINARY);
{
int fd1, fd2;
fd1 = dup(fd);
lseek(fd1, pos1, SEEK_SET);
Sregister_boot_file_fd("petite", fd1);
fd2 = open(boot_exe, O_RDONLY | BOOT_O_BINARY);
lseek(fd2, pos2, SEEK_SET);
Sregister_boot_file_fd("scheme", fd2);
# ifdef RACKET_AS_BOOT
if (!skip_racket_boot) {
fd = open(boot_exe, O_RDONLY | BOOT_O_BINARY);
lseek(fd, pos3, SEEK_SET);
Sregister_boot_file_fd("racket", fd);
}
# endif
}
}
Sbuild_heap(NULL, init_foreign);
if (cross_server) {
@ -248,8 +250,10 @@ void racket_boot(int argc, char **argv, char *exec_file, char *run_file,
#ifndef RACKET_AS_BOOT
# ifdef RACKET_USE_FRAMEWORK
fd = open(path_append(fw_path, "racket.so"), O_RDONLY);
pos3 = 0;
if (!is_embedded) {
fd = open(path_append(fw_path, "racket.so"), O_RDONLY);
pos3 = 0;
}
# endif
{

View File

@ -1,7 +1,7 @@
BOOT_EXTERN void racket_boot(int argc, char **argv, char *exec_file, char *run_file,
char *boot_exe, long segment_offset,
char *coldir, char *configdir, /* wchar_t * */void *dlldir,
int pos1, int pos2, int pos3,
int is_embedded, int pos1, int pos2, int pos3,
int cs_compiled_subdir, int is_gui,
int wm_is_gracket_or_x11_arg_count, char *gracket_guid_or_x11_args,
void *ddll_open, void *dll_find_object, void *dll_close);
@ -9,7 +9,7 @@ BOOT_EXTERN void racket_boot(int argc, char **argv, char *exec_file, char *run_f
typedef void (*racket_boot_t)(int argc, char **argv, char *exec_file, char *run_file,
char* boot_exe, long segment_offset,
char *coldir, char *configdir, /* wchar_t * */void *dlldir,
int pos1, int pos2, int pos3,
int is_embedded, int pos1, int pos2, int pos3,
int cs_compiled_subdir, int is_gui,
int wm_is_gracket_or_x11_arg_count, char *gracket_guid_or_x11_args,
void *ddll_open, void *dll_find_object, void *dll_close);

View File

@ -712,6 +712,7 @@ appsdir
collectsdir
MAKE_INSTALL_PKGSCOPE
INSTALL_PKGSCOPE
MACLIBRKT_LINK_MODE
target_os
target_vendor
target_cpu
@ -786,6 +787,7 @@ enable_xonx
enable_macprefix
enable_libfw
enable_userfw
enable_embedfw
enable_mac64
enable_noopt
enable_ubsan
@ -1434,6 +1436,7 @@ Optional Features:
--enable-macprefix allow --prefix with a Mac OS install
--enable-libfw install Mac OS frameworks to /Library/Frameworks
--enable-userfw install Mac OS frameworks to ~/Library/Frameworks
--enable-embedfw embed Mac OS framework content in executables
--enable-mac64 allow 64-bit Mac OS build (enabled by default)
--enable-strip strip debug on install (usually enabled by default)
--enable-ubsan compile with -fsanitize=undefined
@ -2632,6 +2635,11 @@ if test "${enable_userfw+set}" = set; then :
enableval=$enable_userfw;
fi
# Check whether --enable-embedfw was given.
if test "${enable_embedfw+set}" = set; then :
enableval=$enable_embedfw;
fi
# Check whether --enable-mac64 was given.
if test "${enable_mac64+set}" = set; then :
enableval=$enable_mac64;
@ -2717,6 +2725,15 @@ else
fi
MACLIBRKT_LINK_MODE=fw
if test "${enable_embedfw}" = "yes" ; then
MACLIBRKT_LINK_MODE=static
fi
show_explicitly_disabled()
{
if test "$1" = "no" ; then

View File

@ -23,11 +23,24 @@
(set! alt-dests (cons (cons src dest) alt-dests))]
#:args (src-file dest-file petite.boot scheme.boot racket.boot)
;; If `src-file` is "", then `dest-file` is used as the src, too
(define bstr1 (adjust-compress (file->bytes petite.boot)))
(define bstr2 (adjust-compress (file->bytes scheme.boot)))
(define bstr3 (adjust-compress (file->bytes racket.boot)))
(define use-src-file
(if (equal? src-file "")
(let ([src-file (path-add-suffix dest-file #"_tmp")])
(rename-file-or-directory dest-file src-file)
src-file)
src-file))
(define (clean-src)
(unless (eq? use-src-file src-file)
(delete-file use-src-file)))
(with-handlers ([exn? (lambda (x)
(clean-src)
(when (file-exists? dest-file)
(delete-file dest-file))
(raise x))])
@ -45,10 +58,12 @@
(case (or target (path->string (system-library-subpath #f)))
[("x86_64-darwin" "i386-darwin" "x86_64-macosx" "i386-macosx")
;; Mach-O
(copy-file src-file dest-file #t)
(add-plt-segment dest-file data #:name #"__RKTBOOT")]
(copy-file use-src-file dest-file #t)
(add-plt-segment dest-file data #:name #"__RKTBOOT")
;; Find segment at run time:
0]
[("ta6nt" "ti3nt" "win32\\x86_64" "win32\\i386")
(copy-file src-file dest-file #t)
(copy-file use-src-file dest-file #t)
(define-values (pe rsrcs) (call-with-input-file*
dest-file
read-pe+resources))
@ -64,7 +79,7 @@
[else
;; ELF?
(define-values (start-pos end-pos any1 any2)
(add-racket-section src-file dest-file #".rackboot"
(add-racket-section use-src-file dest-file #".rackboot"
(lambda (pos)
(values data 'any1 'any2))))
(define (ensure-executable dest-file)
@ -85,7 +100,7 @@
start-pos])]
[else
;; Not ELF; just append to the end
(copy-file src-file dest-file #t)
(copy-file use-src-file dest-file #t)
(ensure-executable dest-file)
(define pos (file-size dest-file))
(call-with-output-file*
@ -117,6 +132,6 @@
[else
(for ([alt (in-list alt-dests)])
(copy-file (car alt) (cdr alt) #t)
(write-offsets (cdr alt)))])))
(write-offsets (cdr alt)))])
(clean-src)))

View File

@ -79,6 +79,32 @@ static char *get_self_path(char *exec_file)
}
}
# undef USE_GENERIC_GET_SELF_PATH
static long find_rktboot_section(char *me)
{
const struct mach_header *mh;
const struct load_command *lc;
int i;
mh = _dyld_get_image_header(0);
lc = (void *)((char *)mh + ((mh->magic == 0xfeedfacf) ? sizeof(struct mach_header_64) : sizeof(struct mach_header)));
for (i = 0; i < mh->ncmds; i++) {
if (lc->cmd == LC_SEGMENT) {
const struct segment_command *sc = (struct segment_command *)lc;
if (!strcmp(sc->segname, "__RKTBOOT"))
return sc->fileoff;
} else if (lc->cmd == LC_SEGMENT_64) {
const struct segment_command_64 *sc = (struct segment_command_64 *)lc;
if (!strcmp(sc->segname, "__RKTBOOT"))
return sc->fileoff;
}
lc = (void *)((char *)lc + lc->cmdsize);
}
return 0;
}
#endif
#if defined(__linux__)
@ -350,7 +376,7 @@ static int bytes_main(int argc, char **argv,
int wm_is_gracket_or_x11_arg_count, char *gracket_guid_or_x11_args)
{
char *boot_exe, *exec_file = argv[0], *run_file = NULL;
int pos1, pos2, pos3;
int is_embedded = 1, pos1, pos2, pos3;
long boot_offset;
long segment_offset;
#ifdef WIN32
@ -398,6 +424,9 @@ static int bytes_main(int argc, char **argv,
#ifdef ELF_FIND_BOOT_SECTION
boot_offset = find_boot_section(boot_exe);
#elif OS_X
boot_offset = find_rktboot_section(boot_exe);
if (!boot_offset) is_embedded = 0;
#elif WIN32
boot_offset = find_resource_offset(dll_path, 259, boot_rsrc_offset);
#else
@ -411,7 +440,7 @@ static int bytes_main(int argc, char **argv,
racket_boot(argc, argv, exec_file, run_file,
boot_exe, segment_offset,
extract_coldir(), extract_configdir(), extract_dlldir(),
pos1, pos2, pos3,
is_embedded, pos1, pos2, pos3,
CS_COMPILED_SUBDIR, RACKET_IS_GUI,
wm_is_gracket_or_x11_arg_count, gracket_guid_or_x11_args,
embedded_dll_open, scheme_dll_find_object, embedded_dll_close);

View File

@ -124,8 +124,12 @@ resources@MINGW@ : gres.o
MRFW = Racket.framework/Versions/$(FWVERSION)/Racket
MRAPPSKEL = GRacket@CGC@.app/Contents/Info.plist
# Depending on MACLIBRKT_LINK_MODE, use Framework or statically link the framework's code:
MACLIBRKT_LINK_fw = -F../racket -framework Racket
MACLIBRKT_LINK_static = ../racket/libracket.@LIBSFX@ ../racket/libmzgc.@LIBSFX@ $(LIBRKTIO) $(LDLIBS)
GRacket@CGC@.app/Contents/MacOS/GRacket@CGC@: $(MZFW) $(MRAPPSKEL) grmain.@LTO@
$(GRACKETLINKER) $(GRACKETLDFLAGS) -o GRacket@CGC@.app/Contents/MacOS/GRacket@CGC@ grmain.@LTO@ -Wl,-headerpad_max_install_names -F../racket -framework Racket -framework CoreFoundation @PROFFLAGS@
$(GRACKETLINKER) $(GRACKETLDFLAGS) -o GRacket@CGC@.app/Contents/MacOS/GRacket@CGC@ grmain.@LTO@ -Wl,-headerpad_max_install_names $(MACLIBRKT_LINK_@MACLIBRKT_LINK_MODE@) -framework CoreFoundation @PROFFLAGS@
/usr/bin/install_name_tool -change "Racket.framework/Versions/$(FWVERSION)/Racket" "@executable_path/../../../../racket/Racket.framework/Versions/$(FWVERSION)/Racket" GRacket@CGC@.app/Contents/MacOS/GRacket@CGC@
$(MRAPPSKEL): $(srcdir)/../mac/osx_appl.rkt $(srcdir)/../racket/src/schvers.h $(srcdir)/../mac/icon/GRacket.icns

View File

@ -112,8 +112,12 @@ GRACKETMZOBJS_la =
MZFW = ../../racket/Racket.framework/Versions/$(FWVERSION)_3m/Racket
MRAPPSKEL = ../GRacket@MMM@.app/Contents/Info.plist
# Depending on MACLIBRKT_LINK_MODE, use Framework or statically link the framework's code:
MACLIBRKT_LINK_fw = -F../../racket/gc2 -framework Racket
MACLIBRKT_LINK_static = ../../racket/libracket3m.@LIBSFX@ $(LIBRKTIO) $(LDLIBS)
../GRacket@MMM@.app/Contents/MacOS/GRacket@MMM@: $(MRAPPSKEL) $(MZFW) grmain.@LTO@
$(GRACKETLINKER) $(LDFLAGS) -o ../GRacket@MMM@.app/Contents/MacOS/GRacket@MMM@ grmain.@LTO@ -Wl,-headerpad_max_install_names -F../../racket/gc2 -framework Racket -framework CoreFoundation
$(GRACKETLINKER) $(LDFLAGS) -o ../GRacket@MMM@.app/Contents/MacOS/GRacket@MMM@ grmain.@LTO@ -Wl,-headerpad_max_install_names $(MACLIBRKT_LINK_@MACLIBRKT_LINK_MODE@) -framework CoreFoundation
/usr/bin/install_name_tool -change "Racket.framework/Versions/$(FWVERSION)_3m/Racket" "@executable_path/../../../../racket/Racket.framework/Versions/$(FWVERSION)_3m/Racket" "../GRacket@MMM@.app/Contents/MacOS/GRacket@MMM@"
$(MRFW) : $(XOBJS) $(@WXVARIANT@_PLAIN_OBJS) ../../racket/libracket3m.@LIBSFX@ wx_font.o wx_file_dialog.o $(MRFWRES)

View File

@ -212,14 +212,20 @@ mzcom@CGC@@NOT_MINGW@:
MZFW = Racket.framework/Versions/$(FWVERSION)/Racket
MACLIBRKT_LIBS = $(SPECIALIZINGOBJECTS) libracket.@LIBSFX@ libmzgc.@LIBSFX@ $(LIBRKTIO) -framework CoreFoundation
$(MZFW): libracket.@LIBSFX@ libmzgc.@LIBSFX@ $(SPECIALIZINGOBJECTS) $(LIBRKTIO)
mkdir -p Racket.framework/Versions/$(FWVERSION)
@MZLINKER@ -o $(MZFW) @LDFLAGS@ -framework CoreFoundation -dynamiclib -all_load $(SPECIALIZINGOBJECTS) libracket.@LIBSFX@ libmzgc.@LIBSFX@ $(LIBRKTIO) @LIBS@
@MZLINKER@ -o $(MZFW) @LDFLAGS@ -dynamiclib -all_load $(MACLIBRKT_LIBS) @LIBS@
rm -f Racket.framework/Racket
ln -s Versions/$(FWVERSION)/Racket Racket.framework/Racket
# Depending on MACLIBRKT_LINK_MODE, use Framework or statically link the framework's code:
MACLIBRKT_LINK_fw = -F. -framework Racket
MACLIBRKT_LINK_static = $(MACLIBRKT_LIBS)
racket@CGC@@OSX@: $(MZFW) main.@LTO@
@MZLINKER@ -o racket@CGC@ @PROFFLAGS@ @LDFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names -F. -framework Racket @LIBS@
@MZLINKER@ -o racket@CGC@ @PROFFLAGS@ @LDFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names $(MACLIBRKT_LINK_@MACLIBRKT_LINK_MODE@) @LIBS@
/usr/bin/install_name_tool -change "Racket.framework/Versions/$(FWVERSION)/Racket" "@executable_path/Racket.framework/Versions/$(FWVERSION)/Racket" "racket@CGC@"
# mingw ----------------------------------------

View File

@ -600,16 +600,22 @@ EXTRA_OBJS_L = $(EXTRA_GMP) ../src/unwind.@LTO@ $(@FOREIGN_IF_USED@_OBJSLIB) $(L
MZFWMMM = Racket.framework/Versions/$(FWVERSION)_3m/Racket
MACLIBRKT_LIBS = ../libracket3m.@LIBSFX@ $(LIBRKTIO) -framework CoreFoundation
$(MZFWMMM): ../libracket3m.@LIBSFX@ $(LIBRKTIO)
mkdir -p "Racket.framework/Versions/$(FWVERSION)_3m"
@MZLINKER@ -o $(MZFWMMM) -framework CoreFoundation -dynamiclib -all_load ../libracket3m.@LIBSFX@ $(LIBRKTIO) @LDFLAGS@ $(LIBS)
@MZLINKER@ -o $(MZFWMMM) -dynamiclib -all_load $(MACLIBRKT_LIBS) @LDFLAGS@ $(LIBS)
rm -f Racket.framework/Racket
ln -s Versions/$(FWVERSION)_3m/Racket Racket.framework/Racket
../racket@MMM@@OSX@: $(MZFWMMM) main.@LTO@
@MZLINKER@ -o ../racket@MMM@ @PROFFLAGS@ @LDFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names -F. -framework Racket @LIBS@
mkdir -p "../Racket.framework/Versions/$(FWVERSION)_3m"
cp "Racket.framework/Versions/$(FWVERSION)_3m/Racket" "../Racket.framework/Versions/$(FWVERSION)_3m/Racket"
# Depending on MACLIBRKT_LINK_MODE, use Framework or statically link the framework's code:
MACLIBRKT_LINK_fw = -F. -framework Racket
MACLIBRKT_LINK_static = $(MACLIBRKT_LIBS)
../racket@MMM@@OSX@: $(MZFWMMM) main.@LTO@
@MZLINKER@ -o ../racket@MMM@ @PROFFLAGS@ @LDFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names $(MACLIBRKT_LINK_@MACLIBRKT_LINK_MODE@) @LIBS@
/usr/bin/install_name_tool -change "Racket.framework/Versions/$(FWVERSION)_3m/Racket" "@executable_path/Racket.framework/Versions/$(FWVERSION)_3m/Racket" "../racket@MMM@"
../lib/libracket3mxxxxxxx.dll: ../libracket3m.@LIBSFX@ ../mzsj86g.o $(LIBRKTIO)