Skip to content

Commit

Permalink
Merge pull request #192 from pyrmont/bugfix.macos-compiler
Browse files Browse the repository at this point in the history
Fix compilation on macOS
  • Loading branch information
bakpakin committed Aug 9, 2024
2 parents 70f1a47 + 42f6fdd commit e13e82a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions spork/cc.janet
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,26 @@
(defn- rpath
[]
(if (dyn *use-rpath* true)
[(string "-Wl,-rpath=" (lib-path))
(string "-Wl,-rpath=" (dyn *syspath* "."))]
[(string "-Wl,-rpath," (lib-path))
(string "-Wl,-rpath," (dyn *syspath* "."))]
[]))
(defn- smart-libs []
(def dflt (index-of (target-os) [:linux :macos]))
(def dflt (index-of (target-os) [:linux]))
(dyn *smart-libs* dflt))
(defn- libs []
(def dl (if (= (target-os) :macos) ["-undefined" "dynamic_lookup"] []))
(def sg (if (smart-libs) ["-Wl,--start-group"] []))
(def eg (if (smart-libs) ["-Wl,--end-group"] []))
(def bs (if (not= (target-os) :macos) ["-Wl,-Bstatic"] []))
(def bd (if (not= (target-os) :macos) ["-Wl,-Bdynamic"] []))
[;(lflags)
;dl
;sg
;(default-libs)
"-Wl,-Bstatic" ;(static-libs)
"-Wl,-Bdynamic" ;(dynamic-libs)
;bs
;(static-libs)
;bd
;(dynamic-libs)
;eg
;(rpath)])
(defn- rdynamic
Expand Down

0 comments on commit e13e82a

Please sign in to comment.