lib&src: remove detected warnings
[nit.git] / src / nitc.nit
index 9818765..2b581d0 100644 (file)
@@ -20,9 +20,10 @@ package nitc
 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
@@ -31,9 +32,6 @@ 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")
@@ -75,7 +73,7 @@ class NitCompiler
                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
@@ -83,11 +81,12 @@ class NitCompiler
                        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
@@ -98,11 +97,12 @@ class NitCompiler
                                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
@@ -113,6 +113,7 @@ class NitCompiler
                                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)