diff --git a/compiler/parser/common.cpp b/compiler/parser/common.cpp index afe47719..0e5eb703 100644 --- a/compiler/parser/common.cpp +++ b/compiler/parser/common.cpp @@ -209,12 +209,12 @@ shared_ptr getImportFile(const string &argv0, const string &what, auto getStdLibPaths = [](const string &argv0) { vector paths; char abs[PATH_MAX + 1]; - if (auto c = getenv("SEQ_PATH")) { + if (auto c = getenv("CODON_PATH")) { if (realpath(c, abs)) paths.push_back(abs); } if (!argv0.empty()) - for (auto loci : {"../lib/seq/stdlib", "../stdlib", "stdlib"}) { + for (auto loci : {"../lib/codon/stdlib", "../stdlib", "stdlib"}) { strncpy(abs, executable_path(argv0.c_str()).c_str(), PATH_MAX); if (realpath(format("{}/{}", dirname(abs), loci).c_str(), abs)) paths.push_back(abs); diff --git a/compiler/sir/llvm/llvisitor.cpp b/compiler/sir/llvm/llvisitor.cpp index bd613f6b..805a1bd6 100644 --- a/compiler/sir/llvm/llvisitor.cpp +++ b/compiler/sir/llvm/llvisitor.cpp @@ -14,7 +14,7 @@ #define STR_HELPER(x) #x #define STR(x) STR_HELPER(x) #define SEQ_VERSION_STRING() \ - ("codon version " STR(SEQ_VERSION_MAJOR) "." STR(SEQ_VERSION_MINOR) "." STR( \ + ("codon version " STR(SEQ_VERSION_MAJOR) "." STR(SEQ_VERSION_MINOR) "." STR( \ SEQ_VERSION_PATCH)) extern "C" void seq_gc_add_roots(void *start, void *end); @@ -486,8 +486,8 @@ void LLVMVisitor::writeToExecutable(const std::string &filename, command.push_back("-l" + lib); } std::vector extraArgs = {"-lcodonrt", "-lomp", "-lpthread", "-ldl", - "-lz", "-lm", "-lc", "-o", - filename, objFile}; + "-lz", "-lm", "-lc", "-o", + filename, objFile}; for (const auto &arg : extraArgs) { command.push_back(arg); } diff --git a/runtime/lib.cpp b/runtime/lib.cpp index 673f01e5..20b3caff 100644 --- a/runtime/lib.cpp +++ b/runtime/lib.cpp @@ -57,6 +57,14 @@ SEQ_FUNC void seq_init(int d) { debug = d; } +SEQ_FUNC bool seq_is_macos() { +#ifdef __APPLE__ + return true; +#else + return false; +#endif +} + SEQ_FUNC seq_int_t seq_pid() { return (seq_int_t)getpid(); } SEQ_FUNC seq_int_t seq_time() {