import abstracttool
import analysis
import program
-private import compiling
-private import syntax
+import compiling
+import syntax
import native_interface
+import separate_options
# The main class of the nitcompiler program
class NitCompiler
readable var _opt_boost: OptionBool = new OptionBool("Optimize compilation", "-O", "--boost")
readable var _opt_no_cc: OptionBool = new OptionBool("Do not invoke C compiler", "--no-cc")
readable var _opt_cc_no_link: OptionBool = new OptionBool("Do not invoke C linker", "--cc-no-link")
- readable var _opt_cc_lib_paths: OptionArray = new OptionArray("Path to libraries for C compiler", "--cc-lib-path")
- readable var _opt_cc_libs: OptionArray = new OptionArray("Name of library to use for C compiler", "--cc-lib-name")
- readable var _opt_cc_include_paths: OptionArray = new OptionArray("Path to .h files for C compiler", "--cc-header-path")
readable var _opt_global: OptionBool = new OptionBool("Use global compilation", "--global")
readable var _opt_global_no_STF_opt: OptionBool = new OptionBool("Do not use SFT optimization", "--no-global-SFT-optimization")
readable var _opt_global_no_DMR_opt: OptionBool = new OptionBool("Do not use dead method removal optimization", "--no-global-DMR-optimization")
compdir = opt_compdir.value
if compdir == null then
var dir = once ("NIT_COMPDIR".to_symbol).environ
- if not dir.is_empty then
+ if not dir.is_empty then
compdir = dir
end
if compdir == null then
end
end
compdir += ext_prefix
+ compdir = compdir.simplify_path
clibdir = opt_clibdir.value
if clibdir == null then
var dir = once ("NIT_DIR".to_symbol).environ
- if dir.is_empty then
+ if dir.is_empty then
dir = "{sys.program_name.dirname}/../clib"
if dir.file_exists then clibdir = dir
else
fatal_error(null, "Error: Cannot locate NIT C library directory. Uses --clibdir or envvar NIT_DIR.")
end
end
- bindir = opt_bindir.value
+ clibdir = clibdir.simplify_path
+ bindir = opt_bindir.value
if bindir == null then
var dir = once ("NIT_DIR".to_symbol).environ
- if dir.is_empty then
+ if dir.is_empty then
dir = "{sys.program_name.dirname}/../bin"
if dir.file_exists then bindir = dir
else
fatal_error(null, "Error: Cannot locate NIT tools directory. Uses --bindir or envvar NIT_DIR.")
end
end
+ bindir = bindir.simplify_path
end
redef fun perform_work(mods)