@@ -242,6 +242,7 @@ infrequent (grammar-only changes). It is different from the version of
242
242
(pcase system-type
243
243
('darwin " macos" )
244
244
('gnu/linux " linux" )
245
+ ('berkeley-unix " freebsd" )
245
246
('windows-nt " windows" )
246
247
(_ (error " Unsupported system-type %s " system-type))))
247
248
@@ -272,6 +273,7 @@ If VERSION and OS are not spcified, use the defaults of
272
273
(pcase os
273
274
(" windows" " x86_64-pc-windows-msvc" )
274
275
(" linux" " x86_64-unknown-linux-gnu" )
276
+ (" freebsd" " x86_64-unknown-freebsd" )
275
277
(" macos" (if (string-prefix-p " aarch64" system-configuration)
276
278
" aarch64-apple-darwin"
277
279
" x86_64-apple-darwin" )))
@@ -376,6 +378,26 @@ from the current state of the grammar repo, without cleanup."
376
378
" src/parser.c"
377
379
" -o" (format " %s bin/%s .so" tree-sitter-langs-grammar-dir lang-symbol)
378
380
" -target" target))))
381
+ ((memq system-type '(berkeley-unix))
382
+ (cond
383
+ ((file-exists-p " src/scanner.cc" )
384
+ (tree-sitter-langs--call
385
+ " c++" " -shared" " -fPIC" " -fno-exceptions" " -g" " -O2"
386
+ " -I" " src"
387
+ " src/scanner.cc" " -xc" " src/parser.c"
388
+ " -o" (format " %s bin/%s .so" tree-sitter-langs-grammar-dir lang-symbol)))
389
+ ((file-exists-p " src/scanner.c" )
390
+ (tree-sitter-langs--call
391
+ " cc" " -shared" " -fPIC" " -g" " -O2"
392
+ " -I" " src"
393
+ " src/scanner.c" " src/parser.c"
394
+ " -o" (format " %s bin/%s .so" tree-sitter-langs-grammar-dir lang-symbol)))
395
+ (:default
396
+ (tree-sitter-langs--call
397
+ " cc" " -shared" " -fPIC" " -g" " -O2"
398
+ " -I" " src"
399
+ " src/parser.c"
400
+ " -o" (format " %s bin/%s .so" tree-sitter-langs-grammar-dir lang-symbol)))))
379
401
(:default (tree-sitter-langs--call " tree-sitter" " test" )))))
380
402
; ; Replace underscores with hyphens. Example: c_sharp.
381
403
(let ((default-directory bin-dir))
0 commit comments