r2corba 1.4.1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +159 -0
  3. data/LICENSE +59 -0
  4. data/README +62 -0
  5. data/THANKS +52 -0
  6. data/bin/r2corba +8 -0
  7. data/bin/r2corba.bat +20 -0
  8. data/bin/ridlc +11 -0
  9. data/bin/ridlc.bat +23 -0
  10. data/bin/rins +7 -0
  11. data/bin/rins.bat +19 -0
  12. data/ext/.keep +0 -0
  13. data/lib/corba/cbase/IORMap.rb +33 -0
  14. data/lib/corba/cbase/ORB.rb +231 -0
  15. data/lib/corba/cbase/Request.rb +134 -0
  16. data/lib/corba/cbase/Streams.rb +129 -0
  17. data/lib/corba/cbase/Stub.rb +19 -0
  18. data/lib/corba/cbase/Typecode.rb +441 -0
  19. data/lib/corba/cbase/Values.rb +129 -0
  20. data/lib/corba/cbase/exception.rb +66 -0
  21. data/lib/corba/cbase/poa.rb +23 -0
  22. data/lib/corba/cbase/policies.rb +78 -0
  23. data/lib/corba/cbase/post_require.rb +14 -0
  24. data/lib/corba/cbase/require.rb +28 -0
  25. data/lib/corba/cmds/base.rb +85 -0
  26. data/lib/corba/cmds/test.rb +30 -0
  27. data/lib/corba/common/Any.rb +91 -0
  28. data/lib/corba/common/IDL.rb +104 -0
  29. data/lib/corba/common/ORB.rb +368 -0
  30. data/lib/corba/common/Object.rb +208 -0
  31. data/lib/corba/common/Request.rb +20 -0
  32. data/lib/corba/common/Servant.rb +108 -0
  33. data/lib/corba/common/Struct.rb +22 -0
  34. data/lib/corba/common/Stub.rb +79 -0
  35. data/lib/corba/common/Typecode.rb +1121 -0
  36. data/lib/corba/common/Union.rb +56 -0
  37. data/lib/corba/common/Values.rb +92 -0
  38. data/lib/corba/common/const.rb +22 -0
  39. data/lib/corba/common/exception.rb +68 -0
  40. data/lib/corba/common/require.rb +27 -0
  41. data/lib/corba/common/version.rb +22 -0
  42. data/lib/corba/idl/BiDirPolicyC.rb +63 -0
  43. data/lib/corba/idl/CosNamingC.rb +461 -0
  44. data/lib/corba/idl/CosNamingS.rb +309 -0
  45. data/lib/corba/idl/IDL.rb +21 -0
  46. data/lib/corba/idl/IORTable.pidl +62 -0
  47. data/lib/corba/idl/IORTableC.rb +117 -0
  48. data/lib/corba/idl/MessagingC.rb +904 -0
  49. data/lib/corba/idl/POAC.rb +930 -0
  50. data/lib/corba/idl/TAO_Ext.pidl +46 -0
  51. data/lib/corba/idl/TAO_ExtC.rb +179 -0
  52. data/lib/corba/idl/r2c_orb.rb +572 -0
  53. data/lib/corba/idl/require.rb +20 -0
  54. data/lib/corba/jbase/Any.rb +273 -0
  55. data/lib/corba/jbase/IORMap.rb +36 -0
  56. data/lib/corba/jbase/ORB.rb +99 -0
  57. data/lib/corba/jbase/Object.rb +98 -0
  58. data/lib/corba/jbase/Request.rb +226 -0
  59. data/lib/corba/jbase/Servant.rb +247 -0
  60. data/lib/corba/jbase/ServerRequest.rb +128 -0
  61. data/lib/corba/jbase/Streams.rb +671 -0
  62. data/lib/corba/jbase/Stub.rb +38 -0
  63. data/lib/corba/jbase/Typecode.rb +520 -0
  64. data/lib/corba/jbase/Values.rb +173 -0
  65. data/lib/corba/jbase/exception.rb +106 -0
  66. data/lib/corba/jbase/poa.rb +229 -0
  67. data/lib/corba/jbase/policies.rb +300 -0
  68. data/lib/corba/jbase/post_require.rb +14 -0
  69. data/lib/corba/jbase/require.rb +86 -0
  70. data/lib/corba/naming.rb +14 -0
  71. data/lib/corba/naming_service.rb +15 -0
  72. data/lib/corba/poa.rb +15 -0
  73. data/lib/corba/policies.rb +18 -0
  74. data/lib/corba/require.rb +17 -0
  75. data/lib/corba/svcs/ins/cos_naming.rb +426 -0
  76. data/lib/corba/svcs/ins/ins.rb +526 -0
  77. data/lib/corba/svcs/ins/naming_service.rb +119 -0
  78. data/lib/corba.rb +16 -0
  79. data/lib/ridlbe/ruby/config.rb +336 -0
  80. data/lib/ridlbe/ruby/orb.pidlc +0 -0
  81. data/lib/ridlbe/ruby/require.rb +16 -0
  82. data/lib/ridlbe/ruby/walker.rb +1582 -0
  83. data/mkrf_conf_bingem.rb +101 -0
  84. data/rakelib/bin.rake +80 -0
  85. data/rakelib/bin.rb +146 -0
  86. data/rakelib/build.rake +87 -0
  87. data/rakelib/config.rake +52 -0
  88. data/rakelib/config.rb +450 -0
  89. data/rakelib/ext.rake +242 -0
  90. data/rakelib/ext.rb +308 -0
  91. data/rakelib/ext_r2tao.rb +232 -0
  92. data/rakelib/gem.rake +212 -0
  93. data/rakelib/gem.rb +146 -0
  94. data/rakelib/package.rake +26 -0
  95. data/rakelib/test.rake +23 -0
  96. data/test/BiDirectional/Test.idl +34 -0
  97. data/test/BiDirectional/client.rb +132 -0
  98. data/test/BiDirectional/run_test.rb +68 -0
  99. data/test/BiDirectional/server.ior +1 -0
  100. data/test/BiDirectional/server.rb +169 -0
  101. data/test/CORBA_Services/Naming/BindingIterator/Test.idl +27 -0
  102. data/test/CORBA_Services/Naming/BindingIterator/client.rb +121 -0
  103. data/test/CORBA_Services/Naming/BindingIterator/ins.ior +1 -0
  104. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +82 -0
  105. data/test/CORBA_Services/Naming/BindingIterator/server.rb +109 -0
  106. data/test/CORBA_Services/Naming/Corbaname/Test.idl +27 -0
  107. data/test/CORBA_Services/Naming/Corbaname/client.rb +85 -0
  108. data/test/CORBA_Services/Naming/Corbaname/corbaname.ior +1 -0
  109. data/test/CORBA_Services/Naming/Corbaname/ins.ior +1 -0
  110. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +88 -0
  111. data/test/CORBA_Services/Naming/Corbaname/server.rb +135 -0
  112. data/test/CORBA_Services/Naming/Simple/Test.idl +27 -0
  113. data/test/CORBA_Services/Naming/Simple/client.rb +84 -0
  114. data/test/CORBA_Services/Naming/Simple/ins.ior +1 -0
  115. data/test/CORBA_Services/Naming/Simple/run_test.rb +82 -0
  116. data/test/CORBA_Services/Naming/Simple/server.rb +109 -0
  117. data/test/Collocation/Diamond.idl +39 -0
  118. data/test/Collocation/run_test.rb +52 -0
  119. data/test/Collocation/test.rb +195 -0
  120. data/test/Connect_Timeout/Test.idl +27 -0
  121. data/test/Connect_Timeout/client.rb +111 -0
  122. data/test/Connect_Timeout/run_test.rb +52 -0
  123. data/test/DII/Test.idl +27 -0
  124. data/test/DII/client.rb +115 -0
  125. data/test/DII/run_test.rb +69 -0
  126. data/test/DII/server.ior +1 -0
  127. data/test/DII/server.rb +95 -0
  128. data/test/DSI/Test.idl +27 -0
  129. data/test/DSI/client.rb +66 -0
  130. data/test/DSI/run_test.rb +69 -0
  131. data/test/DSI/server.ior +1 -0
  132. data/test/DSI/server.rb +106 -0
  133. data/test/Exceptions/Test.idl +48 -0
  134. data/test/Exceptions/client.rb +118 -0
  135. data/test/Exceptions/run_test.rb +69 -0
  136. data/test/Exceptions/server.ior +1 -0
  137. data/test/Exceptions/server.rb +131 -0
  138. data/test/Hello/Test.idl +27 -0
  139. data/test/Hello/client.rb +78 -0
  140. data/test/Hello/run_test.rb +71 -0
  141. data/test/Hello/server.rb +95 -0
  142. data/test/IDL_Test/Test.idl +113 -0
  143. data/test/IDL_Test/Test_inc.idl +17 -0
  144. data/test/IDL_Test/client.rb +102 -0
  145. data/test/IDL_Test/run_test.rb +69 -0
  146. data/test/IDL_Test/server.ior +1 -0
  147. data/test/IDL_Test/server.rb +99 -0
  148. data/test/IORMap/Test.idl +27 -0
  149. data/test/IORMap/client.rb +73 -0
  150. data/test/IORMap/run_test.rb +69 -0
  151. data/test/IORMap/server.ior +1 -0
  152. data/test/IORMap/server.rb +114 -0
  153. data/test/IORTable/Test.idl +27 -0
  154. data/test/IORTable/client.rb +75 -0
  155. data/test/IORTable/run_test.rb +69 -0
  156. data/test/IORTable/server.ior +1 -0
  157. data/test/IORTable/server.rb +130 -0
  158. data/test/Implicit_Conversion/Test.idl +31 -0
  159. data/test/Implicit_Conversion/client.rb +110 -0
  160. data/test/Implicit_Conversion/run_test.rb +69 -0
  161. data/test/Implicit_Conversion/server.ior +1 -0
  162. data/test/Implicit_Conversion/server.rb +99 -0
  163. data/test/Multi_Threading/Multiple_ORB/Test.idl +27 -0
  164. data/test/Multi_Threading/Multiple_ORB/client.rb +82 -0
  165. data/test/Multi_Threading/Multiple_ORB/run_test.rb +71 -0
  166. data/test/Multi_Threading/Multiple_ORB/server.rb +108 -0
  167. data/test/Multi_Threading/Multiple_ORB/server0.ior +1 -0
  168. data/test/Multi_Threading/Multiple_ORB/server1.ior +1 -0
  169. data/test/Multi_Threading/Simple/Test.idl +27 -0
  170. data/test/Multi_Threading/Simple/client.rb +88 -0
  171. data/test/Multi_Threading/Simple/run_test.rb +69 -0
  172. data/test/Multi_Threading/Simple/server.ior +1 -0
  173. data/test/Multi_Threading/Simple/server.rb +118 -0
  174. data/test/Multi_Threading/Threads/Test.idl +31 -0
  175. data/test/Multi_Threading/Threads/client.rb +80 -0
  176. data/test/Multi_Threading/Threads/run_test.rb +76 -0
  177. data/test/Multi_Threading/Threads/server.ior +1 -0
  178. data/test/Multi_Threading/Threads/server.rb +119 -0
  179. data/test/Multi_Threading/Threads/watchdog.ior +1 -0
  180. data/test/Multi_Threading/Threads/watchdog.rb +87 -0
  181. data/test/Multiple_Servant_Interfaces/Test.idl +34 -0
  182. data/test/Multiple_Servant_Interfaces/client.rb +70 -0
  183. data/test/Multiple_Servant_Interfaces/run_test.rb +69 -0
  184. data/test/Multiple_Servant_Interfaces/server.ior +1 -0
  185. data/test/Multiple_Servant_Interfaces/server.rb +102 -0
  186. data/test/Nil/Test.idl +27 -0
  187. data/test/Nil/run_test.rb +52 -0
  188. data/test/Nil/test.rb +78 -0
  189. data/test/OBV/AbstractInterface/client.rb +179 -0
  190. data/test/OBV/AbstractInterface/run_test.rb +69 -0
  191. data/test/OBV/AbstractInterface/server.ior +1 -0
  192. data/test/OBV/AbstractInterface/server.rb +149 -0
  193. data/test/OBV/AbstractInterface/test.idl +53 -0
  194. data/test/OBV/Custom/OBV.idl +18 -0
  195. data/test/OBV/Custom/OBV_impl.rb +40 -0
  196. data/test/OBV/Custom/client.rb +86 -0
  197. data/test/OBV/Custom/run_test.rb +69 -0
  198. data/test/OBV/Custom/server.ior +1 -0
  199. data/test/OBV/Custom/server.rb +100 -0
  200. data/test/OBV/Simple/OBV.idl +15 -0
  201. data/test/OBV/Simple/OBV_impl.rb +26 -0
  202. data/test/OBV/Simple/client.rb +86 -0
  203. data/test/OBV/Simple/run_test.rb +69 -0
  204. data/test/OBV/Simple/server.ior +1 -0
  205. data/test/OBV/Simple/server.rb +100 -0
  206. data/test/OBV/Simple_Event/Event.idl +15 -0
  207. data/test/OBV/Simple_Event/Event_impl.rb +26 -0
  208. data/test/OBV/Simple_Event/client.rb +86 -0
  209. data/test/OBV/Simple_Event/run_test.rb +69 -0
  210. data/test/OBV/Simple_Event/server.ior +1 -0
  211. data/test/OBV/Simple_Event/server.rb +100 -0
  212. data/test/OBV/Supports/client.rb +116 -0
  213. data/test/OBV/Supports/run_test.rb +69 -0
  214. data/test/OBV/Supports/server.ior +1 -0
  215. data/test/OBV/Supports/server.rb +103 -0
  216. data/test/OBV/Supports/supports.idl +33 -0
  217. data/test/OBV/Supports/supports_impl.rb +57 -0
  218. data/test/OBV/Tree/client.rb +116 -0
  219. data/test/OBV/Tree/run_test.rb +69 -0
  220. data/test/OBV/Tree/server.ior +1 -0
  221. data/test/OBV/Tree/server.rb +117 -0
  222. data/test/OBV/Tree/test.idl +32 -0
  223. data/test/OBV/Truncatable/Extra.idl +27 -0
  224. data/test/OBV/Truncatable/Truncatable.idl +105 -0
  225. data/test/OBV/Truncatable/Truncatable_impl.rb +86 -0
  226. data/test/OBV/Truncatable/client.rb +279 -0
  227. data/test/OBV/Truncatable/run_test.rb +69 -0
  228. data/test/OBV/Truncatable/server.ior +1 -0
  229. data/test/OBV/Truncatable/server.rb +89 -0
  230. data/test/OBV/ValueBox/client.rb +497 -0
  231. data/test/OBV/ValueBox/run_test.rb +69 -0
  232. data/test/OBV/ValueBox/server.ior +1 -0
  233. data/test/OBV/ValueBox/server.rb +271 -0
  234. data/test/OBV/ValueBox/valuebox.idl +101 -0
  235. data/test/OBV/ValueBox/vb_basic.idl +75 -0
  236. data/test/OBV/ValueBox/vb_struct.idl +68 -0
  237. data/test/OBV/ValueBox/vb_union.idl +21 -0
  238. data/test/Object/Test.idl +27 -0
  239. data/test/Object/client.rb +103 -0
  240. data/test/Object/run_test.rb +69 -0
  241. data/test/Object/server.ior +1 -0
  242. data/test/Object/server.rb +126 -0
  243. data/test/POA/Test.idl +27 -0
  244. data/test/POA/run_test.rb +52 -0
  245. data/test/POA/test.rb +112 -0
  246. data/test/Param_Test/Test.idl +182 -0
  247. data/test/Param_Test/client.rb +277 -0
  248. data/test/Param_Test/run_test.rb +69 -0
  249. data/test/Param_Test/server.ior +1 -0
  250. data/test/Param_Test/server.rb +296 -0
  251. data/test/Performance/Simple/Test.idl +27 -0
  252. data/test/Performance/Simple/client.rb +90 -0
  253. data/test/Performance/Simple/run_test.rb +69 -0
  254. data/test/Performance/Simple/server.ior +1 -0
  255. data/test/Performance/Simple/server.rb +95 -0
  256. data/test/Policies/Test.idl +27 -0
  257. data/test/Policies/run_test.rb +52 -0
  258. data/test/Policies/test.rb +144 -0
  259. data/test/Timeout/client.rb +207 -0
  260. data/test/Timeout/run_test.rb +69 -0
  261. data/test/Timeout/server.ior +1 -0
  262. data/test/Timeout/server.rb +109 -0
  263. data/test/Timeout/test.idl +19 -0
  264. data/test/lib/assert.rb +43 -0
  265. data/test/lib/test.rb +542 -0
  266. data/test/test_runner.rb +193 -0
  267. metadata +346 -0
data/rakelib/config.rb ADDED
@@ -0,0 +1,450 @@
1
+ #--------------------------------------------------------------------
2
+ # config.rb - build file
3
+ #
4
+ # Author: Martin Corino
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the R2CORBA LICENSE which is
8
+ # included with this program.
9
+ #
10
+ # Copyright (c) Remedy IT Expertise BV
11
+ # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
+ #--------------------------------------------------------------------
13
+
14
+ require 'rbconfig'
15
+ require 'yaml'
16
+ require 'optparse'
17
+
18
+ require 'rake/clean'
19
+
20
+ require File.join(File.dirname(__FILE__), '../lib/corba/common/version')
21
+
22
+ =begin
23
+
24
+ Generic keys defaulted to RB_CONFIG value
25
+ ================================================
26
+ bindir
27
+ libdir
28
+ datadir
29
+ mandir
30
+ sysconfdir
31
+ localstatedir
32
+
33
+ custom keys
34
+ ===========
35
+ Generic
36
+
37
+ key default
38
+ --- ------
39
+ prefix nil
40
+ libruby File.join(RB_CONFIG['libdir'], 'ruby'),
41
+ librubyver RB_CONFIG['rubylibdir'],
42
+ librubyverarch RB_CONFIG['archdir'],
43
+ siteruby RB_CONFIG['sitedir'],
44
+ siterubyver RB_CONFIG['sitelibdir'],
45
+ siterubyverarch RB_CONFIG['sitearchdir'],
46
+ rbdir RB_CONFIG['siterubyver']
47
+ sodir RB_CONFIG['siterubyverarch']
48
+
49
+ MRI
50
+
51
+ key default
52
+ --- ------
53
+ makeprog 'make'
54
+ without-tao 'no'
55
+ aceroot nil
56
+ taoroot nil
57
+ mpcroot nil
58
+ aceinstdir $ACE_ROOT/lib || get_config[:sodir]
59
+ with-ipv6 'no'
60
+ with-ssl 'no'
61
+ sslroot '/usr'
62
+ with-debug 'no'
63
+
64
+ Java
65
+
66
+ key default
67
+ --- ------
68
+ without-jacorb false
69
+ jacorb_home ENV['JACORB_HOME']
70
+ =end
71
+
72
+ module R2CORBA
73
+
74
+ if defined? ::RbConfig
75
+ RB_CONFIG = ::RbConfig::CONFIG
76
+ else
77
+ RB_CONFIG = ::Config::CONFIG
78
+ end unless defined? RB_CONFIG
79
+
80
+ CFGKEYS = %w{prefix
81
+ bindir
82
+ libdir
83
+ datadir
84
+ mandir
85
+ sysconfdir
86
+ localstatedir
87
+ libruby
88
+ librubyver
89
+ librubyverarch
90
+ siteruby
91
+ siterubyver
92
+ siterubyverarch
93
+ rbdir
94
+ sodir}
95
+
96
+ RBDEFAULTS = %w{bindir
97
+ libdir
98
+ datadir
99
+ mandir
100
+ sysconfdir
101
+ localstatedir}
102
+
103
+ CONFIG = {
104
+ :libruby => File.join(RB_CONFIG['libdir'], 'ruby'),
105
+ :librubyver => RB_CONFIG['rubylibdir'],
106
+ :librubyverarch => RB_CONFIG['archdir'],
107
+ :siteruby => RB_CONFIG['sitedir'],
108
+ :siterubyver => RB_CONFIG['sitelibdir'],
109
+ :siterubyverarch => RB_CONFIG['sitearchdir'],
110
+ :rbdir => :siterubyver,
111
+ :sodir => :siterubyverarch,
112
+ }
113
+
114
+ if defined?(JRUBY_VERSION)
115
+ CFGKEYS.concat(%w{without-jacorb jacorb_home})
116
+ CONFIG.merge!({
117
+ :'without-jacorb' => false,
118
+ :jacorb_home => ENV['JACORB_HOME'] || ''
119
+ })
120
+ BUILD_CFG = '.jrconfig'
121
+ else
122
+ CFGKEYS.concat(%w{makeprog without-tao aceroot taoroot mpcroot aceinstdir with-ipv6 with-ssl sslroot with-debug})
123
+ CONFIG.merge!({
124
+ :makeprog => 'make',
125
+ :'without-tao' => false,
126
+ :aceroot => ENV['ACE_ROOT'] || '',
127
+ :taoroot => ENV['TAO_ROOT'] || '',
128
+ :mpcroot => ENV['MPC_ROOT'] || '',
129
+ :aceinstdir => '',
130
+ :'with-ipv6' => false,
131
+ :'with-ssl' => false,
132
+ :sslroot => ENV['SSL_ROOT'] || (RUBY_PLATFORM =~ /mingw32/ ? '' : '/usr'),
133
+ :'with-debug' => false,
134
+ })
135
+ BUILD_CFG = '.rconfig'
136
+ end
137
+
138
+ module AccessMethods
139
+ def get_config(key)
140
+ v = R2CORBA::CONFIG.has_key?(key.to_sym) ? R2CORBA::CONFIG[key.to_sym] : (RBDEFAULTS.include?(key.to_s) ? RB_CONFIG[key.to_s] : nil)
141
+ v = R2CORBA::CONFIG[v] while Symbol === v && R2CORBA::CONFIG.has_key?(v)
142
+ v
143
+ end
144
+
145
+ def set_config(key, val)
146
+ R2CORBA::CONFIG[key.to_sym] = val
147
+ end
148
+ end
149
+
150
+ module Config
151
+
152
+ @@ruby_ver = RUBY_VERSION.split('.').collect {|n| n.to_i}
153
+
154
+ def self.rb_ver_major
155
+ @@ruby_ver[0]
156
+ end
157
+
158
+ def self.rb_ver_minor
159
+ @@ruby_ver[1]
160
+ end
161
+
162
+ def self.rb_ver_release
163
+ @@ruby_ver[2]
164
+ end
165
+
166
+ @@is_win32 = RUBY_PLATFORM =~ /mingw32/ ? true : false
167
+ @@is_win64 = (@@is_win32 && (RUBY_PLATFORM =~ /x64/)) ? true : false
168
+ @@is_linux = RB_CONFIG['target_os'] =~ /linux/ ? true : false
169
+ @@is_osx = RUBY_PLATFORM =~ /darwin/ ? true : false
170
+
171
+ def self.is_win32
172
+ @@is_win32
173
+ end
174
+ def self.is_win64
175
+ @@is_win64
176
+ end
177
+ def self.is_linux
178
+ @@is_linux
179
+ end
180
+ def self.is_osx
181
+ @@is_osx
182
+ end
183
+
184
+ @@cpu_cores = (@@is_linux ? `cat /proc/cpuinfo | grep processor | wc -l`.to_i : 1)
185
+
186
+ def self.cpu_cores
187
+ @@cpu_cores
188
+ end
189
+
190
+ @@ridl_local = nil
191
+ @@ridlc = nil
192
+
193
+ def self.ridl_is_local?
194
+ @@ridl_local
195
+ end
196
+
197
+ def self.ridlc
198
+ @@ridlc.dup
199
+ end
200
+
201
+ @@rpath_patch = nil
202
+
203
+ def self.rpath_patch
204
+ @@rpath_patch
205
+ end
206
+
207
+ def self.init
208
+ if defined?(JRUBY_VERSION)
209
+ # check/set environment settings for JacORB
210
+ ENV['JACORB_HOME'] ||= get_config('jacorb_home')
211
+ else
212
+
213
+ if Dir[File.join('ext', 'libACE.*')].empty? # Don't check for ACE/TAO installation when executed for binary gem install
214
+
215
+ # check/set environment settings for ACE+TAO
216
+ ENV['ACE_ROOT'] = get_config('aceroot')
217
+ ENV['TAO_ROOT'] = get_config('taoroot')
218
+ ENV['MPC_ROOT'] = get_config('mpcroot')
219
+
220
+ if is_win32
221
+ ENV['PATH'] = "#{File.join(ENV['ACE_ROOT'],'lib')}#{';'}#{ENV['PATH']}"
222
+ ENV['SSL_ROOT'] = get_config('sslroot') if get_config('with-ssl')
223
+ elsif RUBY_PLATFORM =~ /darwin/
224
+ ENV['DYLD_LIBRARY_PATH'] = "#{File.join(ENV['ACE_ROOT'],'lib')}#{File::PATH_SEPARATOR}#{ENV['DYLD_LIBRARY_PATH'] || ""}"
225
+ ENV['SSL_ROOT'] = get_config('sslroot') if get_config('with-ssl') && get_config('sslroot')!='/usr'
226
+ else
227
+ ENV['LD_LIBRARY_PATH'] = "#{File.join(ENV['ACE_ROOT'],'lib')}#{File::PATH_SEPARATOR}#{ENV['LD_LIBRARY_PATH'] || ""}"
228
+ ENV['SSL_ROOT'] = get_config('sslroot') if get_config('with-ssl') && get_config('sslroot')!='/usr'
229
+ end
230
+
231
+ else
232
+
233
+ unless is_win32
234
+ # check for required tools to patch RPATH setting of shared libs
235
+ if is_osx
236
+ if system('which install_name_tool > /dev/null 2>&1')
237
+ @@rpath_patch = 'install_name_tool'
238
+ else
239
+ raise 'Installation of binary gem requires an installed version of the install_name_tool utility.'
240
+ end
241
+ else
242
+ if system('which patchelf > /dev/null 2>&1')
243
+ @@rpath_patch = 'patchelf --set-rpath'
244
+ elsif system('which chrpath > /dev/null 2>&1')
245
+ @@rpath_patch = 'chrpath --replace'
246
+ else
247
+ raise 'Installation of binary gem requires an installed version of either the patchelf OR chrpath utility.'
248
+ end
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end
255
+
256
+ @@ridlc = File.join('bin', 'ridlc')
257
+
258
+ # check availability of RIDL; either as gem or in subdir
259
+ if (@@ridl_local = File.exists?(File.join('ridl', 'lib', 'ridl', 'ridl.rb')))
260
+ incdirs = [
261
+ File.expand_path(File.join('ridl', 'lib')),
262
+ File.expand_path('lib'),
263
+ ENV['RUBYLIB']
264
+ ].compact
265
+ ENV['RUBYLIB'] = incdirs.join(File::PATH_SEPARATOR)
266
+ else # RIDL probably installed as gem
267
+ incdirs = [
268
+ File.expand_path('lib'),
269
+ ENV['RUBYLIB']
270
+ ].compact
271
+ ENV['RUBYLIB'] = incdirs.join(File::PATH_SEPARATOR)
272
+ end
273
+
274
+ end
275
+
276
+ def self.define
277
+ OptionParser.new do |opts|
278
+ opts.banner = "Usage: rake [rake options] -- configure [options]"
279
+
280
+ opts.separator ""
281
+
282
+ opts.on('--prefix=path',
283
+ "path prefix of target environment [#{get_config(:prefix)}]") {|v| set_config(:prefix, File.expand_path(v))}
284
+ opts.on('--bindir=path',
285
+ "the directory for commands [#{RB_CONFIG['bindir']}]") {|v| CONFIG[:bindir] = v}
286
+ opts.on('--libdir=path',
287
+ "the directory for libraries [#{RB_CONFIG['libdir']}]") {|v| CONFIG[:libdir] = v}
288
+ opts.on('--datadir=path',
289
+ "the directory for shared data [#{RB_CONFIG['datadir']}]") {|v| CONFIG[:datadir] = v}
290
+ opts.on('--mandir=path',
291
+ "the directory for man pages [#{RB_CONFIG['mandir']}]") {|v| CONFIG[:mandir] = v}
292
+ opts.on('--sysconfdir=path',
293
+ "the directory for system configuration files [#{RB_CONFIG['sysconfdir']}]") {|v| CONFIG[:sysconfdir] = v}
294
+ opts.on('--localstatedir=path',
295
+ "the directory for local state data [#{RB_CONFIG['localstatedir']}]") {|v| CONFIG[:localstatedir] = v}
296
+ opts.on('--libruby=path',
297
+ "the directory for ruby libraries [#{get_config('libruby')}]") {|v| CONFIG[:libruby] = v}
298
+ opts.on('--librubyver=path',
299
+ "the directory for standard ruby libraries [#{get_config('librubyver')}]") {|v| CONFIG[:librubyver] = v}
300
+ opts.on('--librubyverarch=path',
301
+ "the directory for standard ruby extensions [#{get_config('librubyverarch')}]") {|v| CONFIG[:librubyverarch] = v}
302
+ opts.on('--siteruby=path',
303
+ "the directory for version-independent aux ruby libraries [#{get_config('siteruby')}]") {|v| CONFIG[:siteruby] = v}
304
+ opts.on('--siterubyver=path',
305
+ "the directory for aux ruby libraries [#{get_config('siterubyver')}]") {|v| CONFIG[:siterubyver] = v}
306
+ opts.on('--siterubyverarch=path',
307
+ "the directory for aux ruby binaries [#{get_config('siterubyverarch')}]") {|v| CONFIG[:siterubyverarch] = v}
308
+ opts.on('--rbdir=path',
309
+ "the directory for ruby scripts [#{get_config(:rbdir)}]") {|v| CONFIG[:rbdir] = v}
310
+ opts.on('--sodir=path',
311
+ "the directory for ruby extentions [#{get_config(:sodir)}]") {|v| CONFIG[:sodir] = v}
312
+ if defined?(JRUBY_VERSION)
313
+ opts.on('--without-jacorb',
314
+ "do *not* install JacORB JAR files with R2CORBA [#{get_config('without-jacorb')}]") {|v| CONFIG[:'without-jacorb'] = true}
315
+ opts.on('--jacorb-home=path',
316
+ "the path to the root directory of JacORB [#{get_config(:jacorb_home)}]") {|v| CONFIG[:jacorb_home] = v}
317
+ else
318
+ opts.on('--makeprog=name',
319
+ "the make program to compile ruby extentions [#{get_config(:makeprog)}]") {|v| CONFIG[:makeprog] = v}
320
+ opts.on('--without-tao',
321
+ "do *not* configure/build/clean the ACE+TAO libraries [#{get_config('without-tao')}]") {|v| CONFIG[:'without-tao'] = true}
322
+ opts.on('--aceroot=path',
323
+ "the path to the root directory of ACE [#{get_config(:aceroot)}]") {|v| CONFIG[:aceroot] = v}
324
+ opts.on('--taoroot=path',
325
+ "the path to the root directory of TAO [#{get_config(:taoroot)}]") {|v| CONFIG[:taoroot] = v}
326
+ opts.on('--mpcroot=path',
327
+ "the path to the root directory of MPC [#{get_config(:mpcroot)}]") {|v| CONFIG[:mpcroot] = v}
328
+ opts.on('--aceinstdir=path',
329
+ "the directory where the ACE+TAO dlls are installed (automatically determined if not specified) [#{get_config(:aceinstdir)}]") {|v| CONFIG[:aceinstdir] = v}
330
+ opts.on('--with-ipv6',
331
+ "build ACE+TAO libraries with IPv6 support enabled [#{get_config('with-ipv6')}]") {|v| CONFIG[:'with-ipv6'] = true}
332
+ opts.on('--with-ssl',
333
+ "build ACE+TAO libraries with SSL support enabled (autodetected with prebuilt ACE/TAO) [#{get_config('with-ssl')}]") {|v| CONFIG[:'with-ssl'] = true}
334
+ opts.on('--sslroot=path',
335
+ "the root path where SSL includes and libraries can be found [#{get_config(:sslroot)}]") {|v| CONFIG[:sslroot] = v}
336
+ opts.on('--with-debug',
337
+ "build with debugger support [#{get_config('with-debug')}]") {|v| CONFIG[:'with-debug'] = true}
338
+ end
339
+
340
+ opts.separator ""
341
+
342
+ opts.on('--help', 'Show this help message') { puts opts; puts; exit }
343
+ end.parse!(ARGV)
344
+ end
345
+
346
+ def self.check
347
+ if defined?(JRUBY_VERSION)
348
+ # check availability of JacORB
349
+ if get_config('jacorb_home')=='' && File.directory?('jacorb')
350
+ set_config('jacorb_home', File.expand_path('jacorb'))
351
+ end
352
+ raise "Cannot find JacORB. Missing JACORB_HOME configuration!" if get_config('jacorb_home').empty?
353
+ else
354
+ if Dir[File.join('ext', 'libACE.*')].empty? # Don't check for ACE/TAO installation when executed for binary gem install
355
+
356
+ if get_config('without-tao') && !(File.directory?(File.join('ACE','ACE_wrappers')) || File.directory?(File.join('ACE','ACE')))
357
+
358
+ # check if a user defined ACE/TAO location is specified or we're using a system standard install
359
+ if get_config('aceroot').empty?
360
+ # assume system standard install; will be checked below
361
+ set_config('aceroot', '/usr/include')
362
+ set_config('taoroot', '/usr/include')
363
+ set_config('mpcroot', '/usr/share/mpc')
364
+ set_config('aceinstdir', get_config('libdir')) if get_config('aceinstdir').empty?
365
+ else
366
+ set_config('aceinstdir', File.join(get_config('aceroot'), 'lib')) if get_config('aceinstdir').empty?
367
+ end
368
+
369
+ else
370
+ # check availability of ACE/TAO
371
+ if get_config('aceroot').empty? && (File.directory?(File.join('ACE','ACE_wrappers')) || File.directory?(File.join('ACE','ACE')))
372
+ set_config('aceroot', File.directory?(File.join('ACE','ACE_wrappers')) ? File.expand_path(File.join('ACE','ACE_wrappers')) : File.expand_path(File.join('ACE','ACE')))
373
+ end
374
+ if get_config('taoroot').empty? && (File.directory?(File.join(get_config('aceroot'),'TAO')) || File.directory?(File.join('ACE','TAO')))
375
+ set_config('taoroot', File.directory?(File.join(get_config('aceroot'),'TAO')) ? File.expand_path(File.join(get_config('aceroot'),'TAO')) : File.expand_path(File.join('ACE','TAO')))
376
+ end
377
+ if get_config('mpcroot').empty? && (File.directory?(File.join(get_config('aceroot'),'MPC')) || File.directory?(File.join('ACE','MPC')))
378
+ set_config('mpcroot', File.directory?(File.join(get_config('aceroot'),'MPC')) ? File.expand_path(File.join(get_config('aceroot'),'MPC')) : File.expand_path(File.join('ACE','MPC')))
379
+ end
380
+
381
+ set_config('aceinstdir', get_config('sodir')) if get_config('aceinstdir').empty?
382
+ end
383
+
384
+ raise 'Cannot find ACE+TAO. Missing ACE_ROOT configuration!' if get_config('aceroot').empty? || !File.directory?(File.join(get_config('aceroot'), 'ace'))
385
+ raise 'Cannot find ACE+TAO. Missing TAO_ROOT configuration!' if get_config('taoroot').empty? || !File.directory?(File.join(get_config('taoroot'), 'tao'))
386
+ raise 'Cannot find MPC. Missing MPC_ROOT configuration!' if get_config('mpcroot').empty? || !File.file?(File.join(get_config('mpcroot'), 'mpc.pl'))
387
+
388
+ unless get_config('without-tao') || get_config('with-ssl')
389
+ set_config('with-ssl', Dir.glob(File.join(get_config('aceroot'), 'lib', '*ACE_SLL.*')).empty?() ? false : true)
390
+ end
391
+
392
+ if is_osx
393
+ if system('which install_name_tool > /dev/null 2>&1')
394
+ @@rpath_patch = 'install_name_tool'
395
+ else
396
+ raise 'Building R2CORBA requires an installed version of the install_name_tool utility.'
397
+ end
398
+ end
399
+
400
+ else
401
+
402
+ unless is_win32
403
+ # check for required tools to patch RPATH setting of shared libs
404
+ if is_osx
405
+ if system('which install_name_tool > /dev/null 2>&1')
406
+ @@rpath_patch = 'install_name_tool'
407
+ else
408
+ raise 'Installation of binary gem requires an installed version of the install_name_tool utility.'
409
+ end
410
+ else
411
+ if system('which patchelf > /dev/null 2>&1')
412
+ @@rpath_patch = 'patchelf --set-rpath'
413
+ elsif system('which chrpath > /dev/null 2>&1')
414
+ @@rpath_patch = 'chrpath --replace'
415
+ else
416
+ raise 'Installation of binary gem requires an installed version of either the patchelf OR chrpath utility.'
417
+ end
418
+ end
419
+ end
420
+
421
+ end
422
+ end
423
+
424
+ # check availability of RIDL; either as gem or in subdir
425
+ unless File.exists?(File.join('ridl', 'lib', 'ridl', 'ridl.rb')) || (`gem search -i -q ridl`.strip) == 'true'
426
+ raise "Missing RIDL installation. R2CORBA requires RIDL installed either as gem or in subdirectory ridl."
427
+ end
428
+ end
429
+
430
+ def self.save
431
+ File.open(BUILD_CFG, 'w') do |f|
432
+ f << YAML.dump(CONFIG)
433
+ end
434
+ end
435
+
436
+ def self.load
437
+ if File.file?(BUILD_CFG)
438
+ File.open(BUILD_CFG, 'r') do |f|
439
+ CONFIG.merge!(YAML.load(f.read))
440
+ end
441
+ init
442
+ end
443
+ end
444
+ end
445
+ end
446
+
447
+ include R2CORBA::AccessMethods
448
+
449
+ # load current config (if any)
450
+ R2CORBA::Config.load
data/rakelib/ext.rake ADDED
@@ -0,0 +1,242 @@
1
+ #--------------------------------------------------------------------
2
+ # ext.rake - build file
3
+ #
4
+ # Author: Martin Corino
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the R2CORBA LICENSE which is
8
+ # included with this program.
9
+ #
10
+ # Copyright (c) Remedy IT Expertise BV
11
+ # Chamber of commerce Rotterdam nr.276339, The Netherlands
12
+ #--------------------------------------------------------------------
13
+
14
+ if defined?(JRUBY_VERSION)
15
+
16
+ namespace :r2corba do
17
+ namespace :ext do
18
+ task :build # noop
19
+ end
20
+ end
21
+
22
+ else # !JRUBY_VERSION
23
+
24
+ require File.join(File.dirname(__FILE__), 'ext.rb')
25
+
26
+ file R2CORBA::Ext.r2tao_mpc_file do |t|
27
+ File.open(t.name, 'w') {|f| f.puts R2CORBA::Ext::R2TAO_MPC }
28
+ end
29
+
30
+ file R2CORBA::Ext.rpoa_mpc_file do |t|
31
+ File.open(t.name, 'w') {|f| f.puts R2CORBA::Ext::RPOA_MPC }
32
+ end
33
+
34
+ file R2CORBA::Ext.rpol_mpc_file do |t|
35
+ File.open(t.name, 'w') {|f| f.puts R2CORBA::Ext::RPOL_MPC }
36
+ end
37
+
38
+ file R2CORBA::Ext.ext_makefile => [R2CORBA::BUILD_CFG,
39
+ R2CORBA::Ext.default_features_path,
40
+ R2CORBA::Ext.ace_config_path,
41
+ R2CORBA::Ext.platform_macros_path,
42
+ R2CORBA::Ext.r2tao_mpc_file,
43
+ R2CORBA::Ext.rpoa_mpc_file,
44
+ R2CORBA::Ext.rpol_mpc_file] do
45
+ # check availability of PERL
46
+ raise "PERL missing! A working version of PERL in the PATH is required." unless system('perl -v')
47
+ # configure R2TAO build
48
+ _mwc = File.join(get_config('aceroot'), 'bin', 'mwc.pl')
49
+
50
+ cur_dir = Dir.getwd
51
+ Dir.chdir 'ext'
52
+ begin
53
+ sh("perl #{_mwc} -type gnuace ext.mwc")
54
+ ensure
55
+ Dir.chdir cur_dir
56
+ end
57
+ end
58
+
59
+ CLOBBER.include [R2CORBA::Ext.ext_makefile, R2CORBA::Ext.r2tao_mpc_file, R2CORBA::Ext.rpoa_mpc_file, R2CORBA::Ext.rpol_mpc_file]
60
+
61
+ namespace :r2corba do
62
+ namespace :ext do
63
+ #desc 'Build extension libraries'
64
+ task :build => R2CORBA::Ext.ext_makefile do
65
+ cur_dir = Dir.getwd
66
+ Dir.chdir 'ext'
67
+ begin
68
+ sh("#{get_config('makeprog')}#{get_config('with-debug') ? ' debug=1' : ''}")
69
+ ensure
70
+ Dir.chdir cur_dir
71
+ end
72
+ R2CORBA::Ext.post_build
73
+ end
74
+
75
+ task :clobber do
76
+ cur_dir = Dir.getwd
77
+ Dir.chdir 'ext'
78
+ begin
79
+ sh("#{get_config('makeprog')} realclean") if File.exists?('GNUmakefile')
80
+ ensure
81
+ Dir.chdir cur_dir
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ Rake::Task['clobber'].enhance ['r2corba:ext:clobber']
88
+
89
+ if R2CORBA::Config.is_win32
90
+
91
+ file R2CORBA::Ext.extload_mpc_file do |t|
92
+ File.open(t.name, 'w') {|f| f.puts R2CORBA::Ext::EXTLOAD_MPC }
93
+ end
94
+
95
+ file R2CORBA::Ext.extload_makefile => [R2CORBA::BUILD_CFG,
96
+ R2CORBA::Ext.default_features_path,
97
+ R2CORBA::Ext.ace_config_path,
98
+ R2CORBA::Ext.platform_macros_path,
99
+ R2CORBA::Ext.extload_mpc_file] do
100
+ # check availability of PERL
101
+ raise "PERL missing! A working version of PERL in the PATH is required." unless system('perl -v')
102
+ # configure extload build
103
+ _mwc = File.join(get_config('aceroot'), 'bin', 'mwc.pl')
104
+
105
+ cur_dir = Dir.getwd
106
+ Dir.chdir File.join('ext', 'extload')
107
+ begin
108
+ sh("perl #{_mwc} -type gnuace")
109
+ ensure
110
+ Dir.chdir cur_dir
111
+ end
112
+ end
113
+
114
+ CLOBBER.include [R2CORBA::Ext.extload_makefile, R2CORBA::Ext.extload_mpc_file]
115
+
116
+ namespace :r2corba do
117
+ namespace :ext do
118
+ #desc 'Build extension loader'
119
+ task :build_extload => R2CORBA::Ext.extload_makefile do
120
+ cur_dir = Dir.getwd
121
+ Dir.chdir File.join('ext', 'extload')
122
+ begin
123
+ sh("#{get_config('makeprog')}#{get_config('with-debug') ? ' debug=1' : ''}")
124
+ ensure
125
+ Dir.chdir cur_dir
126
+ end
127
+ end
128
+
129
+ task :clobber_extload do
130
+ cur_dir = Dir.getwd
131
+ Dir.chdir File.join('ext', 'extload')
132
+ begin
133
+ sh("#{get_config('makeprog')} realclean") if File.exists?('GNUmakefile')
134
+ ensure
135
+ Dir.chdir cur_dir
136
+ end
137
+ end
138
+ end
139
+ end
140
+
141
+ Rake::Task['r2corba:ext:build'].enhance ['r2corba:ext:build_extload']
142
+ Rake::Task['clobber'].enhance ['r2corba:ext:clobber_extload']
143
+
144
+ end
145
+
146
+ # Do we handle ACE+TAO here?
147
+ unless get_config('without-tao')
148
+
149
+ file R2CORBA::Ext.ace_config_path => R2CORBA::BUILD_CFG do |t|
150
+ File.open(t.name, "w") {|f|
151
+ f.puts R2CORBA::Ext.ace_config
152
+ }
153
+ end
154
+
155
+ CLOBBER.include R2CORBA::Ext.ace_config_path
156
+
157
+ file R2CORBA::Ext.platform_macros_path => R2CORBA::BUILD_CFG do |t|
158
+ File.open(t.name, "w") {|f|
159
+ f.puts R2CORBA::Ext.platform_macros
160
+ }
161
+ end
162
+
163
+ CLOBBER.include R2CORBA::Ext.platform_macros_path
164
+
165
+ file R2CORBA::Ext.default_features_path => R2CORBA::BUILD_CFG do |t|
166
+ File.open(t.name, "w") do |f|
167
+ f.puts R2CORBA::Ext.default_features
168
+ end
169
+ end
170
+
171
+ CLOBBER.include R2CORBA::Ext.default_features_path
172
+
173
+ file R2CORBA::Ext.tao_mwc_path => R2CORBA::BUILD_CFG do |t|
174
+ File.open(t.name, "w") do |f|
175
+ f.puts R2CORBA::Ext.tao_mwc
176
+ end
177
+ end
178
+
179
+ CLOBBER.include R2CORBA::Ext.tao_mwc_path
180
+
181
+ file R2CORBA::Ext.tao_makefile => [R2CORBA::Ext.ace_config_path,
182
+ R2CORBA::Ext.platform_macros_path,
183
+ R2CORBA::Ext.default_features_path,
184
+ R2CORBA::Ext.tao_mwc_path] do
185
+ # check availability of PERL
186
+ raise "PERL missing! A working version of PERL in the PATH is required." unless system('perl -v')
187
+ # generate ACE+TAO makefile
188
+ cur_dir = Dir.getwd
189
+ Dir.chdir File.expand_path(get_config('aceroot'))
190
+ begin
191
+ sh("perl bin/mwc.pl -type gnuautobuild TAO4Ruby.mwc")
192
+ ensure
193
+ Dir.chdir cur_dir
194
+ end
195
+ end
196
+
197
+ CLOBBER.include R2CORBA::Ext.tao_makefile
198
+
199
+ namespace :r2corba do
200
+ namespace :ext do
201
+ task :build_tao
202
+
203
+ R2CORBA::Ext::ace_shlibs.each do |acelib|
204
+ file acelib => R2CORBA::Ext.tao_makefile do
205
+ # build ACE+TAO
206
+ cur_dir = Dir.getwd
207
+ Dir.chdir File.expand_path(get_config('aceroot'))
208
+ begin
209
+ if R2CORBA::Config.is_linux && R2CORBA::Config.cpu_cores > 2
210
+ sh("#{get_config('makeprog')} -j#{R2CORBA::Config.cpu_cores - 2} #{get_config('with-debug') ? ' debug=1' : ''}")
211
+ else
212
+ sh("#{get_config('makeprog')}#{get_config('with-debug') ? ' debug=1' : ''}")
213
+ end
214
+ ensure
215
+ Dir.chdir cur_dir
216
+ end
217
+ # touch all libraries to cover the case that the timestamps do not match
218
+ # the makefile but make triggers not rebuild as no sources have changed
219
+ touch(R2CORBA::Ext::ace_shlibs)
220
+ end
221
+ Rake::Task['r2corba:ext:build_tao'].enhance [acelib]
222
+ end
223
+
224
+ task :clobber_tao do
225
+ # clean ACE+TAO
226
+ cur_dir = Dir.getwd
227
+ Dir.chdir File.expand_path(get_config('aceroot'))
228
+ begin
229
+ sh("#{get_config('makeprog')} realclean") if File.exists?('GNUmakefile')
230
+ ensure
231
+ Dir.chdir cur_dir
232
+ end
233
+ end
234
+ end
235
+ end
236
+
237
+ Rake::Task['r2corba:ext:build'].enhance ['r2corba:ext:build_tao']
238
+ Rake::Task['r2corba:ext:clobber'].enhance ['r2corba:ext:clobber_tao']
239
+
240
+ end # !without-tao
241
+
242
+ end # defined?(JRUBY_VERSION)