# 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
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")
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")
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