mirror of
https://github.com/janet-lang/janet
synced 2025-01-24 22:26:52 +00:00
Add more values for (os/which)
Some bsd flavors.
This commit is contained in:
parent
b0b1024f8a
commit
3c133bd677
@ -296,11 +296,12 @@
|
||||
(def lflags [;(opt opts :lflags default-lflags)
|
||||
;(if (opts :static) [] dynamic-lflags)
|
||||
;(if standalone (case (os/which)
|
||||
:posix ["-ldl" "-lm"]
|
||||
:macos ["-ldl" "-lm"]
|
||||
:windows []
|
||||
:linux ["-lm" "-ldl" "-lrt"]
|
||||
[]) [])])
|
||||
:openbsd ["-lm"]
|
||||
#default
|
||||
["-ldl" "-lm"]) [])])
|
||||
(rule target objects
|
||||
(print "linking " target "...")
|
||||
(if is-win
|
||||
|
@ -75,6 +75,12 @@ static Janet os_which(int32_t argc, Janet *argv) {
|
||||
return janet_ckeywordv("web");
|
||||
#elif defined(__linux__)
|
||||
return janet_ckeywordv("linux");
|
||||
#elif define(__FreeBSD__)
|
||||
return janet_ckeywordv("freebsd");
|
||||
#elif define(__NetBSD__)
|
||||
return janet_ckeywordv("netbsd");
|
||||
#elif define(__OpenBSD__)
|
||||
return janet_ckeywordv("openbsd");
|
||||
#else
|
||||
return janet_ckeywordv("posix");
|
||||
#endif
|
||||
@ -763,10 +769,13 @@ static const JanetReg os_cfuns[] = {
|
||||
"os/which", os_which,
|
||||
JDOC("(os/which)\n\n"
|
||||
"Check the current operating system. Returns one of:\n\n"
|
||||
"\t:windows - Microsoft Windows\n"
|
||||
"\t:macos - Apple macos\n"
|
||||
"\t:windows\n"
|
||||
"\t:macos\n"
|
||||
"\t:web - Web assembly (emscripten)\n"
|
||||
"\t:linux - Linux\n"
|
||||
"\t:linux\n"
|
||||
"\t:freebsd\n"
|
||||
"\t:openbsd\n"
|
||||
"\t:netbsd\n"
|
||||
"\t:posix - A POSIX compatible system (default)")
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user