From 97eaa98e4444909e130cab3caa40dea4c9ad0b84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 24 Jan 2015 09:17:45 -0500 Subject: [PATCH] nitc: rename `c_compiler_option` and cie to `cflags` and `ldflags` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- src/compiler/compiler_ffi.nit | 4 ++-- src/ffi/c.nit | 4 ++-- src/ffi/c_compiler_options.nit | 16 ++++++++-------- src/ffi/cpp.nit | 6 +++--- src/ffi/ffi.nit | 2 +- src/ffi/java.nit | 4 ++-- src/ffi/objc.nit | 2 +- src/frontend/check_annotation.nit | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/compiler_ffi.nit b/src/compiler/compiler_ffi.nit index 8466af1..ac7bad3 100644 --- a/src/compiler/compiler_ffi.nit +++ b/src/compiler/compiler_ffi.nit @@ -52,7 +52,7 @@ extern void nitni_global_ref_decr(void*); nitni_ccu.write_as_nitni(self, v.compiler.modelbuilder.compile_dir) for file in nitni_ccu.files do - var f = new ExternCFile(file, c_compiler_options) + var f = new ExternCFile(file, cflags) f.pkgconfigs.add_all pkgconfigs v.compiler.extern_bodies.add(f) end @@ -76,7 +76,7 @@ extern void nitni_global_ref_decr(void*); redef fun collect_linker_libs do - var s = c_linker_options + var s = ldflags if s.is_empty then return null var res = new ArraySet[String] res.add s diff --git a/src/ffi/c.nit b/src/ffi/c.nit index 8ae08b9..ebd2277 100644 --- a/src/ffi/c.nit +++ b/src/ffi/c.nit @@ -72,8 +72,8 @@ redef class Location end redef class MModule - var c_compiler_options = "" is writable - var c_linker_options = "" is writable + var cflags = "" is writable + var ldflags = "" is writable # Additional libraries needed for the compilation # Will be used with pkg-config diff --git a/src/ffi/c_compiler_options.nit b/src/ffi/c_compiler_options.nit index af4e938..e4756a8 100644 --- a/src/ffi/c_compiler_options.nit +++ b/src/ffi/c_compiler_options.nit @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Offers the annotations `c_compiler_option` and `c_linker_option` to specify +# Offers the annotations `cflags` and `ldflags` to specify # options for the C compiler directly or indirectly. Differs from the `pkgconfig` # annotation by the separation of the options between the compiler and linker. module c_compiler_options @@ -24,15 +24,15 @@ import cpp private import annotation redef class ToolContext - var c_compiler_options_phase: Phase = new CCompilerOptionsPhase(self, null) + var cflags_phase: Phase = new CCompilerOptionsPhase(self, null) end private class CCompilerOptionsPhase super Phase - fun compiler_annotation_name: String do return "c_compiler_option" - fun linker_annotation_name: String do return "c_linker_option" - fun cpp_compiler_annotation_name: String do return "cpp_compiler_option" + fun compiler_annotation_name: String do return "cflags" + fun linker_annotation_name: String do return "ldflags" + fun cpp_compiler_annotation_name: String do return "cppflags" redef fun process_annotated_node(nmoduledecl, nat) do @@ -145,17 +145,17 @@ private class CCompilerOptionsPhase fun process_c_compiler_annotation(mmodule: MModule, opt: String) do - mmodule.c_compiler_options = "{mmodule.c_compiler_options} {opt}" + mmodule.cflags = "{mmodule.cflags} {opt}" end fun process_c_linker_annotation(mmodule: MModule, opt: String) do - mmodule.c_linker_options = "{mmodule.c_linker_options} {opt}" + mmodule.ldflags = "{mmodule.ldflags} {opt}" end fun process_cpp_compiler_annotation(mmodule: MModule, opt: String) do - mmodule.cpp_compiler_options = "{mmodule.cpp_compiler_options} {opt}" + mmodule.cppflags = "{mmodule.cppflags} {opt}" end end diff --git a/src/ffi/cpp.nit b/src/ffi/cpp.nit index a6a8ca3..e114cd2 100644 --- a/src/ffi/cpp.nit +++ b/src/ffi/cpp.nit @@ -27,7 +27,7 @@ end redef class MModule private var cpp_file: nullable CPPCompilationUnit = null - var cpp_compiler_options = "" is writable + var cppflags = "" is writable end class CPPLanguage @@ -133,7 +133,7 @@ class CPPLanguage mmodule.ffi_files.add(file) # add linked option to support C++ - mmodule.c_linker_options = "{mmodule.c_linker_options} -lstdc++" + mmodule.ldflags = "{mmodule.ldflags} -lstdc++" end redef fun compile_callback(callback, mmodule, mainmodule, ecc) @@ -180,7 +180,7 @@ class ExternCppFile var mmodule: MModule redef fun makefile_rule_name do return "{filename.basename("")}.o" - redef fun makefile_rule_content do return "$(CXX) $(CFLAGS) {mmodule.cpp_compiler_options} -c {filename.basename("")} -o {filename.basename("")}.o" + redef fun makefile_rule_content do return "$(CXX) $(CFLAGS) {mmodule.cppflags} -c {filename.basename("")} -o {filename.basename("")}.o" redef fun compiles_to_o_file do return true end diff --git a/src/ffi/ffi.nit b/src/ffi/ffi.nit index b854750..cccb7a0 100644 --- a/src/ffi/ffi.nit +++ b/src/ffi/ffi.nit @@ -62,7 +62,7 @@ redef class MModule ffi_ccu.write_as_impl(self, compdir) for filename in ffi_ccu.files do - var f = new ExternCFile(filename, c_compiler_options) + var f = new ExternCFile(filename, cflags) f.pkgconfigs.add_all pkgconfigs ffi_files.add(f) end diff --git a/src/ffi/java.nit b/src/ffi/java.nit index 1fa56e9..77c3c56 100644 --- a/src/ffi/java.nit +++ b/src/ffi/java.nit @@ -242,8 +242,8 @@ redef class MModule # Tell the C compiler where to find jni.h and how to link with libjvm private fun insert_compiler_options do - c_compiler_options = "{c_compiler_options} -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/" - c_linker_options = "{c_linker_options} -L $(JNI_LIB_PATH) -ljvm" + cflags = "{cflags} -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/" + ldflags = "{ldflags} -L $(JNI_LIB_PATH) -ljvm" end # Name of the generated Java class where to store all implementation methods of this module diff --git a/src/ffi/objc.nit b/src/ffi/objc.nit index f031289..7e309bc 100644 --- a/src/ffi/objc.nit +++ b/src/ffi/objc.nit @@ -154,7 +154,7 @@ private class ObjCCompilationUnit files.add compdir/c_file - mmodule.c_linker_options = "{mmodule.c_linker_options} -lobjc" + mmodule.ldflags = "{mmodule.ldflags} -lobjc" return new ExternObjCFile(compdir/c_file, mmodule) end diff --git a/src/frontend/check_annotation.nit b/src/frontend/check_annotation.nit index fa909bc..a51bece 100644 --- a/src/frontend/check_annotation.nit +++ b/src/frontend/check_annotation.nit @@ -92,8 +92,8 @@ extern no_warning pkgconfig -c_compiler_option -c_linker_option +cflags +ldflags platform """ -- 1.7.9.5