rename 'package' to 'module'
[nit.git] / src / compiling / compiling_base.nit
index e6f7f9a..64289d4 100644 (file)
 # limitations under the License.
 
 # Common things for NIT compilation and C generation
-package compiling_base
+module compiling_base
 
 import mmloader
 private import utils
-import primitive_info
+private import primitive_info
 import program
 import compiling_writer
 
@@ -93,6 +93,10 @@ class CProgram
                        verbose = "-vv"
                end
 
+               # include compdir to find frontier files (._nitni.h) from native
+               # implementations as .nit.h must have an import of <{name}._nitni.h>
+               include_dirs.add( "-I {compdir}" )
+
                f.write("#!/bin/sh\n")
                f.write("# This shell script is generated by NIT to compile the program {program.main_module.full_name}.\n")
                f.write("CLIBDIR=\"{tc.clibdir.as(not null)}\"\n")
@@ -106,7 +110,7 @@ class CProgram
                end
                if tc.boost then f.write(" -O")
                if not tc.cc_link then f.write(" -x \"-c\"")
-               for l in tc.cc_libs do f.write(" -x \"-l {l}\"")
+               for l in tc.cc_libs do f.write(" -l {l}")
                for lp in tc.cc_lib_paths do f.write(" -x \"-L {lp}\"")
                for ip in tc.cc_include_paths do f.write(" -x \"-I {ip}\"")
                f.write(" \"$@\" \\\n  {files.join("\\\n  ")}\n")
@@ -246,6 +250,18 @@ redef class MMGlobalProperty
        do
                return "ATTR_{intro.cname}"
        end
+
+       # C symbol refering a virtual type class color
+       fun vt_class_color: String
+       do
+               return "VTCOLOR_{intro.cname}"
+       end
+
+       # C symbol refering a virtual type class id
+       fun vt_class_id: String
+       do
+               return "VTID_{intro.cname}"
+       end
 end
 
 redef class MMGlobalClass