Mxx_ru 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +26 -26
- data/NEWS +107 -107
- data/README +21 -21
- data/Rakefile +56 -59
- data/examples/exe_and_lib/prj.rb +11 -11
- data/examples/exe_and_lib/say.rb +7 -7
- data/examples/exe_dll_lib/inout.rb +18 -18
- data/examples/exe_dll_lib/prj.rb +11 -11
- data/examples/exe_dll_lib/say.rb +9 -9
- data/examples/exe_dll_lib_2/build.rb +10 -10
- data/examples/exe_dll_lib_2/inout/prj.rb +16 -16
- data/examples/exe_dll_lib_2/main/prj.rb +9 -9
- data/examples/exe_dll_lib_2/say/prj.rb +8 -8
- data/examples/simple_exe/prj.rb +7 -7
- data/lib/mxx_ru/abstract_target.rb +335 -335
- data/lib/mxx_ru/binary_library.rb +106 -106
- data/lib/mxx_ru/binary_target.rb +173 -173
- data/lib/mxx_ru/binary_unittest.rb +143 -143
- data/lib/mxx_ru/compat.rb +33 -33
- data/lib/mxx_ru/cpp.rb +38 -38
- data/lib/mxx_ru/cpp/analyzer.rb +237 -237
- data/lib/mxx_ru/cpp/composite.rb +118 -118
- data/lib/mxx_ru/cpp/detect_toolset.rb +122 -122
- data/lib/mxx_ru/cpp/mode.rb +90 -90
- data/lib/mxx_ru/cpp/obj_placement.rb +330 -330
- data/lib/mxx_ru/cpp/obj_placements/custom_subdir.rb +155 -155
- data/lib/mxx_ru/cpp/qt.rb +366 -366
- data/lib/mxx_ru/cpp/rucodegen.rb +157 -157
- data/lib/mxx_ru/cpp/source_file.rb +79 -79
- data/lib/mxx_ru/cpp/target.rb +1523 -1523
- data/lib/mxx_ru/cpp/toolset.rb +1087 -1087
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb +53 -53
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb +460 -460
- data/lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb +59 -59
- data/lib/mxx_ru/cpp/toolsets/c89_nsk.rb +59 -59
- data/lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb +277 -277
- data/lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb +58 -58
- data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +420 -424
- data/lib/mxx_ru/cpp/toolsets/gcc_linux.rb +64 -64
- data/lib/mxx_ru/cpp/toolsets/gcc_mingw.rb +150 -150
- data/lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb +91 -91
- data/lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb +103 -84
- data/lib/mxx_ru/cpp/toolsets/vc7.rb +62 -62
- data/lib/mxx_ru/cpp/toolsets/vc8.rb +455 -455
- data/lib/mxx_ru/cpp/toolsets/vc_family.rb +448 -448
- data/lib/mxx_ru/ex.rb +165 -165
- data/lib/mxx_ru/makestyle_generator.rb +146 -146
- data/lib/mxx_ru/textfile_unittest.rb +303 -303
- data/lib/mxx_ru/util.rb +340 -340
- data/tests/c/pcre/chartables.c +183 -183
- data/tests/c/pcre/config.h +99 -99
- data/tests/c/pcre/dftables.c +167 -167
- data/tests/c/pcre/get.c +349 -349
- data/tests/c/pcre/internal.h +677 -677
- data/tests/c/pcre/maketables.c +140 -140
- data/tests/c/pcre/pcre.c +8304 -8304
- data/tests/c/pcre/pcre.h +193 -193
- data/tests/c/pcre/pcre.rb +14 -14
- data/tests/c/pcre/pcredemo.c +316 -316
- data/tests/c/pcre/pcregrep.c +642 -642
- data/tests/c/pcre/pcreposix.c +305 -305
- data/tests/c/pcre/pcreposix.h +88 -88
- data/tests/c/pcre/pcretest.c +1483 -1483
- data/tests/c/pcre/perltest +211 -211
- data/tests/c/pcre/printint.c +360 -360
- data/tests/c/pcre/study.c +472 -472
- data/tests/cpp/cpp_sources_glob/build.rb +7 -7
- data/tests/cpp/cpp_sources_glob/some/module/prj.rb +10 -10
- data/tests/cpp/cpp_sources_glob/tc_cpp_sources_glob.rb +18 -18
- data/tests/cpp/mswin_res_dll/build.rb +14 -14
- data/tests/cpp/mswin_res_dll/dll.cpp +17 -17
- data/tests/cpp/mswin_res_dll/dll.rb +29 -29
- data/tests/cpp/mswin_res_dll/dll.rc +48 -48
- data/tests/cpp/mswin_res_dll/h/dll.hpp +8 -8
- data/tests/cpp/mswin_res_dll/h/res.h +3 -3
- data/tests/cpp/mswin_res_dll/main.cpp +13 -13
- data/tests/cpp/mswin_res_dll/main.rb +19 -19
- data/tests/cpp/mswin_res_dll/tc_mswin_res_dll.rb +18 -18
- data/tests/cpp/mswin_res_exe/build.rb +23 -23
- data/tests/cpp/mswin_res_exe/h/res.h +3 -3
- data/tests/cpp/mswin_res_exe/main.cpp +17 -17
- data/tests/cpp/mswin_res_exe/main.rc +48 -48
- data/tests/cpp/mswin_res_exe/tc_mswin_res_exe.rb +18 -18
- data/tests/cpp/rucodegen.embedded/host_config.cpp +32 -32
- data/tests/cpp/rucodegen.embedded/impl/conn_params.cpp +7 -7
- data/tests/cpp/rucodegen.embedded/impl/conn_params.rb +14 -14
- data/tests/cpp/rucodegen.embedded/impl/h/conn_params.hpp +10 -10
- data/tests/cpp/rucodegen.embedded/prj.rb +16 -16
- data/tests/cpp/rucodegen.embedded/tc_rucodegen.rb +18 -18
- data/tests/cpp/rucodegen/host_config.cpp +20 -20
- data/tests/cpp/rucodegen/host_config.rb +14 -14
- data/tests/cpp/rucodegen/impl/conn_params.cpp +7 -7
- data/tests/cpp/rucodegen/impl/conn_params.rb +14 -14
- data/tests/cpp/rucodegen/impl/h/conn_params.hpp +10 -10
- data/tests/cpp/rucodegen/prj.rb +16 -16
- data/tests/cpp/rucodegen/tc_rucodegen.rb +18 -18
- data/tests/cpp/textfile_unittest/build.rb +8 -8
- data/tests/cpp/textfile_unittest/etalons/out_1.txt +1 -1
- data/tests/cpp/textfile_unittest/etalons/out_128.txt +128 -128
- data/tests/cpp/textfile_unittest/main.cpp +89 -89
- data/tests/cpp/textfile_unittest/prj.rb +8 -8
- data/tests/cpp/textfile_unittest/prj.ut.rb +18 -18
- data/tests/cpp/textfile_unittest/tc_textfile_unittest.rb +18 -18
- data/tests/cpp/toolset_name.rb +6 -6
- data/tests/cpp/vc_cleanup/prj_dll_no_implib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_dll_no_implib_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_dll_with_implib.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_dll_with_implib_simple_target_root.rb +14 -14
- data/tests/cpp/vc_cleanup/prj_exe_no_implib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_exe_no_implib_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_lib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_lib_with_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/tc_vc_cleanup.rb +23 -23
- data/tests/mxx_ru/binary_library/tc_binary_library.rb +57 -57
- data/tests/mxx_ru/binary_library/tc_binary_target_lib_methods.rb +114 -114
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/build.rb +8 -8
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/child_1.rb +5 -5
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/build.rb +7 -7
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_1.rb +5 -5
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_2.rb +5 -5
- data/tests/mxx_ru/change_default_value/ok/build.rb +8 -8
- data/tests/mxx_ru/change_default_value/ok/child_1.rb +8 -8
- data/tests/mxx_ru/lib_path/build.rb +8 -8
- data/tests/mxx_ru/lib_path/bye.rb +8 -8
- data/tests/mxx_ru/lib_path/hi.rb +8 -8
- data/tests/mxx_ru/lib_path/main.rb +12 -12
- data/tests/mxx_ru/lib_path/tc_lib_path.rb +18 -18
- data/tests/mxx_ru/obj_placements/tc_custom_subdir.rb +58 -58
- data/tests/mxx_ru/opt_lib_ext/build.rb +7 -7
- data/tests/mxx_ru/opt_lib_ext/hi.rb +7 -7
- data/tests/mxx_ru/opt_lib_ext/tc_opt_lib_ext.rb +18 -18
- data/tests/mxx_ru/opt_lib_ext/test-no-ext.rb +9 -9
- data/tests/mxx_ru/opt_lib_ext/test-with-ext.rb +13 -13
- data/tests/mxx_ru/plural_form_methods/tc.rb +72 -72
- data/tests/mxx_ru/qt_gen/tc_uic_result_subdir.rb +76 -76
- data/tests/mxx_ru/target_ext/prj_dll.rb +8 -8
- data/tests/mxx_ru/target_ext/prj_exe.rb +8 -8
- data/tests/mxx_ru/target_ext/prj_lib.rb +8 -8
- data/tests/mxx_ru/target_ext/tc_target_ext.rb +24 -24
- data/tests/mxx_ru/tc_makestyle_generator.rb +117 -117
- data/tests/mxx_ru/vc8/tc_actual_manifest.rb +230 -230
- data/tests/mxx_ru/vc8/tc_append_mt_commands.rb +104 -104
- data/tests/mxx_ru/vc8/tc_default_manifest.rb +17 -17
- data/tests/mxx_ru/vc8/tc_define_manifest.rb +173 -173
- data/tests/mxx_ru/vc8/tc_drop_default_manifest.rb +16 -16
- data/tests/mxx_ru/vc8/tc_invalid_params.rb +81 -81
- data/tests/mxx_ru/vc8/ts_vc8.rb +10 -10
- data/tests/qt/aclock/aclock.cpp +148 -148
- data/tests/qt/aclock/aclock.h +45 -45
- data/tests/qt/aclock/main.cpp +28 -28
- data/tests/qt/aclock/prj.rb +21 -21
- data/tests/qt/iconview/main.cpp +76 -76
- data/tests/qt/iconview/prj.rb +21 -21
- data/tests/qt/toplevel/main.cpp +9 -9
- data/tests/qt/toplevel/options.ui +587 -587
- data/tests/qt/toplevel/prj.rb +22 -22
- data/tests/test_with_compilation.rb +110 -110
- data/tests/unix/lib_linking_mode/a_shared.rb +7 -7
- data/tests/unix/lib_linking_mode/a_static.rb +7 -7
- data/tests/unix/lib_linking_mode/etalon/shared.txt +2 -2
- data/tests/unix/lib_linking_mode/etalon/static.txt +2 -2
- data/tests/unix/lib_linking_mode/main_conflict.rb +12 -12
- data/tests/unix/lib_linking_mode/main_conflict_2.rb +11 -11
- data/tests/unix/lib_linking_mode/main_shared.rb +9 -9
- data/tests/unix/lib_linking_mode/main_shared.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_shared_2.rb +10 -10
- data/tests/unix/lib_linking_mode/main_shared_2.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_static.rb +9 -9
- data/tests/unix/lib_linking_mode/main_static.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_static_2.rb +10 -10
- data/tests/unix/lib_linking_mode/main_static_2.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/tc_conflicted_build.rb +18 -18
- data/tests/unix/lib_linking_mode/tc_normal_build.rb +18 -18
- data/tests/unix/lib_order/a.cpp +4 -0
- data/tests/unix/lib_order/a.hpp +1 -0
- data/tests/unix/lib_order/a.rb +8 -0
- data/tests/unix/lib_order/b.cpp +10 -0
- data/tests/unix/lib_order/b.hpp +1 -0
- data/tests/unix/lib_order/b.rb +8 -0
- data/tests/unix/lib_order/build.rb +9 -0
- data/tests/unix/lib_order/c.cpp +12 -0
- data/tests/unix/lib_order/c.hpp +2 -0
- data/tests/unix/lib_order/c.rb +8 -0
- data/tests/unix/lib_order/d.cpp +7 -0
- data/tests/unix/lib_order/d.hpp +1 -0
- data/tests/unix/lib_order/d.rb +8 -0
- data/tests/unix/lib_order/main.cpp +7 -0
- data/tests/unix/lib_order/main.rb +14 -0
- data/tests/unix/lib_order/tc_normal_build.rb +16 -0
- metadata +342 -319
@@ -1,58 +1,58 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
-
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
-
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
-
# All rights reserved.
|
6
|
-
#
|
7
|
-
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
-
# are permitted provided that the following conditions are met:
|
9
|
-
#
|
10
|
-
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer.
|
12
|
-
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
-
# this list of conditions and the following disclaimer in the documentation
|
14
|
-
# and/or other materials provided with the distribution.
|
15
|
-
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
-
# from this software without specific prior written permission.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
-
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
-
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
-
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
#++
|
28
|
-
|
29
|
-
require 'mxx_ru/cpp/toolsets/gcc_family'
|
30
|
-
|
31
|
-
module MxxRu
|
32
|
-
module Cpp
|
33
|
-
module Toolsets
|
34
|
-
|
35
|
-
# Toolset implemetation for GCC compiler for Cygwin.
|
36
|
-
class GccCygwin < MxxRu::Cpp::Toolsets::GccMswinFamily
|
37
|
-
public
|
38
|
-
def initialize( a_name = "gcc" )
|
39
|
-
super( a_name )
|
40
|
-
|
41
|
-
setup_tag( GCC_PORT_TAG, GCC_PORT_CYGWIN )
|
42
|
-
setup_tag( "host_os", "unix" )
|
43
|
-
setup_tag( "target_os", "unix" )
|
44
|
-
setup_tag( "unix_port", "cygwin" )
|
45
|
-
end
|
46
|
-
end # class GccCygwin
|
47
|
-
|
48
|
-
# For compatibility with previous versions.
|
49
|
-
Gcc_cygwin = GccCygwin
|
50
|
-
|
51
|
-
end # module Toolsets
|
52
|
-
|
53
|
-
end # module Cpp
|
54
|
-
|
55
|
-
end # module MxxRu
|
56
|
-
|
57
|
-
MxxRu::Cpp::setup_toolset( MxxRu::Cpp::Toolsets::GccCygwin.new )
|
58
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
+
# All rights reserved.
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
+
# are permitted provided that the following conditions are met:
|
9
|
+
#
|
10
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
# this list of conditions and the following disclaimer in the documentation
|
14
|
+
# and/or other materials provided with the distribution.
|
15
|
+
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
+
# from this software without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
+
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
+
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
#++
|
28
|
+
|
29
|
+
require 'mxx_ru/cpp/toolsets/gcc_family'
|
30
|
+
|
31
|
+
module MxxRu
|
32
|
+
module Cpp
|
33
|
+
module Toolsets
|
34
|
+
|
35
|
+
# Toolset implemetation for GCC compiler for Cygwin.
|
36
|
+
class GccCygwin < MxxRu::Cpp::Toolsets::GccMswinFamily
|
37
|
+
public
|
38
|
+
def initialize( a_name = "gcc" )
|
39
|
+
super( a_name )
|
40
|
+
|
41
|
+
setup_tag( GCC_PORT_TAG, GCC_PORT_CYGWIN )
|
42
|
+
setup_tag( "host_os", "unix" )
|
43
|
+
setup_tag( "target_os", "unix" )
|
44
|
+
setup_tag( "unix_port", "cygwin" )
|
45
|
+
end
|
46
|
+
end # class GccCygwin
|
47
|
+
|
48
|
+
# For compatibility with previous versions.
|
49
|
+
Gcc_cygwin = GccCygwin
|
50
|
+
|
51
|
+
end # module Toolsets
|
52
|
+
|
53
|
+
end # module Cpp
|
54
|
+
|
55
|
+
end # module MxxRu
|
56
|
+
|
57
|
+
MxxRu::Cpp::setup_toolset( MxxRu::Cpp::Toolsets::GccCygwin.new )
|
58
|
+
|
@@ -1,424 +1,420 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
-
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
-
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
-
# All rights reserved.
|
6
|
-
#
|
7
|
-
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
-
# are permitted provided that the following conditions are met:
|
9
|
-
#
|
10
|
-
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer.
|
12
|
-
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
-
# this list of conditions and the following disclaimer in the documentation
|
14
|
-
# and/or other materials provided with the distribution.
|
15
|
-
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
-
# from this software without specific prior written permission.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
-
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
-
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
-
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
-
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
#++
|
28
|
-
|
29
|
-
require 'mxx_ru/binary_library'
|
30
|
-
require 'mxx_ru/cpp/toolset'
|
31
|
-
|
32
|
-
module MxxRu
|
33
|
-
module Cpp
|
34
|
-
module Toolsets
|
35
|
-
|
36
|
-
# Toolset implemetation for GCC compiler.
|
37
|
-
class GccFamily < MxxRu::Cpp::Toolset
|
38
|
-
public
|
39
|
-
# Tag name, indicates gcc port beeing used.
|
40
|
-
GCC_PORT_TAG = "gcc_port"
|
41
|
-
# GCC_PORT: GCC on Unix/Linux.
|
42
|
-
GCC_PORT_UNIX = "unix"
|
43
|
-
# GCC_PORT: MinGW on Win32.
|
44
|
-
GCC_PORT_MINGW = "mingw"
|
45
|
-
# GCC_PORT: Cygwin on Win32.
|
46
|
-
GCC_PORT_CYGWIN = "cygwin"
|
47
|
-
|
48
|
-
def initialize( a_name )
|
49
|
-
super( a_name )
|
50
|
-
end
|
51
|
-
|
52
|
-
# Returns C compiler name.
|
53
|
-
def c_compiler_name
|
54
|
-
return "gcc"
|
55
|
-
end
|
56
|
-
|
57
|
-
# Returns C++ compiler name.
|
58
|
-
def cpp_compiler_name
|
59
|
-
return "g++"
|
60
|
-
end
|
61
|
-
|
62
|
-
# Returns linker name.
|
63
|
-
def linker_name
|
64
|
-
return "g++"
|
65
|
-
end
|
66
|
-
|
67
|
-
# Returns librarian name.
|
68
|
-
def librarian_name
|
69
|
-
return "ar"
|
70
|
-
end
|
71
|
-
|
72
|
-
# See description at MxxRu::Cpp::Toolset#setup_mandatory_options.
|
73
|
-
def setup_mandatory_options( target )
|
74
|
-
|
75
|
-
if RUNTIME_DEBUG == target.mxx_runtime_mode
|
76
|
-
target.compiler_option( "-g" )
|
77
|
-
target.linker_option( "-g" )
|
78
|
-
elsif RUNTIME_RELEASE == target.mxx_runtime_mode
|
79
|
-
target.define( "NDEBUG" )
|
80
|
-
target.linker_option( "-s" )
|
81
|
-
if OPTIM_SIZE == target.mxx_optimization
|
82
|
-
target.compiler_option( "-Os" )
|
83
|
-
else
|
84
|
-
target.compiler_option( "-O2" )
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
if RTTI_DISABLED == target.mxx_rtti_mode
|
89
|
-
target.cpp_compiler_option( "-fno-rtti" )
|
90
|
-
end
|
91
|
-
|
92
|
-
if RTL_STATIC == target.mxx_rtl_mode
|
93
|
-
target.linker_option( "--static-libgcc" )
|
94
|
-
else
|
95
|
-
target.linker_option( "--shared-libgcc" )
|
96
|
-
end
|
97
|
-
|
98
|
-
# This is not required on mswin platform.
|
99
|
-
if target.target_type.name == DllTargetType::TYPE
|
100
|
-
target.compiler_option( "-fPIC" )
|
101
|
-
end
|
102
|
-
|
103
|
-
# If C++ files are exist, linker should use stdc++ library.
|
104
|
-
if target.mxx_cpp_files.size
|
105
|
-
# target.lib( "stdc++" )
|
106
|
-
end
|
107
|
-
|
108
|
-
target.mxx_all_defines.each { |d|
|
109
|
-
target.compiler_option( "-D" + d )
|
110
|
-
}
|
111
|
-
|
112
|
-
target.mxx_all_include_paths.each { |p|
|
113
|
-
target.compiler_option( "-I" + p )
|
114
|
-
}
|
115
|
-
end
|
116
|
-
|
117
|
-
# See description at MxxRu::Cpp::Toolset#obj_file_ext.
|
118
|
-
def obj_file_ext
|
119
|
-
return ".o"
|
120
|
-
end
|
121
|
-
|
122
|
-
# See description at MxxRu::Cpp::Toolset#make_c_obj_command_lines.
|
123
|
-
def make_c_obj_command_lines(
|
124
|
-
obj_name,
|
125
|
-
source_name,
|
126
|
-
compiler_options,
|
127
|
-
target )
|
128
|
-
|
129
|
-
cmd_line = "-c -o #{obj_name} " +
|
130
|
-
"#{compiler_options.join(' ')} #{source_name}"
|
131
|
-
|
132
|
-
return [ "#{c_compiler_name} #{cmd_line}" ]
|
133
|
-
end
|
134
|
-
|
135
|
-
# See description at MxxRu::Cpp::Toolset#make_c_obj_command_lines.
|
136
|
-
def make_cpp_obj_command_lines(
|
137
|
-
obj_name,
|
138
|
-
source_name,
|
139
|
-
compiler_options,
|
140
|
-
target )
|
141
|
-
|
142
|
-
cmd_line = "-c -o #{obj_name} " +
|
143
|
-
"#{compiler_options.join(' ')} #{source_name}"
|
144
|
-
|
145
|
-
return [ "#{cpp_compiler_name} #{cmd_line}" ]
|
146
|
-
end
|
147
|
-
|
148
|
-
# See description at MxxRu::Cpp::Toolset#lib_file_name.
|
149
|
-
def lib_file_name( source_name )
|
150
|
-
return "lib" + source_name + ".a"
|
151
|
-
end
|
152
|
-
|
153
|
-
# See description at MxxRu::Cpp::Toolset#lib_link_name.
|
154
|
-
def lib_link_name( source_name )
|
155
|
-
return source_name
|
156
|
-
end
|
157
|
-
|
158
|
-
# See description at MxxRu::Cpp::Toolset#make_lib_command_lines.
|
159
|
-
def make_lib_command_lines(
|
160
|
-
lib_name,
|
161
|
-
obj_files,
|
162
|
-
librarian_options,
|
163
|
-
target )
|
164
|
-
|
165
|
-
result = "-r #{librarian_options.join(' ')} " +
|
166
|
-
"#{lib_name} #{obj_files.join(' ')}"
|
167
|
-
|
168
|
-
return [ "#{librarian_name} #{result}" ]
|
169
|
-
end
|
170
|
-
|
171
|
-
# See description at MxxRu::Cpp::Toolset#dll_file_name.
|
172
|
-
def dll_file_name( source_name )
|
173
|
-
return "lib" + source_name + ".so"
|
174
|
-
end
|
175
|
-
|
176
|
-
# See description at MxxRu::Cpp::Toolset#implib_link_name.
|
177
|
-
def implib_link_name(
|
178
|
-
dll_real_name,
|
179
|
-
target )
|
180
|
-
|
181
|
-
# Target name should be passed to linker on UNIX platform
|
182
|
-
return lib_link_name(
|
183
|
-
File.basename( target.mxx_target_name ) )
|
184
|
-
end
|
185
|
-
|
186
|
-
# See description at MxxRu::Cpp::Toolset#implib_link_path.
|
187
|
-
def implib_link_path(
|
188
|
-
dll_real_name,
|
189
|
-
dll_real_path,
|
190
|
-
target )
|
191
|
-
|
192
|
-
# DLL name is the import library name on UNIX platform.
|
193
|
-
return dll_real_path
|
194
|
-
end
|
195
|
-
|
196
|
-
# See description at MxxRu::Cpp::Toolset#make_dll_command_lines.
|
197
|
-
def make_dll_command_lines(
|
198
|
-
a_dll_name,
|
199
|
-
a_dll_info,
|
200
|
-
a_linker_lists,
|
201
|
-
a_target )
|
202
|
-
|
203
|
-
result = "-shared " +
|
204
|
-
"#{a_linker_lists.linker_options.join(' ')} " +
|
205
|
-
"-o #{a_dll_name} "
|
206
|
-
|
207
|
-
a_linker_lists.lib_paths.each { |p| result << "-L#{p} " }
|
208
|
-
|
209
|
-
result << "#{a_linker_lists.objs.join(' ')} "
|
210
|
-
result << make_linker_include_lib_options(
|
211
|
-
a_target, a_linker_lists.libs )
|
212
|
-
|
213
|
-
result << port_specific_dll_link_options(
|
214
|
-
a_dll_name, a_dll_info, a_linker_lists, a_target )
|
215
|
-
|
216
|
-
return [ "#{linker_name} #{result}" ]
|
217
|
-
end
|
218
|
-
|
219
|
-
# See description at MxxRu::Cpp::Toolset#make_dll_requirements.
|
220
|
-
def make_dll_requirements(
|
221
|
-
a_dll_name,
|
222
|
-
a_dll_info,
|
223
|
-
a_linker_lists,
|
224
|
-
a_target )
|
225
|
-
|
226
|
-
result = DllRequirements.new
|
227
|
-
|
228
|
-
# On UNIX all requirements are dependencies.
|
229
|
-
|
230
|
-
# This library, as a first one.
|
231
|
-
result.add_libs( [
|
232
|
-
BinaryLibrary.new( a_dll_info.link_name, BinaryLibrary::SHARED ) ] )
|
233
|
-
result.add_lib_paths( [ a_dll_info.link_path ] )
|
234
|
-
|
235
|
-
# And all required libraries.
|
236
|
-
a_target.mxx_required_prjs.each { |d|
|
237
|
-
if d.kind_of?( MxxRu::BinaryTarget )
|
238
|
-
result.add_libs( d.mxx_required_libs )
|
239
|
-
result.add_lib_paths( d.mxx_required_lib_paths )
|
240
|
-
end
|
241
|
-
}
|
242
|
-
|
243
|
-
return result
|
244
|
-
end
|
245
|
-
|
246
|
-
# See description at MxxRu::Cpp::Toolset#exe_file_name.
|
247
|
-
def exe_file_name( source_name )
|
248
|
-
return source_name
|
249
|
-
end
|
250
|
-
|
251
|
-
# See description at MxxRu::Cpp::Toolset#make_exe_command_lines.
|
252
|
-
def make_exe_command_lines(
|
253
|
-
a_exe_name,
|
254
|
-
a_exe_info,
|
255
|
-
a_linker_lists,
|
256
|
-
a_target )
|
257
|
-
|
258
|
-
result = "#{a_linker_lists.linker_options.join(' ')} " +
|
259
|
-
"-o #{a_exe_name} "
|
260
|
-
|
261
|
-
a_linker_lists.lib_paths.each { |p| result << "-L#{p} " }
|
262
|
-
|
263
|
-
result << "#{a_linker_lists.objs.join(' ')} "
|
264
|
-
result << make_linker_include_lib_options(
|
265
|
-
a_target, a_linker_lists.libs )
|
266
|
-
|
267
|
-
result << port_specific_exe_link_options(
|
268
|
-
a_exe_name, a_exe_info, a_linker_lists, a_target )
|
269
|
-
|
270
|
-
return [ "#{linker_name} #{result}" ]
|
271
|
-
end
|
272
|
-
|
273
|
-
# Make fragment of linker command line which contains names
|
274
|
-
# of included libraries.
|
275
|
-
#
|
276
|
-
# [_target_] target for that this fragment will be prepared.
|
277
|
-
# [_libs_] list of BinaryLibrary with required libraries.
|
278
|
-
def make_linker_include_lib_options( target, libs )
|
279
|
-
libs.inject( '' ) { |r, l|
|
280
|
-
r <<
|
281
|
-
}
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
#
|
296
|
-
#
|
297
|
-
#
|
298
|
-
#
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
#
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
a_dll_info
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
# Return string
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
end # module Cpp
|
422
|
-
|
423
|
-
end # module MxxRu
|
424
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 1996-2004, Yauheni Akhotnikau
|
3
|
+
# Copyright (c) 2004-2006, JSC Intervale
|
4
|
+
# Copyright (c) 2006, The Mxx_ru Project
|
5
|
+
# All rights reserved.
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
8
|
+
# are permitted provided that the following conditions are met:
|
9
|
+
#
|
10
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
# this list of conditions and the following disclaimer in the documentation
|
14
|
+
# and/or other materials provided with the distribution.
|
15
|
+
# 3. The name of the author may not be used to endorse or promote products derived
|
16
|
+
# from this software without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
19
|
+
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20
|
+
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
|
21
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
+
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
#++
|
28
|
+
|
29
|
+
require 'mxx_ru/binary_library'
|
30
|
+
require 'mxx_ru/cpp/toolset'
|
31
|
+
|
32
|
+
module MxxRu
|
33
|
+
module Cpp
|
34
|
+
module Toolsets
|
35
|
+
|
36
|
+
# Toolset implemetation for GCC compiler.
|
37
|
+
class GccFamily < MxxRu::Cpp::Toolset
|
38
|
+
public
|
39
|
+
# Tag name, indicates gcc port beeing used.
|
40
|
+
GCC_PORT_TAG = "gcc_port"
|
41
|
+
# GCC_PORT: GCC on Unix/Linux.
|
42
|
+
GCC_PORT_UNIX = "unix"
|
43
|
+
# GCC_PORT: MinGW on Win32.
|
44
|
+
GCC_PORT_MINGW = "mingw"
|
45
|
+
# GCC_PORT: Cygwin on Win32.
|
46
|
+
GCC_PORT_CYGWIN = "cygwin"
|
47
|
+
|
48
|
+
def initialize( a_name )
|
49
|
+
super( a_name )
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns C compiler name.
|
53
|
+
def c_compiler_name
|
54
|
+
return "gcc"
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns C++ compiler name.
|
58
|
+
def cpp_compiler_name
|
59
|
+
return "g++"
|
60
|
+
end
|
61
|
+
|
62
|
+
# Returns linker name.
|
63
|
+
def linker_name
|
64
|
+
return "g++"
|
65
|
+
end
|
66
|
+
|
67
|
+
# Returns librarian name.
|
68
|
+
def librarian_name
|
69
|
+
return "ar"
|
70
|
+
end
|
71
|
+
|
72
|
+
# See description at MxxRu::Cpp::Toolset#setup_mandatory_options.
|
73
|
+
def setup_mandatory_options( target )
|
74
|
+
|
75
|
+
if RUNTIME_DEBUG == target.mxx_runtime_mode
|
76
|
+
target.compiler_option( "-g" )
|
77
|
+
target.linker_option( "-g" )
|
78
|
+
elsif RUNTIME_RELEASE == target.mxx_runtime_mode
|
79
|
+
target.define( "NDEBUG" )
|
80
|
+
target.linker_option( "-s" )
|
81
|
+
if OPTIM_SIZE == target.mxx_optimization
|
82
|
+
target.compiler_option( "-Os" )
|
83
|
+
else
|
84
|
+
target.compiler_option( "-O2" )
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
if RTTI_DISABLED == target.mxx_rtti_mode
|
89
|
+
target.cpp_compiler_option( "-fno-rtti" )
|
90
|
+
end
|
91
|
+
|
92
|
+
if RTL_STATIC == target.mxx_rtl_mode
|
93
|
+
target.linker_option( "--static-libgcc" )
|
94
|
+
else
|
95
|
+
target.linker_option( "--shared-libgcc" )
|
96
|
+
end
|
97
|
+
|
98
|
+
# This is not required on mswin platform.
|
99
|
+
if target.target_type.name == DllTargetType::TYPE
|
100
|
+
target.compiler_option( "-fPIC" )
|
101
|
+
end
|
102
|
+
|
103
|
+
# If C++ files are exist, linker should use stdc++ library.
|
104
|
+
if target.mxx_cpp_files.size
|
105
|
+
# target.lib( "stdc++" )
|
106
|
+
end
|
107
|
+
|
108
|
+
target.mxx_all_defines.each { |d|
|
109
|
+
target.compiler_option( "-D" + d )
|
110
|
+
}
|
111
|
+
|
112
|
+
target.mxx_all_include_paths.each { |p|
|
113
|
+
target.compiler_option( "-I" + p )
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
# See description at MxxRu::Cpp::Toolset#obj_file_ext.
|
118
|
+
def obj_file_ext
|
119
|
+
return ".o"
|
120
|
+
end
|
121
|
+
|
122
|
+
# See description at MxxRu::Cpp::Toolset#make_c_obj_command_lines.
|
123
|
+
def make_c_obj_command_lines(
|
124
|
+
obj_name,
|
125
|
+
source_name,
|
126
|
+
compiler_options,
|
127
|
+
target )
|
128
|
+
|
129
|
+
cmd_line = "-c -o #{obj_name} " +
|
130
|
+
"#{compiler_options.join(' ')} #{source_name}"
|
131
|
+
|
132
|
+
return [ "#{c_compiler_name} #{cmd_line}" ]
|
133
|
+
end
|
134
|
+
|
135
|
+
# See description at MxxRu::Cpp::Toolset#make_c_obj_command_lines.
|
136
|
+
def make_cpp_obj_command_lines(
|
137
|
+
obj_name,
|
138
|
+
source_name,
|
139
|
+
compiler_options,
|
140
|
+
target )
|
141
|
+
|
142
|
+
cmd_line = "-c -o #{obj_name} " +
|
143
|
+
"#{compiler_options.join(' ')} #{source_name}"
|
144
|
+
|
145
|
+
return [ "#{cpp_compiler_name} #{cmd_line}" ]
|
146
|
+
end
|
147
|
+
|
148
|
+
# See description at MxxRu::Cpp::Toolset#lib_file_name.
|
149
|
+
def lib_file_name( source_name )
|
150
|
+
return "lib" + source_name + ".a"
|
151
|
+
end
|
152
|
+
|
153
|
+
# See description at MxxRu::Cpp::Toolset#lib_link_name.
|
154
|
+
def lib_link_name( source_name )
|
155
|
+
return source_name
|
156
|
+
end
|
157
|
+
|
158
|
+
# See description at MxxRu::Cpp::Toolset#make_lib_command_lines.
|
159
|
+
def make_lib_command_lines(
|
160
|
+
lib_name,
|
161
|
+
obj_files,
|
162
|
+
librarian_options,
|
163
|
+
target )
|
164
|
+
|
165
|
+
result = "-r #{librarian_options.join(' ')} " +
|
166
|
+
"#{lib_name} #{obj_files.join(' ')}"
|
167
|
+
|
168
|
+
return [ "#{librarian_name} #{result}" ]
|
169
|
+
end
|
170
|
+
|
171
|
+
# See description at MxxRu::Cpp::Toolset#dll_file_name.
|
172
|
+
def dll_file_name( source_name )
|
173
|
+
return "lib" + source_name + ".so"
|
174
|
+
end
|
175
|
+
|
176
|
+
# See description at MxxRu::Cpp::Toolset#implib_link_name.
|
177
|
+
def implib_link_name(
|
178
|
+
dll_real_name,
|
179
|
+
target )
|
180
|
+
|
181
|
+
# Target name should be passed to linker on UNIX platform
|
182
|
+
return lib_link_name(
|
183
|
+
File.basename( target.mxx_target_name ) )
|
184
|
+
end
|
185
|
+
|
186
|
+
# See description at MxxRu::Cpp::Toolset#implib_link_path.
|
187
|
+
def implib_link_path(
|
188
|
+
dll_real_name,
|
189
|
+
dll_real_path,
|
190
|
+
target )
|
191
|
+
|
192
|
+
# DLL name is the import library name on UNIX platform.
|
193
|
+
return dll_real_path
|
194
|
+
end
|
195
|
+
|
196
|
+
# See description at MxxRu::Cpp::Toolset#make_dll_command_lines.
|
197
|
+
def make_dll_command_lines(
|
198
|
+
a_dll_name,
|
199
|
+
a_dll_info,
|
200
|
+
a_linker_lists,
|
201
|
+
a_target )
|
202
|
+
|
203
|
+
result = "-shared " +
|
204
|
+
"#{a_linker_lists.linker_options.join(' ')} " +
|
205
|
+
"-o #{a_dll_name} "
|
206
|
+
|
207
|
+
a_linker_lists.lib_paths.each { |p| result << "-L#{p} " }
|
208
|
+
|
209
|
+
result << "#{a_linker_lists.objs.join(' ')} "
|
210
|
+
result << make_linker_include_lib_options(
|
211
|
+
a_target, a_linker_lists.libs )
|
212
|
+
|
213
|
+
result << port_specific_dll_link_options(
|
214
|
+
a_dll_name, a_dll_info, a_linker_lists, a_target )
|
215
|
+
|
216
|
+
return [ "#{linker_name} #{result}" ]
|
217
|
+
end
|
218
|
+
|
219
|
+
# See description at MxxRu::Cpp::Toolset#make_dll_requirements.
|
220
|
+
def make_dll_requirements(
|
221
|
+
a_dll_name,
|
222
|
+
a_dll_info,
|
223
|
+
a_linker_lists,
|
224
|
+
a_target )
|
225
|
+
|
226
|
+
result = DllRequirements.new
|
227
|
+
|
228
|
+
# On UNIX all requirements are dependencies.
|
229
|
+
|
230
|
+
# This library, as a first one.
|
231
|
+
result.add_libs( [
|
232
|
+
BinaryLibrary.new( a_dll_info.link_name, BinaryLibrary::SHARED ) ] )
|
233
|
+
result.add_lib_paths( [ a_dll_info.link_path ] )
|
234
|
+
|
235
|
+
# And all required libraries.
|
236
|
+
a_target.mxx_required_prjs.each { |d|
|
237
|
+
if d.kind_of?( MxxRu::BinaryTarget )
|
238
|
+
result.add_libs( d.mxx_required_libs )
|
239
|
+
result.add_lib_paths( d.mxx_required_lib_paths )
|
240
|
+
end
|
241
|
+
}
|
242
|
+
|
243
|
+
return result
|
244
|
+
end
|
245
|
+
|
246
|
+
# See description at MxxRu::Cpp::Toolset#exe_file_name.
|
247
|
+
def exe_file_name( source_name )
|
248
|
+
return source_name
|
249
|
+
end
|
250
|
+
|
251
|
+
# See description at MxxRu::Cpp::Toolset#make_exe_command_lines.
|
252
|
+
def make_exe_command_lines(
|
253
|
+
a_exe_name,
|
254
|
+
a_exe_info,
|
255
|
+
a_linker_lists,
|
256
|
+
a_target )
|
257
|
+
|
258
|
+
result = "#{a_linker_lists.linker_options.join(' ')} " +
|
259
|
+
"-o #{a_exe_name} "
|
260
|
+
|
261
|
+
a_linker_lists.lib_paths.each { |p| result << "-L#{p} " }
|
262
|
+
|
263
|
+
result << "#{a_linker_lists.objs.join(' ')} "
|
264
|
+
result << make_linker_include_lib_options(
|
265
|
+
a_target, a_linker_lists.libs )
|
266
|
+
|
267
|
+
result << port_specific_exe_link_options(
|
268
|
+
a_exe_name, a_exe_info, a_linker_lists, a_target )
|
269
|
+
|
270
|
+
return [ "#{linker_name} #{result}" ]
|
271
|
+
end
|
272
|
+
|
273
|
+
# Make fragment of linker command line which contains names
|
274
|
+
# of included libraries.
|
275
|
+
#
|
276
|
+
# [_target_] target for that this fragment will be prepared.
|
277
|
+
# [_libs_] list of BinaryLibrary with required libraries.
|
278
|
+
def make_linker_include_lib_options( target, libs )
|
279
|
+
all_libs = libs.inject( '' ) { |r, l|
|
280
|
+
r << '-l' << port_specific_lib_name_checker( l.name ) << ' '
|
281
|
+
}
|
282
|
+
"-Wl,--start-group #{all_libs} -Wl,--end-group "
|
283
|
+
end
|
284
|
+
|
285
|
+
# Return string containing port-specific linker option for DLL linking.
|
286
|
+
#
|
287
|
+
# All parameters are similar to make_dll_command_lines parameters.
|
288
|
+
#
|
289
|
+
# Return empty string in a base class.
|
290
|
+
def port_specific_dll_link_options(
|
291
|
+
a_dll_name, a_dll_info, a_linker_lists, a_target )
|
292
|
+
return ""
|
293
|
+
end
|
294
|
+
|
295
|
+
# Return string containing port-specific linker option for EXE linking.
|
296
|
+
#
|
297
|
+
# All parameters are similar to make_exe_command_lines parameters.
|
298
|
+
#
|
299
|
+
# Return empty string in a base class.
|
300
|
+
def port_specific_exe_link_options(
|
301
|
+
a_exe_name, a_exe_info, a_linker_lists, a_target )
|
302
|
+
return ""
|
303
|
+
end
|
304
|
+
|
305
|
+
# Return correct name of library to be given for linker.
|
306
|
+
def port_specific_lib_name_checker(library_name)
|
307
|
+
library_name
|
308
|
+
end
|
309
|
+
|
310
|
+
end # class GccFamily
|
311
|
+
|
312
|
+
# For compatibility with previous versions.
|
313
|
+
Gcc_family = GccFamily
|
314
|
+
|
315
|
+
# Toolset implemetation for GCC compiler for Win32.
|
316
|
+
# This class is a base class for both MinGW and Cygwin
|
317
|
+
class GccMswinFamily < GccFamily
|
318
|
+
public
|
319
|
+
|
320
|
+
# See description at MxxRu::Cpp::Toolset#exe_file_name.
|
321
|
+
def exe_file_name( source_name )
|
322
|
+
return source_name + ".exe"
|
323
|
+
end
|
324
|
+
|
325
|
+
# See description at MxxRu::Cpp::Toolset#clean_dll_specific_files.
|
326
|
+
#
|
327
|
+
# Delete import library if exists.
|
328
|
+
def clean_dll_specific_files(
|
329
|
+
a_dll_file,
|
330
|
+
a_dll_info,
|
331
|
+
a_target )
|
332
|
+
|
333
|
+
# Delete import library if exists.
|
334
|
+
if nil != a_dll_info.link_name
|
335
|
+
implib_name = File.join( [ a_dll_info.link_path,
|
336
|
+
lib_file_name( a_dll_info.link_name ) ] )
|
337
|
+
MxxRu::Util::delete_file( implib_name )
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
# See description at MxxRu::Cpp::Toolset#implib_link_name.
|
342
|
+
def implib_link_name(
|
343
|
+
dll_real_name,
|
344
|
+
target )
|
345
|
+
|
346
|
+
# It's required to pass import library name to linker on mswin platform
|
347
|
+
if nil != target.mxx_implib_path
|
348
|
+
return lib_link_name( target.mxx_target_name )
|
349
|
+
end
|
350
|
+
|
351
|
+
return nil
|
352
|
+
end
|
353
|
+
|
354
|
+
# See description at MxxRu::Cpp::Toolset#implib_link_path.
|
355
|
+
def implib_link_path(
|
356
|
+
dll_real_name,
|
357
|
+
dll_real_path,
|
358
|
+
target )
|
359
|
+
return target.mxx_obj_placement.get_lib(
|
360
|
+
target.mxx_implib_path, self, target )
|
361
|
+
end
|
362
|
+
|
363
|
+
# See description at MxxRu::Cpp::Toolset#make_dll_requirements.
|
364
|
+
def make_dll_requirements(
|
365
|
+
a_dll_name,
|
366
|
+
a_dll_info,
|
367
|
+
a_linker_lists,
|
368
|
+
a_target )
|
369
|
+
|
370
|
+
result = DllRequirements.new
|
371
|
+
|
372
|
+
# Dependencies are exists only if import library is present.
|
373
|
+
if nil != a_dll_info.link_name
|
374
|
+
result.add_libs( [ a_dll_info.link_name ] )
|
375
|
+
result.add_lib_paths( [ a_dll_info.link_path ] )
|
376
|
+
end
|
377
|
+
|
378
|
+
return result
|
379
|
+
end
|
380
|
+
|
381
|
+
# Return string containing port-specific linker option for DLL linking.
|
382
|
+
#
|
383
|
+
# All parameters are similar to make_dll_command_lines parameters.
|
384
|
+
#
|
385
|
+
# Return empty string in a base class.
|
386
|
+
def port_specific_dll_link_options(
|
387
|
+
a_dll_name, a_dll_info, a_linker_lists, a_target )
|
388
|
+
# Build import library if it's required.
|
389
|
+
if nil != a_dll_info.link_name
|
390
|
+
full_lib_name = File.join( [ a_dll_info.link_path,
|
391
|
+
lib_file_name( a_dll_info.link_name ) ] )
|
392
|
+
|
393
|
+
return "-Wl,--out-implib=#{full_lib_name}" +
|
394
|
+
",--export-all-symbols"
|
395
|
+
end
|
396
|
+
|
397
|
+
return ""
|
398
|
+
end
|
399
|
+
|
400
|
+
# Checks library name for suffix '.lib' and return name without
|
401
|
+
# that suffix.
|
402
|
+
def port_specific_lib_name_checker(library_name)
|
403
|
+
if /\.lib$/i =~ library_name
|
404
|
+
MxxRu::Util::remove_file_ext(library_name)
|
405
|
+
else
|
406
|
+
library_name
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
end # class GccMswinFamily
|
411
|
+
|
412
|
+
# For compatibility with previous versions.
|
413
|
+
Gcc_mswin_family = GccMswinFamily
|
414
|
+
|
415
|
+
end # module Toolsets
|
416
|
+
|
417
|
+
end # module Cpp
|
418
|
+
|
419
|
+
end # module MxxRu
|
420
|
+
|