diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac index b70e321e04..56ffbcb82a 100644 --- a/racket/src/cs/c/configure.ac +++ b/racket/src/cs/c/configure.ac @@ -679,6 +679,8 @@ if test "${enable_shared}" = "yes" ; then STRIP_LIB_DEBUG=":" LIBSFX=la ICP_LIB="${LIBTOOLPROG} --mode=install install -s" + + CONFIGURE_RACKET_SO_COMPILE="env PLT_CS_MAKE_LINK_SHARED=y" else ICP=cp LTO="o" diff --git a/racket/src/cs/c/gen-system.rkt b/racket/src/cs/c/gen-system.rkt index 24d9dece77..dcfd24891d 100644 --- a/racket/src/cs/c/gen-system.rkt +++ b/racket/src/cs/c/gen-system.rkt @@ -46,7 +46,7 @@ (system-type 'word)) 'gc 'cs 'vm 'chez-scheme - 'link 'static + 'link (if windows? 'windows (system-type 'link)) 'machine lib-subpath 'library-subpath (string->bytes/utf-8 lib-subpath) 'library-subpath-convention (if windows? 'windows 'unix) diff --git a/racket/src/cs/rumble/system.ss b/racket/src/cs/rumble/system.ss index 7b9aaefab2..08efcbb124 100644 --- a/racket/src/cs/rumble/system.ss +++ b/racket/src/cs/rumble/system.ss @@ -11,6 +11,11 @@ [(getenv "PLT_CS_MAKE_UNIX_STYLE_MACOS") #t] [else #f])) +(define unix-link-shared? + (meta-cond + [(getenv "PLT_CS_MAKE_LINK_SHARED") #t] + [else #f])) + (define cross-mode 'infer) (define (set-cross-mode! m) (set! cross-mode m)) @@ -27,7 +32,13 @@ [else 'unix])] [(word) (if (> (fixnum-width) 32) 64 32)] [(gc) 'cs] - [(link) 'framework] + [(link) (case (and (not unix-style-macos?) + (machine-type)) + [(a6osx ta6osx i3osx ti3osx) 'framework] + [(a6nt ta6nt i3nt ti3nt) 'windows] + [else (if unix-link-shared? + 'shared + 'static)])] [(machine) (get-machine-info)] [(so-suffix) (case (machine-type) [(a6osx ta6osx i3osx ti3osx) (string->utf8 ".dylib")]