Skip to content

Commit

Permalink
build: Allow building on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
ubolonton committed Apr 30, 2024
1 parent 36d3917 commit e67aae9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bin/env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -euo pipefail
system=$(uname)
if [[ $system == "Linux" ]]; then
ext="so"
elif [[ $system == "FreeBSD" ]]; then
ext="so"
elif [[ $system == "Darwin" ]]; then
ext="dylib"
else
Expand Down
4 changes: 2 additions & 2 deletions core/tsc-dyn-get.el
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ this to nil."
(pcase system-type
('windows-nt "dll")
('darwin "dylib")
((or 'gnu 'gnu/linux 'gnu/kfreebsd) "so")
((or 'gnu 'gnu/linux 'gnu/kfreebsd 'berkeley-unix) "so")
((or 'ms-dos 'cygwin) (error "Unsupported system-type %s" system-type))
(_ "so")))

Expand All @@ -82,7 +82,7 @@ this to nil."

;;; TODO: Make this correct.
(defun tsc-dyn-get--system-specific-file ()
"Return the dynamic module filename, which is system-dependent."
"Return the pre-built dynamic module filename, which is system-dependent."
(pcase system-type
('windows-nt "tsc-dyn.x86_64-pc-windows-msvc.dll")
('darwin (if (string-prefix-p "x86_64" system-configuration)
Expand Down
1 change: 1 addition & 0 deletions lisp/tree-sitter-load.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ See `tree-sitter-require'.")
(pcase system-type
;; The CLI tool outputs `.so', but `.dylib' is more sensible on macOS.
('darwin (list ".dylib" ".so"))
('berkeley-unix (list ".so"))
('gnu/linux (list ".so"))
('android (list ".so"))
('windows-nt (list ".dll"))
Expand Down

0 comments on commit e67aae9

Please sign in to comment.