From: Alexis Laferrière Date: Sat, 24 Jan 2015 14:18:41 +0000 (-0500) Subject: lib & contrib & tests: update users of `cflags` and `ldflags` X-Git-Tag: v0.7.1~11^2 X-Git-Url: http://nitlanguage.org lib & contrib & tests: update users of `cflags` and `ldflags` Signed-off-by: Alexis Laferrière --- diff --git a/contrib/pep8analysis/src/pep8analysis_web.nit b/contrib/pep8analysis/src/pep8analysis_web.nit index dacc9ff..b991952 100644 --- a/contrib/pep8analysis/src/pep8analysis_web.nit +++ b/contrib/pep8analysis/src/pep8analysis_web.nit @@ -20,8 +20,8 @@ # analysis results. The result graph will be sent to the JavaScript function # `show_graph` with the source of the graph in Graphviz's dot. module pep8analysis_web is - cpp_compiler_option("--std=c++11 --bind") - c_linker_option("--bind") + cppflags "--std=c++11 --bind" + ldflags "--bind" end import emscripten diff --git a/lib/cocoa/app_kit.nit b/lib/cocoa/app_kit.nit index 91bc87c..5fe0af2 100644 --- a/lib/cocoa/app_kit.nit +++ b/lib/cocoa/app_kit.nit @@ -15,7 +15,7 @@ # limitations under the License. # The Application Kit provides services to create GUI -module app_kit is c_linker_option "-framework AppKit" +module app_kit is ldflags "-framework AppKit" import foundation diff --git a/lib/cocoa/cocoa.nit b/lib/cocoa/cocoa.nit index 99c6b12..09e1291 100644 --- a/lib/cocoa/cocoa.nit +++ b/lib/cocoa/cocoa.nit @@ -20,7 +20,7 @@ # # This wrapper of the Cocoa API regroups the Foundation Kit and the # Application Kit. -module cocoa is c_linker_option "-framework Cocoa" +module cocoa is ldflags "-framework Cocoa" import foundation import app_kit diff --git a/lib/cocoa/foundation.nit b/lib/cocoa/foundation.nit index ab027fd..cbe8f08 100644 --- a/lib/cocoa/foundation.nit +++ b/lib/cocoa/foundation.nit @@ -15,7 +15,7 @@ # limitations under the License. # The Foundation Kit provides basic Objective-C classes and structures -module foundation is c_linker_option "-framework Foundation" +module foundation is ldflags "-framework Foundation" in "ObjC Header" `{ #import diff --git a/lib/cpp.nit b/lib/cpp.nit index 6fe897a..78bb96c 100644 --- a/lib/cpp.nit +++ b/lib/cpp.nit @@ -16,7 +16,7 @@ # Offers features to interface with C++ code and libraries module cpp is - new_annotation cpp_compiler_option + new_annotation cppflags end # A pointer to a C++ std::string instance diff --git a/lib/java/java.nit b/lib/java/java.nit index c3db430..2020e30 100644 --- a/lib/java/java.nit +++ b/lib/java/java.nit @@ -27,8 +27,8 @@ # most of JNI functions. You can use it to further customize the behavior # of your code. module java is - c_compiler_option "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/" - c_linker_option("-L $(JNI_LIB_PATH) -ljvm") + cflags "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/" + ldflags "-L $(JNI_LIB_PATH) -ljvm" new_annotation extra_java_files end diff --git a/lib/jvm.nit b/lib/jvm.nit index 6063f23..abdcab6 100644 --- a/lib/jvm.nit +++ b/lib/jvm.nit @@ -19,8 +19,8 @@ # # See: http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html module jvm is - c_compiler_option "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/" - c_linker_option "-L $(JNI_LIB_PATH) -ljvm" + cflags "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/" + ldflags "-L $(JNI_LIB_PATH) -ljvm" end in "C Header" `{ diff --git a/lib/mpi.nit b/lib/mpi.nit index 01137f7..de91686 100644 --- a/lib/mpi.nit +++ b/lib/mpi.nit @@ -26,8 +26,8 @@ # Since this module is a thin wrapper around OpenMPI, in case of missing # documentation, you can refer to https://www.open-mpi.org/doc/v1.8/. module mpi is - c_compiler_option(exec("mpicc", "-showme:compile")) - c_linker_option(exec("mpicc", "-showme:link")) + cflags exec("mpicc", "-showme:compile") + ldflags exec("mpicc", "-showme:link") end import c diff --git a/lib/pthreads/extra.nit b/lib/pthreads/extra.nit index 416b174..e408270 100644 --- a/lib/pthreads/extra.nit +++ b/lib/pthreads/extra.nit @@ -16,8 +16,8 @@ # Offers some POSIX threads services that are not available on all platforms module extra is - c_compiler_option("-pthread") - c_linker_option("-pthread") + cflags "-pthread" + ldflags "-pthread" end intrude import pthreads diff --git a/lib/pthreads/pthreads.nit b/lib/pthreads/pthreads.nit index bce93c4..5d6b80d 100644 --- a/lib/pthreads/pthreads.nit +++ b/lib/pthreads/pthreads.nit @@ -16,8 +16,8 @@ # Main POSIX threads support and intro the classes `Thread`, `Mutex` and `Barrier` module pthreads is - c_compiler_option("-pthread") - c_linker_option("-pthread") + cflags "-pthread" + ldflags "-pthread" pkgconfig "bdw-gc" end diff --git a/lib/realtime.nit b/lib/realtime.nit index b66ade0..3a02d86 100644 --- a/lib/realtime.nit +++ b/lib/realtime.nit @@ -11,7 +11,7 @@ # another product. # Provides the Clock utility class to keep time of real time flow -module realtime is c_linker_option("-lrt") +module realtime is ldflags "-lrt" in "C header" `{ #ifdef _POSIX_C_SOURCE diff --git a/lib/sdl.nit b/lib/sdl.nit index 16695e2..41ddc5b 100644 --- a/lib/sdl.nit +++ b/lib/sdl.nit @@ -16,8 +16,8 @@ # SDL display support (used in Linux for windows and inputes only) module sdl is - c_compiler_option(exec("sdl-config", "--cflags")) - c_linker_option(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf") + cflags exec("sdl-config", "--cflags") + ldflags(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf") end import mnit_display diff --git a/lib/sdl2/image.nit b/lib/sdl2/image.nit index 6dc53b3..ce642b8 100644 --- a/lib/sdl2/image.nit +++ b/lib/sdl2/image.nit @@ -20,7 +20,7 @@ # alone: JPG, PNG, TIF, GIT, ICO and much more. module image is pkgconfig "sdl2" - c_linker_option "-lSDL2_image" + ldflags "-lSDL2_image" end import sdl2 diff --git a/tests/error_annot_c_compiler.nit b/tests/error_annot_c_compiler.nit index 69e3f0d..6eddab1 100644 --- a/tests/error_annot_c_compiler.nit +++ b/tests/error_annot_c_compiler.nit @@ -14,12 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -#alt1# module error_annot_c_compiler_alt1 is c_compiler_option -#alt2# module error_annot_c_compiler_alt2 is c_compiler_option(foo("llvm-config")) -#alt3# module error_annot_c_compiler_alt3 is c_compiler_option(foo("llvm-config", "2nd arg")) -#alt4# module error_annot_c_compiler_alt4 is c_linker_option -#alt5# module error_annot_c_compiler_alt5 is c_compiler_option(exec("invalid-program")) -#alt6# module error_annot_c_compiler_alt6 is c_compiler_option(exec) +#alt1# module error_annot_c_compiler_alt1 is cflags +#alt2# module error_annot_c_compiler_alt2 is cflags(foo("llvm-config")) +#alt3# module error_annot_c_compiler_alt3 is cflags(foo("llvm-config", "2nd arg")) +#alt4# module error_annot_c_compiler_alt4 is ldflags +#alt5# module error_annot_c_compiler_alt5 is cflags(exec("invalid-program")) +#alt6# module error_annot_c_compiler_alt6 is cflags(exec) fun foo `{ printf("nothing...\n"); `} diff --git a/tests/sav/error_annot_c_compiler_alt1.res b/tests/sav/error_annot_c_compiler_alt1.res index 981a90b..23b9437 100644 --- a/tests/sav/error_annot_c_compiler_alt1.res +++ b/tests/sav/error_annot_c_compiler_alt1.res @@ -1 +1 @@ -alt/error_annot_c_compiler_alt1.nit:17,39--55: Syntax error: "c_compiler_option" expects at least one argument. +alt/error_annot_c_compiler_alt1.nit:17,39--44: Syntax error: "cflags" expects at least one argument. diff --git a/tests/sav/error_annot_c_compiler_alt2.res b/tests/sav/error_annot_c_compiler_alt2.res index b460682..2459cd4 100644 --- a/tests/sav/error_annot_c_compiler_alt2.res +++ b/tests/sav/error_annot_c_compiler_alt2.res @@ -1 +1 @@ -alt/error_annot_c_compiler_alt2.nit:18,39--75: Syntax error: "c_compiler_option" accepts only calls to `exec` with the command as arguments. +alt/error_annot_c_compiler_alt2.nit:18,39--64: Syntax error: "cflags" accepts only calls to `exec` with the command as arguments. diff --git a/tests/sav/error_annot_c_compiler_alt3.res b/tests/sav/error_annot_c_compiler_alt3.res index 8142bf8..a584f16 100644 --- a/tests/sav/error_annot_c_compiler_alt3.res +++ b/tests/sav/error_annot_c_compiler_alt3.res @@ -1 +1 @@ -alt/error_annot_c_compiler_alt3.nit:19,39--86: Syntax error: "c_compiler_option" accepts only calls to `exec` with the command as arguments. +alt/error_annot_c_compiler_alt3.nit:19,39--75: Syntax error: "cflags" accepts only calls to `exec` with the command as arguments. diff --git a/tests/sav/error_annot_c_compiler_alt4.res b/tests/sav/error_annot_c_compiler_alt4.res index d753ea9..f34ea44 100644 --- a/tests/sav/error_annot_c_compiler_alt4.res +++ b/tests/sav/error_annot_c_compiler_alt4.res @@ -1 +1 @@ -alt/error_annot_c_compiler_alt4.nit:20,39--53: Syntax error: "c_linker_option" expects at least one argument. +alt/error_annot_c_compiler_alt4.nit:20,39--45: Syntax error: "ldflags" expects at least one argument. diff --git a/tests/sav/error_annot_c_compiler_alt5.res b/tests/sav/error_annot_c_compiler_alt5.res index 2251e01..133d200 100644 --- a/tests/sav/error_annot_c_compiler_alt5.res +++ b/tests/sav/error_annot_c_compiler_alt5.res @@ -1 +1 @@ -alt/error_annot_c_compiler_alt5.nit:21,57--79: Annotation error: Something went wrong executing the argument of annotation "c_compiler_option", make sure the command is valid. +alt/error_annot_c_compiler_alt5.nit:21,46--68: Annotation error: Something went wrong executing the argument of annotation "cflags", make sure the command is valid. diff --git a/tests/sav/error_annot_c_compiler_alt6.res b/tests/sav/error_annot_c_compiler_alt6.res index 694b887..cc29f8a 100644 --- a/tests/sav/error_annot_c_compiler_alt6.res +++ b/tests/sav/error_annot_c_compiler_alt6.res @@ -1 +1 @@ -alt/error_annot_c_compiler_alt6.nit:22,39--61: Syntax error: "c_compiler_option" accepts only calls to `exec` with the command as arguments. +alt/error_annot_c_compiler_alt6.nit:22,39--50: Syntax error: "cflags" accepts only calls to `exec` with the command as arguments. diff --git a/tests/test_annot_c_compiler.nit b/tests/test_annot_c_compiler.nit index e55ae8a..7277957 100644 --- a/tests/test_annot_c_compiler.nit +++ b/tests/test_annot_c_compiler.nit @@ -15,10 +15,10 @@ # limitations under the License. module test_annot_c_compiler is - c_compiler_option("-I /usr/include") - c_compiler_option(exec("pkg-config", "--cflags", "sdl")) - c_linker_option("-lm") - c_linker_option("-lm", "-L /usr/bin") + cflags "-I /usr/include" + cflags exec("pkg-config", "--cflags", "sdl") + ldflags "-lm" + ldflags("-lm", "-L /usr/bin") end fun dummy `{ printf("nothing...\n"); `}