r2corba 1.5.1-universal-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +173 -0
  3. data/LICENSE +59 -0
  4. data/LICENSE.jacorb +660 -0
  5. data/README +62 -0
  6. data/THANKS +54 -0
  7. data/bin/r2corba +8 -0
  8. data/bin/r2corba.bat +20 -0
  9. data/bin/ridlc +11 -0
  10. data/bin/ridlc.bat +23 -0
  11. data/bin/rins +7 -0
  12. data/bin/rins.bat +19 -0
  13. data/jacorb/lib/antlr-2.7.2.jar +0 -0
  14. data/jacorb/lib/jacorb-3.5.jar +0 -0
  15. data/jacorb/lib/jacorb-omgapi-3.5.jar +0 -0
  16. data/jacorb/lib/jacorb-services-3.5.jar +0 -0
  17. data/jacorb/lib/slf4j-api-1.7.6.jar +0 -0
  18. data/jacorb/lib/slf4j-jdk14-1.7.6.jar +0 -0
  19. data/lib/corba.rb +16 -0
  20. data/lib/corba/cbase/IORMap.rb +33 -0
  21. data/lib/corba/cbase/ORB.rb +237 -0
  22. data/lib/corba/cbase/Request.rb +134 -0
  23. data/lib/corba/cbase/Streams.rb +129 -0
  24. data/lib/corba/cbase/Stub.rb +19 -0
  25. data/lib/corba/cbase/Typecode.rb +441 -0
  26. data/lib/corba/cbase/Values.rb +129 -0
  27. data/lib/corba/cbase/exception.rb +66 -0
  28. data/lib/corba/cbase/poa.rb +23 -0
  29. data/lib/corba/cbase/policies.rb +78 -0
  30. data/lib/corba/cbase/post_require.rb +14 -0
  31. data/lib/corba/cbase/require.rb +28 -0
  32. data/lib/corba/cmds/base.rb +85 -0
  33. data/lib/corba/cmds/test.rb +30 -0
  34. data/lib/corba/common/Any.rb +91 -0
  35. data/lib/corba/common/IDL.rb +104 -0
  36. data/lib/corba/common/ORB.rb +368 -0
  37. data/lib/corba/common/Object.rb +208 -0
  38. data/lib/corba/common/Request.rb +20 -0
  39. data/lib/corba/common/Servant.rb +108 -0
  40. data/lib/corba/common/Struct.rb +22 -0
  41. data/lib/corba/common/Stub.rb +79 -0
  42. data/lib/corba/common/Typecode.rb +1121 -0
  43. data/lib/corba/common/Union.rb +56 -0
  44. data/lib/corba/common/Values.rb +92 -0
  45. data/lib/corba/common/const.rb +22 -0
  46. data/lib/corba/common/exception.rb +68 -0
  47. data/lib/corba/common/require.rb +27 -0
  48. data/lib/corba/common/version.rb +22 -0
  49. data/lib/corba/idl/BiDirPolicyC.rb +63 -0
  50. data/lib/corba/idl/CosNamingC.rb +461 -0
  51. data/lib/corba/idl/CosNamingS.rb +309 -0
  52. data/lib/corba/idl/IDL.rb +21 -0
  53. data/lib/corba/idl/IORTable.pidl +62 -0
  54. data/lib/corba/idl/MessagingC.rb +904 -0
  55. data/lib/corba/idl/POAC.rb +930 -0
  56. data/lib/corba/idl/TAO_Ext.pidl +46 -0
  57. data/lib/corba/idl/r2c_orb.rb +572 -0
  58. data/lib/corba/idl/require.rb +20 -0
  59. data/lib/corba/jbase/Any.rb +273 -0
  60. data/lib/corba/jbase/IORMap.rb +36 -0
  61. data/lib/corba/jbase/ORB.rb +112 -0
  62. data/lib/corba/jbase/Object.rb +99 -0
  63. data/lib/corba/jbase/Request.rb +226 -0
  64. data/lib/corba/jbase/Servant.rb +248 -0
  65. data/lib/corba/jbase/ServerRequest.rb +128 -0
  66. data/lib/corba/jbase/Streams.rb +671 -0
  67. data/lib/corba/jbase/Stub.rb +38 -0
  68. data/lib/corba/jbase/Typecode.rb +520 -0
  69. data/lib/corba/jbase/Values.rb +173 -0
  70. data/lib/corba/jbase/exception.rb +106 -0
  71. data/lib/corba/jbase/poa.rb +229 -0
  72. data/lib/corba/jbase/policies.rb +300 -0
  73. data/lib/corba/jbase/post_require.rb +14 -0
  74. data/lib/corba/jbase/require.rb +89 -0
  75. data/lib/corba/naming.rb +14 -0
  76. data/lib/corba/naming_service.rb +15 -0
  77. data/lib/corba/poa.rb +15 -0
  78. data/lib/corba/policies.rb +18 -0
  79. data/lib/corba/require.rb +17 -0
  80. data/lib/corba/svcs/ins/cos_naming.rb +426 -0
  81. data/lib/corba/svcs/ins/ins.rb +526 -0
  82. data/lib/corba/svcs/ins/naming_service.rb +119 -0
  83. data/lib/ridlbe/ruby/config.rb +336 -0
  84. data/lib/ridlbe/ruby/orb.pidlc +0 -0
  85. data/lib/ridlbe/ruby/require.rb +16 -0
  86. data/lib/ridlbe/ruby/walker.rb +1582 -0
  87. data/mkrf_conf_bingem.rb +151 -0
  88. data/rakelib/bin.rake +80 -0
  89. data/rakelib/bin.rb +146 -0
  90. data/rakelib/build.rake +87 -0
  91. data/rakelib/config.rake +52 -0
  92. data/rakelib/config.rb +544 -0
  93. data/rakelib/gem.rake +236 -0
  94. data/rakelib/gem.rb +146 -0
  95. data/rakelib/package.rake +26 -0
  96. data/rakelib/test.rake +23 -0
  97. data/test/BiDirectional/Test.idl +34 -0
  98. data/test/BiDirectional/client.rb +132 -0
  99. data/test/BiDirectional/run_test.rb +68 -0
  100. data/test/BiDirectional/server.ior +1 -0
  101. data/test/BiDirectional/server.rb +169 -0
  102. data/test/CORBA_Services/Naming/BindingIterator/Test.idl +27 -0
  103. data/test/CORBA_Services/Naming/BindingIterator/client.rb +121 -0
  104. data/test/CORBA_Services/Naming/BindingIterator/ins.ior +1 -0
  105. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +82 -0
  106. data/test/CORBA_Services/Naming/BindingIterator/server.rb +109 -0
  107. data/test/CORBA_Services/Naming/Corbaname/Test.idl +27 -0
  108. data/test/CORBA_Services/Naming/Corbaname/client.rb +85 -0
  109. data/test/CORBA_Services/Naming/Corbaname/corbaname.ior +1 -0
  110. data/test/CORBA_Services/Naming/Corbaname/ins.ior +1 -0
  111. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +88 -0
  112. data/test/CORBA_Services/Naming/Corbaname/server.rb +135 -0
  113. data/test/CORBA_Services/Naming/Simple/Test.idl +27 -0
  114. data/test/CORBA_Services/Naming/Simple/client.rb +84 -0
  115. data/test/CORBA_Services/Naming/Simple/ins.ior +1 -0
  116. data/test/CORBA_Services/Naming/Simple/run_test.rb +82 -0
  117. data/test/CORBA_Services/Naming/Simple/server.rb +109 -0
  118. data/test/Collocation/Diamond.idl +39 -0
  119. data/test/Collocation/run_test.rb +52 -0
  120. data/test/Collocation/test.rb +195 -0
  121. data/test/Connect_Timeout/Test.idl +27 -0
  122. data/test/Connect_Timeout/client.rb +111 -0
  123. data/test/Connect_Timeout/run_test.rb +52 -0
  124. data/test/DII/Test.idl +27 -0
  125. data/test/DII/client.rb +115 -0
  126. data/test/DII/run_test.rb +69 -0
  127. data/test/DII/server.ior +1 -0
  128. data/test/DII/server.rb +95 -0
  129. data/test/DSI/Test.idl +27 -0
  130. data/test/DSI/client.rb +66 -0
  131. data/test/DSI/run_test.rb +69 -0
  132. data/test/DSI/server.ior +1 -0
  133. data/test/DSI/server.rb +106 -0
  134. data/test/Exceptions/Test.idl +48 -0
  135. data/test/Exceptions/client.rb +118 -0
  136. data/test/Exceptions/run_test.rb +69 -0
  137. data/test/Exceptions/server.ior +1 -0
  138. data/test/Exceptions/server.rb +131 -0
  139. data/test/Hello/Test.idl +27 -0
  140. data/test/Hello/client.rb +78 -0
  141. data/test/Hello/gateway.ior +1 -0
  142. data/test/Hello/run_test.rb +71 -0
  143. data/test/Hello/server.rb +95 -0
  144. data/test/IDL_Test/Test.idl +113 -0
  145. data/test/IDL_Test/Test_inc.idl +17 -0
  146. data/test/IDL_Test/client.rb +102 -0
  147. data/test/IDL_Test/run_test.rb +69 -0
  148. data/test/IDL_Test/server.ior +1 -0
  149. data/test/IDL_Test/server.rb +99 -0
  150. data/test/IORMap/Test.idl +27 -0
  151. data/test/IORMap/client.rb +73 -0
  152. data/test/IORMap/run_test.rb +69 -0
  153. data/test/IORMap/server.ior +1 -0
  154. data/test/IORMap/server.rb +114 -0
  155. data/test/IORTable/Test.idl +27 -0
  156. data/test/IORTable/client.rb +75 -0
  157. data/test/IORTable/run_test.rb +69 -0
  158. data/test/IORTable/server.ior +0 -0
  159. data/test/IORTable/server.rb +130 -0
  160. data/test/Implicit_Conversion/Test.idl +31 -0
  161. data/test/Implicit_Conversion/client.rb +110 -0
  162. data/test/Implicit_Conversion/run_test.rb +69 -0
  163. data/test/Implicit_Conversion/server.ior +1 -0
  164. data/test/Implicit_Conversion/server.rb +99 -0
  165. data/test/Multi_Threading/Multiple_ORB/Test.idl +27 -0
  166. data/test/Multi_Threading/Multiple_ORB/client.rb +82 -0
  167. data/test/Multi_Threading/Multiple_ORB/run_test.rb +71 -0
  168. data/test/Multi_Threading/Multiple_ORB/server.rb +108 -0
  169. data/test/Multi_Threading/Multiple_ORB/server0.ior +1 -0
  170. data/test/Multi_Threading/Multiple_ORB/server1.ior +1 -0
  171. data/test/Multi_Threading/Simple/Test.idl +27 -0
  172. data/test/Multi_Threading/Simple/client.rb +93 -0
  173. data/test/Multi_Threading/Simple/run_test.rb +69 -0
  174. data/test/Multi_Threading/Simple/server.ior +1 -0
  175. data/test/Multi_Threading/Simple/server.rb +118 -0
  176. data/test/Multi_Threading/Threads/Test.idl +31 -0
  177. data/test/Multi_Threading/Threads/client.rb +80 -0
  178. data/test/Multi_Threading/Threads/run_test.rb +76 -0
  179. data/test/Multi_Threading/Threads/server.ior +1 -0
  180. data/test/Multi_Threading/Threads/server.rb +119 -0
  181. data/test/Multi_Threading/Threads/watchdog.ior +1 -0
  182. data/test/Multi_Threading/Threads/watchdog.rb +87 -0
  183. data/test/Multiple_Servant_Interfaces/Test.idl +34 -0
  184. data/test/Multiple_Servant_Interfaces/client.rb +70 -0
  185. data/test/Multiple_Servant_Interfaces/run_test.rb +69 -0
  186. data/test/Multiple_Servant_Interfaces/server.ior +1 -0
  187. data/test/Multiple_Servant_Interfaces/server.rb +102 -0
  188. data/test/Nil/Test.idl +27 -0
  189. data/test/Nil/run_test.rb +52 -0
  190. data/test/Nil/test.rb +78 -0
  191. data/test/OBV/AbstractInterface/client.rb +179 -0
  192. data/test/OBV/AbstractInterface/run_test.rb +69 -0
  193. data/test/OBV/AbstractInterface/server.ior +1 -0
  194. data/test/OBV/AbstractInterface/server.rb +149 -0
  195. data/test/OBV/AbstractInterface/test.idl +53 -0
  196. data/test/OBV/Custom/OBV.idl +18 -0
  197. data/test/OBV/Custom/OBV_impl.rb +40 -0
  198. data/test/OBV/Custom/client.rb +86 -0
  199. data/test/OBV/Custom/run_test.rb +69 -0
  200. data/test/OBV/Custom/server.ior +1 -0
  201. data/test/OBV/Custom/server.rb +100 -0
  202. data/test/OBV/Simple/OBV.idl +15 -0
  203. data/test/OBV/Simple/OBV_impl.rb +26 -0
  204. data/test/OBV/Simple/client.rb +86 -0
  205. data/test/OBV/Simple/run_test.rb +69 -0
  206. data/test/OBV/Simple/server.ior +1 -0
  207. data/test/OBV/Simple/server.rb +100 -0
  208. data/test/OBV/Simple_Event/Event.idl +15 -0
  209. data/test/OBV/Simple_Event/Event_impl.rb +26 -0
  210. data/test/OBV/Simple_Event/client.rb +86 -0
  211. data/test/OBV/Simple_Event/run_test.rb +69 -0
  212. data/test/OBV/Simple_Event/server.ior +1 -0
  213. data/test/OBV/Simple_Event/server.rb +100 -0
  214. data/test/OBV/Supports/client.rb +116 -0
  215. data/test/OBV/Supports/run_test.rb +69 -0
  216. data/test/OBV/Supports/server.ior +1 -0
  217. data/test/OBV/Supports/server.rb +103 -0
  218. data/test/OBV/Supports/supports.idl +33 -0
  219. data/test/OBV/Supports/supports_impl.rb +57 -0
  220. data/test/OBV/Tree/client.rb +116 -0
  221. data/test/OBV/Tree/run_test.rb +69 -0
  222. data/test/OBV/Tree/server.ior +1 -0
  223. data/test/OBV/Tree/server.rb +117 -0
  224. data/test/OBV/Tree/test.idl +32 -0
  225. data/test/OBV/Truncatable/Extra.idl +27 -0
  226. data/test/OBV/Truncatable/Truncatable.idl +105 -0
  227. data/test/OBV/Truncatable/Truncatable_impl.rb +86 -0
  228. data/test/OBV/Truncatable/client.rb +279 -0
  229. data/test/OBV/Truncatable/run_test.rb +69 -0
  230. data/test/OBV/Truncatable/server.ior +1 -0
  231. data/test/OBV/Truncatable/server.rb +89 -0
  232. data/test/OBV/ValueBox/client.rb +497 -0
  233. data/test/OBV/ValueBox/run_test.rb +69 -0
  234. data/test/OBV/ValueBox/server.ior +1 -0
  235. data/test/OBV/ValueBox/server.rb +271 -0
  236. data/test/OBV/ValueBox/valuebox.idl +101 -0
  237. data/test/OBV/ValueBox/vb_basic.idl +75 -0
  238. data/test/OBV/ValueBox/vb_struct.idl +68 -0
  239. data/test/OBV/ValueBox/vb_union.idl +21 -0
  240. data/test/Object/Test.idl +27 -0
  241. data/test/Object/client.rb +112 -0
  242. data/test/Object/run_test.rb +69 -0
  243. data/test/Object/server.ior +1 -0
  244. data/test/Object/server.rb +126 -0
  245. data/test/POA/Test.idl +27 -0
  246. data/test/POA/run_test.rb +52 -0
  247. data/test/POA/test.rb +112 -0
  248. data/test/Param_Test/Test.idl +182 -0
  249. data/test/Param_Test/client.rb +277 -0
  250. data/test/Param_Test/run_test.rb +69 -0
  251. data/test/Param_Test/server.ior +1 -0
  252. data/test/Param_Test/server.rb +296 -0
  253. data/test/Performance/Simple/Test.idl +27 -0
  254. data/test/Performance/Simple/client.rb +90 -0
  255. data/test/Performance/Simple/run_test.rb +69 -0
  256. data/test/Performance/Simple/server.ior +1 -0
  257. data/test/Performance/Simple/server.rb +95 -0
  258. data/test/Policies/Test.idl +27 -0
  259. data/test/Policies/run_test.rb +52 -0
  260. data/test/Policies/test.rb +144 -0
  261. data/test/Timeout/client.rb +207 -0
  262. data/test/Timeout/run_test.rb +69 -0
  263. data/test/Timeout/server.ior +1 -0
  264. data/test/Timeout/server.rb +109 -0
  265. data/test/Timeout/test.idl +19 -0
  266. data/test/lib/assert.rb +43 -0
  267. data/test/lib/test.rb +542 -0
  268. data/test/test.log +20 -0
  269. data/test/test2.log +5000 -0
  270. data/test/test_runner.rb +193 -0
  271. metadata +349 -0
@@ -0,0 +1,52 @@
1
+ #--------------------------------------------------------------------
2
+ # config.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
+ require File.join(File.dirname(__FILE__), 'config.rb')
15
+
16
+ namespace :r2corba do
17
+ task :configure do
18
+ R2CORBA::Config.define
19
+ R2CORBA::Config.check
20
+ R2CORBA::Config.save
21
+ # find out if more tasks were specified to run after configure
22
+ while ARGV.shift.to_s =~ /^(r2corba:)?configure$/ do; end
23
+ # if so start a new rake process to run these
24
+ unless ARGV.empty?
25
+ # restarting ensures correct loading of config and the tasks that depend on that
26
+ exec('rake', *ARGV)
27
+ end
28
+ end
29
+
30
+ namespace :config do
31
+ task :show do
32
+ R2CORBA::CFGKEYS.each do |ck|
33
+ puts "%20s => %s" % [ck, get_config(ck)]
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ desc 'Configure R2CORBA build settings (calling with "-- --help" provides usage information).'
40
+ task :configure => 'r2corba:configure'
41
+
42
+ desc 'Show current R2CORBA build settings'
43
+ task :show => 'r2corba:config:show'
44
+
45
+ file R2CORBA::BUILD_CFG do
46
+ unless File.file?(R2CORBA::BUILD_CFG)
47
+ STDERR.puts "Build configuration missing! First run 'rake r2corba::configure'."
48
+ exit(1)
49
+ end
50
+ end
51
+
52
+ CLOBBER.include R2CORBA::BUILD_CFG
@@ -0,0 +1,544 @@
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
+ if (Rake::Version::MAJOR.to_i == 10 &&
73
+ ((Rake::Version::MINOR.to_i == 4 && Rake::Version::BUILD.to_i >= 2) ||
74
+ Rake::Version::MINOR.to_i > 4)) || Rake::Version::MAJOR.to_i > 10
75
+
76
+ # patch Rake::Application with method to cleanup ARGV consuming
77
+ # all Rake options
78
+ class Rake::Application
79
+
80
+ def cleanup_args(argv = ARGV) # :nodoc:
81
+ return argv if options.r2corba_cleanup_done
82
+
83
+ _opt_backup = options
84
+ @options = OpenStruct.new
85
+ options.rakelib = ['rakelib']
86
+ options.trace_output = $stderr
87
+
88
+ begin
89
+ return OptionParser.new do |opts|
90
+ opts.banner = ""
91
+ opts.separator ""
92
+
93
+ standard_rake_options.each { |args| opts.on(*args) }
94
+ opts.environment('RAKEOPT')
95
+ end.parse!(argv)
96
+ ensure
97
+ @options = _opt_backup
98
+ @options.r2corba_cleanup_done = true
99
+ end
100
+ end
101
+
102
+ end
103
+ else
104
+
105
+ class Rake::Application
106
+
107
+ ## noop for other Rake versions
108
+ def cleanup_args(argv = ARGV) # :nodoc:
109
+ argv
110
+ end
111
+
112
+ end
113
+ end
114
+
115
+ module R2CORBA
116
+
117
+ if defined? ::RbConfig
118
+ RB_CONFIG = ::RbConfig::CONFIG
119
+ else
120
+ RB_CONFIG = ::Config::CONFIG
121
+ end unless defined? RB_CONFIG
122
+
123
+ CFGKEYS = %w{prefix
124
+ bindir
125
+ libdir
126
+ datadir
127
+ mandir
128
+ sysconfdir
129
+ localstatedir
130
+ libruby
131
+ librubyver
132
+ librubyverarch
133
+ siteruby
134
+ siterubyver
135
+ siterubyverarch
136
+ rbdir
137
+ sodir}
138
+
139
+ RBDEFAULTS = %w{bindir
140
+ libdir
141
+ datadir
142
+ mandir
143
+ sysconfdir
144
+ localstatedir}
145
+
146
+ CONFIG = {
147
+ :libruby => File.join(RB_CONFIG['libdir'], 'ruby'),
148
+ :librubyver => RB_CONFIG['rubylibdir'],
149
+ :librubyverarch => RB_CONFIG['archdir'],
150
+ :siteruby => RB_CONFIG['sitedir'],
151
+ :siterubyver => RB_CONFIG['sitelibdir'],
152
+ :siterubyverarch => RB_CONFIG['sitearchdir'],
153
+ :rbdir => :siterubyver,
154
+ :sodir => :siterubyverarch,
155
+ }
156
+
157
+ if defined?(JRUBY_VERSION)
158
+ CFGKEYS.concat(%w{without-jacorb jacorb_home})
159
+ CONFIG.merge!({
160
+ :'without-jacorb' => false,
161
+ :jacorb_home => ENV['JACORB_HOME'] || ''
162
+ })
163
+ BUILD_CFG = '.jrconfig'
164
+ else
165
+ CFGKEYS.concat(%w{makeprog without-tao aceroot taoroot mpcroot aceinstdir with-ipv6 with-ssl sslroot with-debug})
166
+ CONFIG.merge!({
167
+ :makeprog => 'make',
168
+ :'without-tao' => false,
169
+ :aceroot => ENV['ACE_ROOT'] || '',
170
+ :taoroot => ENV['TAO_ROOT'] || '',
171
+ :mpcroot => ENV['MPC_ROOT'] || '',
172
+ :aceinstdir => '',
173
+ :'with-ipv6' => false,
174
+ :'with-ssl' => false,
175
+ :sslroot => ENV['SSL_ROOT'] || (RUBY_PLATFORM =~ /mingw32/ ? '' : '/usr'),
176
+ :'with-debug' => false,
177
+ })
178
+ BUILD_CFG = '.rconfig'
179
+ end
180
+
181
+ module AccessMethods
182
+ def get_config(key)
183
+ v = R2CORBA::CONFIG.has_key?(key.to_sym) ? R2CORBA::CONFIG[key.to_sym] : (RBDEFAULTS.include?(key.to_s) ? RB_CONFIG[key.to_s] : nil)
184
+ v = R2CORBA::CONFIG[v] while Symbol === v && R2CORBA::CONFIG.has_key?(v)
185
+ v
186
+ end
187
+
188
+ def set_config(key, val)
189
+ R2CORBA::CONFIG[key.to_sym] = val
190
+ end
191
+ end
192
+
193
+ module Config
194
+
195
+ @@ruby_ver = RUBY_VERSION.split('.').collect {|n| n.to_i}
196
+
197
+ def self.rb_ver_major
198
+ @@ruby_ver[0]
199
+ end
200
+
201
+ def self.rb_ver_minor
202
+ @@ruby_ver[1]
203
+ end
204
+
205
+ def self.rb_ver_release
206
+ @@ruby_ver[2]
207
+ end
208
+
209
+ @@is_win32 = RUBY_PLATFORM =~ /mingw32/ ? true : false
210
+ @@is_win64 = (@@is_win32 && (RUBY_PLATFORM =~ /x64/)) ? true : false
211
+ @@is_linux = RB_CONFIG['target_os'] =~ /linux/ ? true : false
212
+ @@is_osx = RUBY_PLATFORM =~ /darwin/ ? true : false
213
+
214
+ if @@is_linux
215
+ # determin distro
216
+ io_args = [$/, {:encoding => 'utf-8'}] if rb_ver_major > 1 || (rb_ver_minor > 8 && rb_ver_major == 1)
217
+ name = 'linux'
218
+ if File.readable?('/etc/os-release')
219
+ # find 'NAME=...'
220
+ File.foreach('/etc/os-release', *io_args) do |ln|
221
+ if /^NAME=(.*)$/ =~ ln.strip
222
+ name = $1.downcase
223
+ break
224
+ end
225
+ end
226
+ elsif File.readable?('/etc/lsb-release')
227
+ # find 'DISTRIB_ID='
228
+ File.foreach('/etc/lsb-release', *io_args) do |ln|
229
+ if /^DISTRIB_ID=(.*)$/ =~ ln.strip
230
+ name = $1.downcase
231
+ break
232
+ end
233
+ end
234
+ elsif File.readable?('/etc/redhat-release')
235
+ name = File.read('/etc/redhat-release').strip.downcase
236
+ elsif File.exists?('/etc/SuSE-release')
237
+ name = 'suse'
238
+ elsif File.exists?('/etc/debian_version')
239
+ name = 'debian'
240
+ end
241
+ @@linux_distro = case name
242
+ when /suse/
243
+ :suse
244
+ when /fedora/
245
+ :fedora
246
+ when /ubuntu/
247
+ :ubuntu
248
+ when /red\s*hat/
249
+ :redhat
250
+ when /centos/
251
+ :centos
252
+ when /debian/
253
+ :debian
254
+ else
255
+ :linux
256
+ end
257
+ else
258
+ @@linux_distro = :none
259
+ end
260
+
261
+ def self.is_win32
262
+ @@is_win32
263
+ end
264
+ def self.is_win64
265
+ @@is_win64
266
+ end
267
+ def self.is_linux
268
+ @@is_linux
269
+ end
270
+ def self.linux_distro
271
+ @@linux_distro
272
+ end
273
+ def self.is_osx
274
+ @@is_osx
275
+ end
276
+
277
+ @@cpu_cores = (@@is_linux ? `cat /proc/cpuinfo | grep processor | wc -l`.to_i : 1)
278
+
279
+ def self.cpu_cores
280
+ @@cpu_cores
281
+ end
282
+
283
+ @@ridl_local = nil
284
+ @@ridlc = nil
285
+
286
+ def self.ridl_is_local?
287
+ @@ridl_local
288
+ end
289
+
290
+ def self.ridlc
291
+ @@ridlc.dup
292
+ end
293
+
294
+ @@rpath_patch = nil
295
+
296
+ def self.rpath_patch
297
+ @@rpath_patch
298
+ end
299
+
300
+ def self.init
301
+ if defined?(JRUBY_VERSION)
302
+ # check/set environment settings for JacORB
303
+ ENV['JACORB_HOME'] ||= get_config('jacorb_home')
304
+ else
305
+
306
+ if Dir[File.join('ext', 'libACE.*')].empty? # Don't check for ACE/TAO installation when executed for binary gem install
307
+
308
+ # check/set environment settings for ACE+TAO
309
+ ENV['ACE_ROOT'] = get_config('aceroot')
310
+ ENV['TAO_ROOT'] = get_config('taoroot')
311
+ ENV['MPC_ROOT'] = get_config('mpcroot')
312
+
313
+ if is_win32
314
+ ENV['PATH'] = "#{File.join(ENV['ACE_ROOT'],'lib')}#{';'}#{ENV['PATH']}"
315
+ ENV['SSL_ROOT'] = get_config('sslroot') if get_config('with-ssl')
316
+ elsif RUBY_PLATFORM =~ /darwin/
317
+ ENV['DYLD_LIBRARY_PATH'] = "#{File.join(ENV['ACE_ROOT'],'lib')}#{File::PATH_SEPARATOR}#{ENV['DYLD_LIBRARY_PATH'] || ""}"
318
+ ENV['SSL_ROOT'] = get_config('sslroot') if get_config('with-ssl') && get_config('sslroot')!='/usr'
319
+ else
320
+ ENV['LD_LIBRARY_PATH'] = "#{File.join(ENV['ACE_ROOT'],'lib')}#{File::PATH_SEPARATOR}#{ENV['LD_LIBRARY_PATH'] || ""}"
321
+ ENV['SSL_ROOT'] = get_config('sslroot') if get_config('with-ssl') && get_config('sslroot')!='/usr'
322
+ end
323
+
324
+ else
325
+
326
+ unless is_win32
327
+ # check for required tools to patch RPATH setting of shared libs
328
+ if is_osx
329
+ if system('which install_name_tool > /dev/null 2>&1')
330
+ @@rpath_patch = 'install_name_tool'
331
+ else
332
+ raise 'Installation of binary gem requires an installed version of the install_name_tool utility.'
333
+ end
334
+ else
335
+ if system('which patchelf > /dev/null 2>&1')
336
+ @@rpath_patch = 'patchelf --set-rpath'
337
+ elsif system('which chrpath > /dev/null 2>&1')
338
+ @@rpath_patch = 'chrpath --replace'
339
+ else
340
+ raise 'Installation of binary gem requires an installed version of either the patchelf OR chrpath utility.'
341
+ end
342
+ end
343
+ end
344
+
345
+ end
346
+
347
+ end
348
+
349
+ @@ridlc = File.join('bin', 'ridlc')
350
+
351
+ # check availability of RIDL; either as gem or in subdir
352
+ if (@@ridl_local = File.exists?(File.join('ridl', 'lib', 'ridl', 'ridl.rb')))
353
+ incdirs = [
354
+ File.expand_path(File.join('ridl', 'lib')),
355
+ File.expand_path('lib'),
356
+ ENV['RUBYLIB']
357
+ ].compact
358
+ ENV['RUBYLIB'] = incdirs.join(File::PATH_SEPARATOR)
359
+ else # RIDL probably installed as gem
360
+ incdirs = [
361
+ File.expand_path('lib'),
362
+ ENV['RUBYLIB']
363
+ ].compact
364
+ ENV['RUBYLIB'] = incdirs.join(File::PATH_SEPARATOR)
365
+ end
366
+
367
+ end
368
+
369
+ def self.define
370
+ _argv = Rake.application.cleanup_args(ARGV)
371
+ OptionParser.new do |opts|
372
+ opts.banner = "Usage: rake [rake options] -- configure [options]"
373
+
374
+ opts.separator ""
375
+
376
+ opts.on('--prefix=path',
377
+ "path prefix of target environment [#{get_config(:prefix)}]") {|v| set_config(:prefix, File.expand_path(v))}
378
+ opts.on('--bindir=path',
379
+ "the directory for commands [#{RB_CONFIG['bindir']}]") {|v| CONFIG[:bindir] = v}
380
+ opts.on('--libdir=path',
381
+ "the directory for libraries [#{RB_CONFIG['libdir']}]") {|v| CONFIG[:libdir] = v}
382
+ opts.on('--datadir=path',
383
+ "the directory for shared data [#{RB_CONFIG['datadir']}]") {|v| CONFIG[:datadir] = v}
384
+ opts.on('--mandir=path',
385
+ "the directory for man pages [#{RB_CONFIG['mandir']}]") {|v| CONFIG[:mandir] = v}
386
+ opts.on('--sysconfdir=path',
387
+ "the directory for system configuration files [#{RB_CONFIG['sysconfdir']}]") {|v| CONFIG[:sysconfdir] = v}
388
+ opts.on('--localstatedir=path',
389
+ "the directory for local state data [#{RB_CONFIG['localstatedir']}]") {|v| CONFIG[:localstatedir] = v}
390
+ opts.on('--libruby=path',
391
+ "the directory for ruby libraries [#{get_config('libruby')}]") {|v| CONFIG[:libruby] = v}
392
+ opts.on('--librubyver=path',
393
+ "the directory for standard ruby libraries [#{get_config('librubyver')}]") {|v| CONFIG[:librubyver] = v}
394
+ opts.on('--librubyverarch=path',
395
+ "the directory for standard ruby extensions [#{get_config('librubyverarch')}]") {|v| CONFIG[:librubyverarch] = v}
396
+ opts.on('--siteruby=path',
397
+ "the directory for version-independent aux ruby libraries [#{get_config('siteruby')}]") {|v| CONFIG[:siteruby] = v}
398
+ opts.on('--siterubyver=path',
399
+ "the directory for aux ruby libraries [#{get_config('siterubyver')}]") {|v| CONFIG[:siterubyver] = v}
400
+ opts.on('--siterubyverarch=path',
401
+ "the directory for aux ruby binaries [#{get_config('siterubyverarch')}]") {|v| CONFIG[:siterubyverarch] = v}
402
+ opts.on('--rbdir=path',
403
+ "the directory for ruby scripts [#{get_config(:rbdir)}]") {|v| CONFIG[:rbdir] = v}
404
+ opts.on('--sodir=path',
405
+ "the directory for ruby extentions [#{get_config(:sodir)}]") {|v| CONFIG[:sodir] = v}
406
+ if defined?(JRUBY_VERSION)
407
+ opts.on('--without-jacorb',
408
+ "do *not* install JacORB JAR files with R2CORBA [#{get_config('without-jacorb')}]") {|v| CONFIG[:'without-jacorb'] = true}
409
+ opts.on('--jacorb-home=path',
410
+ "the path to the root directory of JacORB [#{get_config(:jacorb_home)}]") {|v| CONFIG[:jacorb_home] = v}
411
+ else
412
+ opts.on('--makeprog=name',
413
+ "the make program to compile ruby extentions [#{get_config(:makeprog)}]") {|v| CONFIG[:makeprog] = v}
414
+ opts.on('--without-tao',
415
+ "do *not* configure/build/clean the ACE+TAO libraries [#{get_config('without-tao')}]") {|v| CONFIG[:'without-tao'] = true }
416
+ opts.on('--aceroot=path',
417
+ "the path to the root directory of ACE [#{get_config(:aceroot)}]") {|v| CONFIG[:aceroot] = v}
418
+ opts.on('--taoroot=path',
419
+ "the path to the root directory of TAO [#{get_config(:taoroot)}]") {|v| CONFIG[:taoroot] = v}
420
+ opts.on('--mpcroot=path',
421
+ "the path to the root directory of MPC [#{get_config(:mpcroot)}]") {|v| CONFIG[:mpcroot] = v}
422
+ opts.on('--aceinstdir=path',
423
+ "the directory where the ACE+TAO dlls are installed (automatically determined if not specified) [#{get_config(:aceinstdir)}]") {|v| CONFIG[:aceinstdir] = v}
424
+ opts.on('--with-ipv6',
425
+ "build ACE+TAO libraries with IPv6 support enabled [#{get_config('with-ipv6')}]") {|v| CONFIG[:'with-ipv6'] = true}
426
+ opts.on('--with-ssl',
427
+ "build ACE+TAO libraries with SSL support enabled (autodetected with prebuilt ACE/TAO) [#{get_config('with-ssl')}]") {|v| CONFIG[:'with-ssl'] = true}
428
+ opts.on('--sslroot=path',
429
+ "the root path where SSL includes and libraries can be found [#{get_config(:sslroot)}]") {|v| CONFIG[:sslroot] = v}
430
+ opts.on('--with-debug',
431
+ "build with debugger support [#{get_config('with-debug')}]") {|v| CONFIG[:'with-debug'] = true}
432
+ end
433
+
434
+ opts.separator ""
435
+
436
+ opts.on('--help', 'Show this help message') { puts opts; puts; exit }
437
+ end.parse!(_argv)
438
+ end
439
+
440
+ def self.check
441
+ if defined?(JRUBY_VERSION)
442
+ # check availability of JacORB
443
+ if get_config('jacorb_home')=='' && File.directory?('jacorb')
444
+ set_config('jacorb_home', File.expand_path('jacorb'))
445
+ end
446
+ raise "Cannot find JacORB. Missing JACORB_HOME configuration!" if get_config('jacorb_home').empty?
447
+ else
448
+ if Dir[File.join('ext', 'libACE.*')].empty? # Don't check for ACE/TAO installation when executed for binary gem install
449
+
450
+ if get_config('without-tao') && !(File.directory?(File.join('ACE','ACE_wrappers')) || File.directory?(File.join('ACE','ACE')))
451
+
452
+ # check if a user defined ACE/TAO location is specified or we're using a system standard install
453
+ if get_config('aceroot').empty?
454
+ # assume system standard install; will be checked below
455
+ set_config('aceroot', '/usr/include')
456
+ set_config('taoroot', '/usr/include')
457
+ set_config('mpcroot', '/usr/share/mpc')
458
+ set_config('aceinstdir', get_config('libdir')) if get_config('aceinstdir').empty?
459
+ else
460
+ set_config('aceinstdir', File.join(get_config('aceroot'), 'lib')) if get_config('aceinstdir').empty?
461
+ end
462
+
463
+ else
464
+ # check availability of ACE/TAO
465
+ if get_config('aceroot').empty? && (File.directory?(File.join('ACE','ACE_wrappers')) || File.directory?(File.join('ACE','ACE')))
466
+ 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')))
467
+ end
468
+ if get_config('taoroot').empty? && (File.directory?(File.join(get_config('aceroot'),'TAO')) || File.directory?(File.join('ACE','TAO')))
469
+ 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')))
470
+ end
471
+ if get_config('mpcroot').empty? && (File.directory?(File.join(get_config('aceroot'),'MPC')) || File.directory?(File.join('ACE','MPC')))
472
+ 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')))
473
+ end
474
+
475
+ set_config('aceinstdir', get_config('sodir')) if get_config('aceinstdir').empty?
476
+ end
477
+
478
+ raise 'Cannot find ACE+TAO. Missing ACE_ROOT configuration!' if get_config('aceroot').empty? || !File.directory?(File.join(get_config('aceroot'), 'ace'))
479
+ raise 'Cannot find ACE+TAO. Missing TAO_ROOT configuration!' if get_config('taoroot').empty? || !File.directory?(File.join(get_config('taoroot'), 'tao'))
480
+ raise 'Cannot find MPC. Missing MPC_ROOT configuration!' if get_config('mpcroot').empty? || !File.file?(File.join(get_config('mpcroot'), 'mpc.pl'))
481
+
482
+ unless get_config('without-tao') || get_config('with-ssl')
483
+ set_config('with-ssl', Dir.glob(File.join(get_config('aceroot'), 'lib', '*ACE_SLL.*')).empty?() ? false : true)
484
+ end
485
+
486
+ if is_osx
487
+ if system('which install_name_tool > /dev/null 2>&1')
488
+ @@rpath_patch = 'install_name_tool'
489
+ else
490
+ raise 'Building R2CORBA requires an installed version of the install_name_tool utility.'
491
+ end
492
+ end
493
+
494
+ else
495
+
496
+ unless is_win32
497
+ # check for required tools to patch RPATH setting of shared libs
498
+ if is_osx
499
+ if system('which install_name_tool > /dev/null 2>&1')
500
+ @@rpath_patch = 'install_name_tool'
501
+ else
502
+ raise 'Installation of binary gem requires an installed version of the install_name_tool utility.'
503
+ end
504
+ else
505
+ if system('which patchelf > /dev/null 2>&1')
506
+ @@rpath_patch = 'patchelf --set-rpath'
507
+ elsif system('which chrpath > /dev/null 2>&1')
508
+ @@rpath_patch = 'chrpath --replace'
509
+ else
510
+ raise 'Installation of binary gem requires an installed version of either the patchelf OR chrpath utility.'
511
+ end
512
+ end
513
+ end
514
+
515
+ end
516
+ end
517
+
518
+ # check availability of RIDL; either as gem or in subdir
519
+ unless File.exists?(File.join('ridl', 'lib', 'ridl', 'ridl.rb')) || (`gem search -i -q ridl`.strip) == 'true'
520
+ raise "Missing RIDL installation. R2CORBA requires RIDL installed either as gem or in subdirectory ridl."
521
+ end
522
+ end
523
+
524
+ def self.save
525
+ File.open(BUILD_CFG, 'w') do |f|
526
+ f << YAML.dump(CONFIG)
527
+ end
528
+ end
529
+
530
+ def self.load
531
+ if File.file?(BUILD_CFG)
532
+ File.open(BUILD_CFG, 'r') do |f|
533
+ CONFIG.merge!(YAML.load(f.read))
534
+ end
535
+ init
536
+ end
537
+ end
538
+ end
539
+ end
540
+
541
+ include R2CORBA::AccessMethods
542
+
543
+ # load current config (if any)
544
+ R2CORBA::Config.load