Mxx_ru 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/COPYING +26 -0
  2. data/NEWS +52 -0
  3. data/README +21 -0
  4. data/Rakefile +32 -0
  5. data/examples/exe_and_lib/main.cpp +15 -0
  6. data/examples/exe_and_lib/prj.rb +11 -0
  7. data/examples/exe_and_lib/say.cpp +13 -0
  8. data/examples/exe_and_lib/say.hpp +11 -0
  9. data/examples/exe_and_lib/say.rb +7 -0
  10. data/examples/exe_dll_lib/inout.cpp +15 -0
  11. data/examples/exe_dll_lib/inout.hpp +26 -0
  12. data/examples/exe_dll_lib/inout.rb +18 -0
  13. data/examples/exe_dll_lib/main.cpp +23 -0
  14. data/examples/exe_dll_lib/prj.rb +11 -0
  15. data/examples/exe_dll_lib/say.cpp +13 -0
  16. data/examples/exe_dll_lib/say.hpp +12 -0
  17. data/examples/exe_dll_lib/say.rb +9 -0
  18. data/examples/exe_dll_lib_2/build.rb +7 -0
  19. data/examples/exe_dll_lib_2/inout/inout.cpp +15 -0
  20. data/examples/exe_dll_lib_2/inout/inout.hpp +26 -0
  21. data/examples/exe_dll_lib_2/inout/prj.rb +16 -0
  22. data/examples/exe_dll_lib_2/main/main.cpp +23 -0
  23. data/examples/exe_dll_lib_2/main/prj.rb +9 -0
  24. data/examples/exe_dll_lib_2/say/prj.rb +8 -0
  25. data/examples/exe_dll_lib_2/say/say.cpp +13 -0
  26. data/examples/exe_dll_lib_2/say/say.hpp +12 -0
  27. data/examples/simple_exe/main.cpp +26 -0
  28. data/examples/simple_exe/prj.rb +7 -0
  29. data/lib/mxx_ru/abstract_target.rb +283 -0
  30. data/lib/mxx_ru/binary_target.rb +89 -0
  31. data/lib/mxx_ru/binary_unittest.rb +130 -0
  32. data/lib/mxx_ru/cpp/analyzer.rb +230 -0
  33. data/lib/mxx_ru/cpp/composite.rb +106 -0
  34. data/lib/mxx_ru/cpp/detect_toolset.rb +122 -0
  35. data/lib/mxx_ru/cpp/mode.rb +85 -0
  36. data/lib/mxx_ru/cpp/obj_placement.rb +321 -0
  37. data/lib/mxx_ru/cpp/qt.rb +333 -0
  38. data/lib/mxx_ru/cpp/rucodegen.rb +114 -0
  39. data/lib/mxx_ru/cpp/source_file.rb +71 -0
  40. data/lib/mxx_ru/cpp/target.rb +1371 -0
  41. data/lib/mxx_ru/cpp/toolset.rb +1029 -0
  42. data/lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb +52 -0
  43. data/lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb +451 -0
  44. data/lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb +56 -0
  45. data/lib/mxx_ru/cpp/toolsets/c89_nsk.rb +56 -0
  46. data/lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb +273 -0
  47. data/lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb +54 -0
  48. data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +382 -0
  49. data/lib/mxx_ru/cpp/toolsets/gcc_linux.rb +60 -0
  50. data/lib/mxx_ru/cpp/toolsets/gcc_mingw.rb +144 -0
  51. data/lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb +87 -0
  52. data/lib/mxx_ru/cpp/toolsets/vc7.rb +62 -0
  53. data/lib/mxx_ru/cpp/toolsets/vc8.rb +452 -0
  54. data/lib/mxx_ru/cpp/toolsets/vc_family.rb +428 -0
  55. data/lib/mxx_ru/cpp.rb +36 -0
  56. data/lib/mxx_ru/ex.rb +134 -0
  57. data/lib/mxx_ru/makestyle_generator.rb +138 -0
  58. data/lib/mxx_ru/textfile_unittest.rb +284 -0
  59. data/lib/mxx_ru/util.rb +258 -0
  60. data/tests/c/pcre/chartables.c +183 -0
  61. data/tests/c/pcre/config.h +99 -0
  62. data/tests/c/pcre/dftables.c +167 -0
  63. data/tests/c/pcre/get.c +349 -0
  64. data/tests/c/pcre/internal.h +677 -0
  65. data/tests/c/pcre/maketables.c +140 -0
  66. data/tests/c/pcre/pcre.c +8304 -0
  67. data/tests/c/pcre/pcre.h +193 -0
  68. data/tests/c/pcre/pcre.rb +14 -0
  69. data/tests/c/pcre/pcredemo.c +316 -0
  70. data/tests/c/pcre/pcregrep.c +642 -0
  71. data/tests/c/pcre/pcreposix.c +305 -0
  72. data/tests/c/pcre/pcreposix.h +88 -0
  73. data/tests/c/pcre/pcretest.c +1483 -0
  74. data/tests/c/pcre/perltest +211 -0
  75. data/tests/c/pcre/printint.c +360 -0
  76. data/tests/c/pcre/study.c +472 -0
  77. data/tests/cpp/mswin_res_dll/build.rb +14 -0
  78. data/tests/cpp/mswin_res_dll/dll.cpp +17 -0
  79. data/tests/cpp/mswin_res_dll/dll.rb +30 -0
  80. data/tests/cpp/mswin_res_dll/dll.rc +48 -0
  81. data/tests/cpp/mswin_res_dll/h/dll.hpp +8 -0
  82. data/tests/cpp/mswin_res_dll/h/res.h +3 -0
  83. data/tests/cpp/mswin_res_dll/main.cpp +13 -0
  84. data/tests/cpp/mswin_res_dll/main.rb +20 -0
  85. data/tests/cpp/mswin_res_dll/res/tree_fol.bmp +0 -0
  86. data/tests/cpp/mswin_res_dll/res/tree_state_1.bmp +0 -0
  87. data/tests/cpp/mswin_res_dll/res/tree_state_2.bmp +0 -0
  88. data/tests/cpp/mswin_res_exe/build.rb +23 -0
  89. data/tests/cpp/mswin_res_exe/h/res.h +3 -0
  90. data/tests/cpp/mswin_res_exe/main.cpp +17 -0
  91. data/tests/cpp/mswin_res_exe/main.rc +48 -0
  92. data/tests/cpp/mswin_res_exe/res/tree_fol.bmp +0 -0
  93. data/tests/cpp/mswin_res_exe/res/tree_state_1.bmp +0 -0
  94. data/tests/cpp/mswin_res_exe/res/tree_state_2.bmp +0 -0
  95. data/tests/cpp/rucodegen/host_config.cpp +20 -0
  96. data/tests/cpp/rucodegen/host_config.rb +14 -0
  97. data/tests/cpp/rucodegen/impl/conn_params.cpp +7 -0
  98. data/tests/cpp/rucodegen/impl/conn_params.rb +14 -0
  99. data/tests/cpp/rucodegen/impl/h/conn_params.hpp +10 -0
  100. data/tests/cpp/rucodegen/prj.rb +17 -0
  101. data/tests/cpp/textfile_unittest/build.rb +8 -0
  102. data/tests/cpp/textfile_unittest/etalons/out_0.txt +0 -0
  103. data/tests/cpp/textfile_unittest/etalons/out_1.txt +1 -0
  104. data/tests/cpp/textfile_unittest/etalons/out_128.txt +128 -0
  105. data/tests/cpp/textfile_unittest/main.cpp +89 -0
  106. data/tests/cpp/textfile_unittest/prj.rb +8 -0
  107. data/tests/cpp/textfile_unittest/prj.ut.rb +18 -0
  108. data/tests/cpp/toolset_name.rb +6 -0
  109. data/tests/cpp/vc_cleanup/cout.log +72 -0
  110. data/tests/cpp/vc_cleanup/dll_hi.cpp +5 -0
  111. data/tests/cpp/vc_cleanup/exe_hi.cpp +10 -0
  112. data/tests/cpp/vc_cleanup/lib_hi.cpp +5 -0
  113. data/tests/cpp/vc_cleanup/prj_dll_no_implib.rb +10 -0
  114. data/tests/cpp/vc_cleanup/prj_dll_no_implib_simple_target_root.rb +11 -0
  115. data/tests/cpp/vc_cleanup/prj_dll_with_implib.rb +11 -0
  116. data/tests/cpp/vc_cleanup/prj_dll_with_implib_simple_target_root.rb +14 -0
  117. data/tests/cpp/vc_cleanup/prj_exe_no_implib.rb +10 -0
  118. data/tests/cpp/vc_cleanup/prj_exe_no_implib_simple_target_root.rb +11 -0
  119. data/tests/cpp/vc_cleanup/prj_lib.rb +10 -0
  120. data/tests/cpp/vc_cleanup/prj_lib_with_simple_target_root.rb +11 -0
  121. data/tests/cpp/vc_cleanup/tc_vc_cleanup.rb +60 -0
  122. data/tests/mxx_ru/change_default_value/ignoring_by_build_root/build.rb +8 -0
  123. data/tests/mxx_ru/change_default_value/ignoring_by_build_root/child_1.rb +5 -0
  124. data/tests/mxx_ru/change_default_value/ignoring_by_child_1/build.rb +7 -0
  125. data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_1.rb +5 -0
  126. data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_2.rb +5 -0
  127. data/tests/mxx_ru/change_default_value/ok/build.rb +8 -0
  128. data/tests/mxx_ru/change_default_value/ok/child_1.rb +8 -0
  129. data/tests/mxx_ru/tc_makestyle_generator.rb +117 -0
  130. data/tests/mxx_ru/vc8/tc_actual_manifest.rb +230 -0
  131. data/tests/mxx_ru/vc8/tc_append_mt_commands.rb +104 -0
  132. data/tests/mxx_ru/vc8/tc_default_manifest.rb +17 -0
  133. data/tests/mxx_ru/vc8/tc_define_manifest.rb +173 -0
  134. data/tests/mxx_ru/vc8/tc_drop_default_manifest.rb +16 -0
  135. data/tests/mxx_ru/vc8/tc_invalid_params.rb +81 -0
  136. data/tests/mxx_ru/vc8/ts_vc8.rb +10 -0
  137. data/tests/qt/aclock/aclock.cpp +148 -0
  138. data/tests/qt/aclock/aclock.h +45 -0
  139. data/tests/qt/aclock/main.cpp +28 -0
  140. data/tests/qt/aclock/prj.rb +21 -0
  141. data/tests/qt/iconview/main.cpp +76 -0
  142. data/tests/qt/iconview/prj.rb +21 -0
  143. data/tests/qt/toplevel/main.cpp +9 -0
  144. data/tests/qt/toplevel/options.ui +587 -0
  145. data/tests/qt/toplevel/options.ui.h +98 -0
  146. data/tests/qt/toplevel/prj.rb +21 -0
  147. metadata +241 -0
@@ -0,0 +1,52 @@
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/bcc_win32_family'
30
+
31
+ module Mxx_ru
32
+ module Cpp
33
+ module Toolsets
34
+
35
+ # Toolset implemetation for Borland C++ 5.*
36
+ class Bcc5 < Mxx_ru::Cpp::Toolsets::Bcc_win32_family
37
+ public
38
+ def initialize( a_name = "bcc" )
39
+ super( a_name )
40
+
41
+ setup_tag( "ver_hi", "5" )
42
+ setup_tag( "ver_lo", "6" )
43
+ end
44
+ end # class Bcc5
45
+
46
+ end # module Toolsets
47
+
48
+ end # module Cpp
49
+
50
+ end # module Mxx_ru
51
+
52
+ Mxx_ru::Cpp::setup_toolset( Mxx_ru::Cpp::Toolsets::Bcc5.new )
@@ -0,0 +1,451 @@
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/toolset'
30
+
31
+ module Mxx_ru
32
+ module Cpp
33
+ module Toolsets
34
+
35
+ # Toolset implemetation for Borland C++ on Win32 platform.
36
+ class Bcc_win32_family < Mxx_ru::Cpp::Toolset
37
+ public
38
+ def initialize( a_name = "bcc" )
39
+ super( a_name )
40
+
41
+ setup_tag( "host_os", "mswin" )
42
+ setup_tag( "target_os", "mswin" )
43
+ end
44
+
45
+ # Returns compiler name.
46
+ def compiler_name
47
+ return "bcc32"
48
+ end
49
+
50
+ # Returns linker name.
51
+ def linker_name
52
+ return "ilink32"
53
+ end
54
+
55
+ # Returns librarian name.
56
+ def librarian_name
57
+ return "tlib"
58
+ end
59
+
60
+ # Returns resource compiler name.
61
+ def rc_name
62
+ return "brc32"
63
+ end
64
+
65
+ # Returns the name of import library creator.
66
+ def import_librarian_name
67
+ return "implib"
68
+ end
69
+
70
+ # See description at Mxx_ru::Cpp::Toolset#setup_mandatory_options.
71
+ def setup_mandatory_options( target )
72
+
73
+ # Disable warning: Parameter is never used.
74
+ target.compiler_option( "-w-par" )
75
+ # Disable warning: <ID> is assigned a value that is never used.
76
+ target.compiler_option( "-w-aus" )
77
+
78
+ # Turn all warnings on.
79
+ target.linker_option( "/w" )
80
+ # Don't generate state files (disable incremental linking).
81
+ target.linker_option( "/Gn" )
82
+ # Suppress creation of map file.
83
+ target.linker_option( "/x" )
84
+ # Suppress command line banner.
85
+ target.linker_option( "/q" )
86
+
87
+ if RUNTIME_DEBUG == target.mxx_runtime_mode
88
+ target.compiler_option( "-v" )
89
+ target.compiler_option( "-y" )
90
+ target.linker_option( "/v" )
91
+ elsif RUNTIME_RELEASE == target.mxx_runtime_mode
92
+ target.define( "NDEBUG" )
93
+ if OPTIM_SIZE == target.mxx_optimization
94
+ target.compiler_option( "-O1" )
95
+ else
96
+ target.compiler_option( "-O2" )
97
+ end
98
+ end
99
+
100
+ if RTTI_ENABLED == target.mxx_rtti_mode
101
+ target.cpp_compiler_option( "-RT" )
102
+ elsif RTTI_DISABLED == target.mxx_rtti_mode
103
+ target.cpp_compiler_option( "-RT-" )
104
+ end
105
+
106
+ if RTL_SHARED == target.mxx_rtl_mode
107
+ target.compiler_option( "-WR" )
108
+ end
109
+
110
+ if THREADING_MULTI == target.mxx_threading_mode
111
+ target.compiler_option( "-tWM" )
112
+ if RTL_SHARED == target.mxx_rtl_mode
113
+ target.lib( "cw32mti.lib" )
114
+ else
115
+ target.lib( "cw32mt.lib" )
116
+ end
117
+ else
118
+ if RTL_SHARED == target.mxx_rtl_mode
119
+ target.lib( "cw32i.lib" )
120
+ else
121
+ target.lib( "cw32.lib" )
122
+ end
123
+ end
124
+
125
+ if target.target_type.name == Dll_target_type::TYPE
126
+ target.compiler_option( "-WD" )
127
+ target.linker_option( "/Tpd" )
128
+ elsif target.target_type.name == Exe_target_type::TYPE
129
+ if SCREEN_WINDOW == target.mxx_screen_mode
130
+ target.linker_option( "/aa" )
131
+ else
132
+ target.linker_option( "/ap" )
133
+ end
134
+
135
+ target.linker_option( "/Tpe" )
136
+ end
137
+
138
+ target.lib( "import32.lib" )
139
+
140
+ if SCREEN_WINDOW == target.mxx_screen_mode
141
+ target.compiler_option( "-tW" )
142
+ else
143
+ target.compiler_option( "-tWC" )
144
+ end
145
+
146
+ # All defines and all include_path should be applied
147
+ # to resource compiler too.
148
+ target.mxx_all_defines.each { |d|
149
+ target.compiler_option( "-D" + d )
150
+ target.mswin_rc_option( "-d" + d )
151
+ }
152
+
153
+ target.mxx_all_include_paths.each { |p|
154
+ target.compiler_option( "-I" + p )
155
+ target.mswin_rc_option( "-i" + p )
156
+ }
157
+
158
+ # Resource compiler requires it's own options, too.
159
+ target.mxx_all_mswin_rc_defines.each { |d|
160
+ target.mswin_rc_option( "-d" + d )
161
+ }
162
+ target.mxx_all_mswin_rc_include_paths.each { |p|
163
+ target.mswin_rc_option( "-i" + p )
164
+ }
165
+
166
+ end
167
+
168
+ # See description at Mxx_ru::Cpp::Toolset#clean_dll_specific_files.
169
+ #
170
+ # If import library exists, delete it.
171
+ def clean_dll_specific_files(
172
+ a_dll_file,
173
+ a_dll_info,
174
+ a_target )
175
+
176
+ # If import library exists, delete it.
177
+ if nil != a_dll_info.link_name
178
+ implib_name = File.join(
179
+ [ a_dll_info.link_path, a_dll_info.link_name ] )
180
+ Mxx_ru::Util::delete_file( implib_name )
181
+ end
182
+
183
+ # TDS files also should be removed.
184
+ Mxx_ru::Util::delete_file( tds_file_name( a_dll_file ) )
185
+ end
186
+
187
+ # See description at Mxx_ru::Cpp::Toolset#clean_exe_specific_files.
188
+ def clean_exe_specific_files(
189
+ a_exe_file,
190
+ a_exe_info,
191
+ a_target )
192
+
193
+ Mxx_ru::Util::delete_file( tds_file_name( a_exe_file ) )
194
+ end
195
+
196
+ # See description at Mxx_ru::Cpp::Toolset#obj_file_ext.
197
+ def obj_file_ext
198
+ return ".obj"
199
+ end
200
+
201
+ # See description at Mxx_ru::Cpp::Toolset#make_c_obj_command_lines.
202
+ def make_c_obj_command_lines(
203
+ obj_name,
204
+ source_name,
205
+ compiler_options,
206
+ target )
207
+
208
+ tmpfile = Mxx_ru::Util::Tmp_files.instance.create(
209
+ "-c -P- -o#{obj_name} " +
210
+ "#{compiler_options.join(' ')} #{source_name}" )
211
+
212
+ return [ "#{compiler_name} @#{tmpfile}" ]
213
+ end
214
+
215
+ # See description at Mxx_ru::Cpp::Toolset#make_c_obj_command_lines.
216
+ def make_cpp_obj_command_lines(
217
+ obj_name,
218
+ source_name,
219
+ compiler_options,
220
+ target )
221
+
222
+ tmpfile = Mxx_ru::Util::Tmp_files.instance.create(
223
+ "-c -P -o#{obj_name} " +
224
+ "#{compiler_options.join(' ')} #{source_name}" )
225
+
226
+ return [ "#{compiler_name} @#{tmpfile}" ]
227
+ end
228
+
229
+ # See description at Mxx_ru::Cpp::Toolset#mswin_res_file_name.
230
+ def mswin_res_file_name( source_name )
231
+ return source_name + ".res"
232
+ end
233
+
234
+ # See description at Mxx_ru::Cpp::Toolset#make_mswin_res_command_lines.
235
+ def make_mswin_res_command_lines(
236
+ res_name,
237
+ rc_file,
238
+ rc_options,
239
+ target )
240
+
241
+ return [ "#{rc_name} " +
242
+ "#{rc_options.join(' ')} -r " +
243
+ "-fo#{res_name} #{rc_file}" ]
244
+ end
245
+
246
+ # See description at Mxx_ru::Cpp::Toolset#lib_file_name.
247
+ def lib_file_name( source_name )
248
+ return source_name + ".lib"
249
+ end
250
+
251
+ # See description at Mxx_ru::Cpp::Toolset#lib_link_name.
252
+ def lib_link_name( source_name )
253
+ return lib_file_name( source_name )
254
+ end
255
+
256
+ # See description at Mxx_ru::Cpp::Toolset#make_lib_command_lines.
257
+ def make_lib_command_lines(
258
+ lib_name,
259
+ obj_files,
260
+ librarian_options,
261
+ target )
262
+
263
+ obj_files_commands = String.new
264
+ obj_files.each { |o|
265
+ obj_files_commands += "-+\"#{unix2win(o)}\" "
266
+ }
267
+
268
+ tmpfile = Mxx_ru::Util::Tmp_files.instance.create(
269
+ "#{librarian_options.join(' ')} " +
270
+ "\"#{unix2win(lib_name)}\" " +
271
+ "#{obj_files_commands}" )
272
+
273
+ return [ "#{librarian_name} @#{tmpfile}" ]
274
+ end
275
+
276
+ # See description at Mxx_ru::Cpp::Toolset#dll_file_name.
277
+ def dll_file_name( source_name )
278
+ return source_name + ".dll"
279
+ end
280
+
281
+ # See description at Mxx_ru::Cpp::Toolset#implib_link_name.
282
+ def implib_link_name(
283
+ dll_real_name,
284
+ target )
285
+
286
+ # Import library name should be defined explicitly for Visual C++
287
+ if nil != target.mxx_implib_path
288
+ return lib_file_name( target.mxx_target_name )
289
+ end
290
+
291
+ return nil
292
+ end
293
+
294
+ # See description at Mxx_ru::Cpp::Toolset#implib_link_path.
295
+ #
296
+ # Returns a value, based on
297
+ # Mxx_ru::Cpp::Target#mxx_implib_path.
298
+ def implib_link_path(
299
+ dll_real_name,
300
+ dll_real_path,
301
+ target )
302
+ return target.mxx_obj_placement.get_lib(
303
+ target.mxx_implib_path, self, target )
304
+ end
305
+
306
+ # See description at Mxx_ru::Cpp::Toolset#make_dll_command_lines.
307
+ def make_dll_command_lines(
308
+ a_dll_name,
309
+ a_dll_info,
310
+ a_linker_lists,
311
+ a_target )
312
+
313
+ result = Array.new
314
+
315
+ response_file = generate_linker_respfile(
316
+ a_dll_name, "c0d32.obj", a_linker_lists )
317
+
318
+ result << "#{linker_name} @#{response_file}"
319
+
320
+ if nil != a_dll_info.link_name
321
+ implib_name = File.join( [ a_dll_info.link_path,
322
+ a_dll_info.link_name ] )
323
+ result << "#{import_librarian_name} #{implib_name} " +
324
+ "#{a_dll_name}"
325
+ end
326
+
327
+ if RUNTIME_DEBUG != a_target.mxx_runtime_mode
328
+ result << "if exist #{a_dll_name} del " +
329
+ "#{tds_file_name(a_dll_name)}"
330
+ end
331
+
332
+ return result
333
+ end
334
+
335
+ # See description at Mxx_ru::Cpp::Toolset#make_dll_requirements.
336
+ def make_dll_requirements(
337
+ a_dll_name,
338
+ a_dll_info,
339
+ a_linker_lists,
340
+ a_target )
341
+
342
+ result = Dll_requirements.new
343
+
344
+ # Dependency is exists only if import library is present.
345
+ if nil != a_dll_info.link_name
346
+ result.add_libs( [ a_dll_info.link_name ] )
347
+ result.add_lib_paths( [ a_dll_info.link_path ] )
348
+ end
349
+
350
+ return result
351
+ end
352
+
353
+ # See description at Mxx_ru::Cpp::Toolset#exe_file_name.
354
+ def exe_file_name( source_name )
355
+ return source_name + ".exe"
356
+ end
357
+
358
+ # See description at Mxx_ru::Cpp::Toolset#make_exe_command_lines.
359
+ def make_exe_command_lines(
360
+ a_exe_name,
361
+ a_exe_info,
362
+ a_linker_lists,
363
+ a_target )
364
+
365
+ result = Array.new
366
+
367
+ if SCREEN_WINDOW == a_target.mxx_screen_mode
368
+ startup_obj = "c0w32.obj"
369
+ else
370
+ startup_obj = "c0x32.obj"
371
+ end
372
+
373
+ response_file = generate_linker_respfile(
374
+ a_exe_name, startup_obj, a_linker_lists )
375
+
376
+ result << "#{linker_name} @#{response_file}"
377
+
378
+ if RUNTIME_DEBUG != a_target.mxx_runtime_mode
379
+ result << "if exist #{unix2win(a_exe_name)} del " +
380
+ "#{tds_file_name(a_exe_name)}"
381
+ end
382
+
383
+ return result
384
+ end
385
+
386
+ protected
387
+ # Creates TDS file name based on DLL or EXE name.
388
+ def tds_file_name( a_source_name )
389
+ return unix2win(
390
+ Mxx_ru::Util::change_file_ext( a_source_name, ".tds" ) )
391
+ end
392
+
393
+ # File name normalization.
394
+ #
395
+ # Replaces unix slashes with windows revers slashes
396
+ # and concludes it into a double quotes.
397
+ def unix2win( a_name )
398
+ return "\"" + a_name.gsub( "/", "\\" ) + "\""
399
+ end
400
+
401
+ # Normalization of array of the file names.
402
+ #
403
+ # Replaces unix slashes with windows revers slashes
404
+ #
405
+ # Returns a vector with normalized names.
406
+ def unix2win_mass( a_names )
407
+ return a_names.collect { |d|
408
+ if d
409
+ unix2win( d )
410
+ end
411
+ }
412
+ end
413
+
414
+ # Response-file generation for linker startup.
415
+ #
416
+ # [_a_output_name_] Result file name.
417
+ # [_a_startup_objfile_] Object file name with startup code.
418
+ # [_a_linker_list_] List of object file names, libraries,
419
+ # compiled resource files, e.t.c.
420
+ #
421
+ # Returns response file name.
422
+ def generate_linker_respfile(
423
+ a_output_name,
424
+ a_startup_objfile,
425
+ a_linker_lists )
426
+
427
+ result = "#{a_linker_lists.linker_options.join(' ')} "
428
+
429
+ if 0 != a_linker_lists.lib_paths.size
430
+ result << "/L;"
431
+ a_linker_lists.lib_paths.each { |p| result << "#{p};" }
432
+ result << " "
433
+ end
434
+
435
+ result << "#{a_startup_objfile} "
436
+
437
+ result << "#{unix2win_mass(a_linker_lists.objs).join(' ')} "
438
+ result << ", #{unix2win(a_output_name)}, , "
439
+ result << "#{unix2win_mass(a_linker_lists.libs).join(' ')}, , "
440
+ result << "#{unix2win_mass(a_linker_lists.resources).join(' ')} "
441
+
442
+ return Mxx_ru::Util::Tmp_files.instance.create( result )
443
+ end
444
+
445
+ end # class Bcc_win32_family
446
+
447
+ end # module Toolsets
448
+
449
+ end # module Cpp
450
+
451
+ end # module Mxx_ru
@@ -0,0 +1,56 @@
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/toolset'
30
+
31
+ require 'mxx_ru/cpp/toolsets/c89_nsk_family'
32
+
33
+ module Mxx_ru
34
+ module Cpp
35
+ module Toolsets
36
+
37
+ # Toolset implemetation for c89 NonStopKernel.
38
+ # Win32 Cross-compiler from eToolkit.
39
+ class C89_etk_nsk < C89_nsk_family
40
+ public
41
+ def initialize()
42
+ super( "c89_nsk" )
43
+
44
+ setup_tag( "host_os", "mswin" )
45
+ setup_tag( "target_os", TANDEM_OSS )
46
+ end
47
+
48
+ end # class C89_nsk
49
+
50
+ end # module Toolsets
51
+
52
+ end # module Cpp
53
+
54
+ end # module Mxx_ru
55
+
56
+ Mxx_ru::Cpp::setup_toolset( Mxx_ru::Cpp::Toolsets::C89_etk_nsk.new )
@@ -0,0 +1,56 @@
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/toolset'
30
+
31
+ require 'mxx_ru/cpp/toolsets/c89_nsk_family'
32
+
33
+ module Mxx_ru
34
+ module Cpp
35
+ module Toolsets
36
+
37
+ # Toolset implemetation for c89 NonStopKernel.
38
+ # Native-compiler on NonStopKernel.
39
+ class C89_nsk < C89_nsk_family
40
+ public
41
+ def initialize()
42
+ super( "c89_nsk" )
43
+
44
+ setup_tag( "host_os", TANDEM_OSS )
45
+ setup_tag( "target_os", TANDEM_OSS )
46
+ end
47
+
48
+ end # class C89_nsk
49
+
50
+ end # module Toolsets
51
+
52
+ end # module Cpp
53
+
54
+ end # module Mxx_ru
55
+
56
+ Mxx_ru::Cpp::setup_toolset( Mxx_ru::Cpp::Toolsets::C89_nsk.new )