Skip to content

Commit e5f24ad

Browse files
committed
Disable static compilation on macos.
Static compilation will not work without extra effort on macos due to missing static builds of various core libraries.
1 parent 241b52b commit e5f24ad

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

spork/cc.janet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
(def sp (dyn *syspath* "."))
200200
(def ip (include-path))
201201
[(string "-I" sp)
202-
;(if (dyn :verbose) ["-v"] [])
202+
# ;(if (dyn :verbose) ["-v"] []) # err, too verbose
203203
;(if (and ip (not= ip sp)) [(string "-I" ip)] [])])
204204
(defn- extra-link-paths []
205205
(def sp (dyn *syspath* "."))

spork/declare-cc.janet

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,14 @@ int main(int argc, const char **argv) {
789789
(array/push other-cflags (string "-I" headerpath))
790790
(array/push dep-libs libjanet)))
791791

792+
# Static compilation will not work out of the box on mac, so disable with warning.
793+
(def static
794+
(if (and (= (os/which) :macos) static)
795+
(do
796+
(eprint "Warning! fully static executable disabled on macos.")
797+
false)
798+
static))
799+
792800
(def benv @{cc/*build-dir* bd
793801
cc/*defines* defines
794802
cc/*libs* libs
@@ -821,8 +829,7 @@ int main(int argc, const char **argv) {
821829
(if has-cpp cc/link-executable-c++ cc/link-executable-c)))
822830
(unless no-compile
823831
(with-env benv
824-
(unless static
825-
(cc/search-libraries "m" "rt" "dl"))
832+
(cc/search-libraries "m" "rt" "dl")
826833
(flush)
827834
(compile-c cimage-dest oimage-dest)
828835
(flush)

0 commit comments

Comments
 (0)