aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2025-04-04 22:46:44 -0500
committerCalvin Rose <calsrose@gmail.com>2025-04-04 22:46:44 -0500
commite5f24ad41c3a28787fd65edbba75c2aa15aeff32 (patch)
tree69b7e7c2f58dc4a90ddd0d4d192da9b5b05b69ad
parentAdd a flush to output. (diff)
Disable static compilation on macos.mac-debug
Static compilation will not work without extra effort on macos due to missing static builds of various core libraries.
-rw-r--r--spork/cc.janet2
-rw-r--r--spork/declare-cc.janet11
2 files changed, 10 insertions, 3 deletions
diff --git a/spork/cc.janet b/spork/cc.janet
index 365b943..0d9c138 100644
--- a/spork/cc.janet
+++ b/spork/cc.janet
@@ -199,7 +199,7 @@
(def sp (dyn *syspath* "."))
(def ip (include-path))
[(string "-I" sp)
- ;(if (dyn :verbose) ["-v"] [])
+ # ;(if (dyn :verbose) ["-v"] []) # err, too verbose
;(if (and ip (not= ip sp)) [(string "-I" ip)] [])])
(defn- extra-link-paths []
(def sp (dyn *syspath* "."))
diff --git a/spork/declare-cc.janet b/spork/declare-cc.janet
index 9fe2867..26ca82d 100644
--- a/spork/declare-cc.janet
+++ b/spork/declare-cc.janet
@@ -789,6 +789,14 @@ int main(int argc, const char **argv) {
(array/push other-cflags (string "-I" headerpath))
(array/push dep-libs libjanet)))
+ # Static compilation will not work out of the box on mac, so disable with warning.
+ (def static
+ (if (and (= (os/which) :macos) static)
+ (do
+ (eprint "Warning! fully static executable disabled on macos.")
+ false)
+ static))
+
(def benv @{cc/*build-dir* bd
cc/*defines* defines
cc/*libs* libs
@@ -821,8 +829,7 @@ int main(int argc, const char **argv) {
(if has-cpp cc/link-executable-c++ cc/link-executable-c)))
(unless no-compile
(with-env benv
- (unless static
- (cc/search-libraries "m" "rt" "dl"))
+ (cc/search-libraries "m" "rt" "dl")
(flush)
(compile-c cimage-dest oimage-dest)
(flush)