passenger 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (538) hide show
  1. data/DEVELOPERS.TXT +9 -6
  2. data/NEWS +50 -0
  3. data/Rakefile +2 -1
  4. data/bin/passenger-install-apache2-module +4 -4
  5. data/bin/passenger-install-nginx-module +1 -1
  6. data/bin/passenger-make-enterprisey +1 -1
  7. data/build/agents.rb +26 -19
  8. data/build/apache2.rb +49 -46
  9. data/build/basics.rb +37 -13
  10. data/build/common_library.rb +134 -64
  11. data/build/config.rb +18 -11
  12. data/build/cplusplus_support.rb +4 -0
  13. data/build/cxx_tests.rb +26 -12
  14. data/build/documentation.rb +18 -11
  15. data/build/integration_tests.rb +18 -11
  16. data/build/misc.rb +18 -11
  17. data/build/nginx.rb +27 -19
  18. data/build/oxt_tests.rb +18 -11
  19. data/build/packaging.rb +45 -37
  20. data/build/rpm.rb +98 -0
  21. data/build/ruby_extension.rb +19 -13
  22. data/build/ruby_tests.rb +19 -12
  23. data/build/test_basics.rb +23 -11
  24. data/debian/README.Debian +15 -0
  25. data/debian/changelog +185 -0
  26. data/debian/control +47 -19
  27. data/debian/copyright +20 -0
  28. data/debian/libapache2-mod-passenger.install +1 -0
  29. data/debian/libapache2-mod-passenger.postinst +36 -0
  30. data/debian/libapache2-mod-passenger.prerm +15 -0
  31. data/debian/passenger-common.install +4 -0
  32. data/debian/passenger.conf +4 -0
  33. data/debian/passenger.load +1 -0
  34. data/debian/rules +37 -0
  35. data/debian/watch +3 -0
  36. data/{misc → dev}/copy_boost_headers.rb +3 -0
  37. data/{misc → dev}/find_owner_pipe_leaks.rb +0 -0
  38. data/{misc → dev}/render_error_pages.rb +0 -0
  39. data/doc/Users guide Apache.html +39 -1
  40. data/doc/Users guide Apache.txt +40 -0
  41. data/doc/Users guide Nginx.html +1 -1
  42. data/doc/Users guide Standalone.html +1 -1
  43. data/doc/cxxapi/Constants_8h_source.html +1 -1
  44. data/doc/cxxapi/DirectoryMapper_8h_source.html +6 -22
  45. data/doc/cxxapi/EventedClient_8h_source.html +572 -468
  46. data/doc/cxxapi/Exceptions_8h_source.html +142 -129
  47. data/doc/cxxapi/FileDescriptor_8h_source.html +263 -199
  48. data/doc/cxxapi/MessageChannel_8h_source.html +686 -770
  49. data/doc/cxxapi/MessageServer_8h_source.html +1 -1
  50. data/doc/cxxapi/PoolOptions_8h_source.html +79 -78
  51. data/doc/cxxapi/ResourceLocator_8h_source.html +105 -55
  52. data/doc/cxxapi/SafeLibev_8h_source.html +180 -0
  53. data/doc/cxxapi/ServerInstanceDir_8h_source.html +114 -110
  54. data/doc/cxxapi/Session_8h_source.html +1 -1
  55. data/doc/cxxapi/SpawnManager_8h_source.html +208 -208
  56. data/doc/cxxapi/StaticString_8h_source.html +258 -183
  57. data/doc/cxxapi/Utils_8h_source.html +71 -54
  58. data/doc/cxxapi/annotated.html +3 -0
  59. data/doc/cxxapi/classAgentWatcher.html +2 -2
  60. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -1
  61. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -27
  62. data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +5 -0
  63. data/doc/cxxapi/classPassenger_1_1EventedClient.html +102 -7
  64. data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +2 -1
  65. data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +34 -8
  66. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +36 -0
  67. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +52 -0
  68. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -3
  69. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -120
  70. data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +36 -0
  71. data/doc/cxxapi/classPassenger_1_1SafeLibev.html +51 -0
  72. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -0
  73. data/doc/cxxapi/classPassenger_1_1SpawnException.html +22 -0
  74. data/doc/cxxapi/classes.html +14 -14
  75. data/doc/cxxapi/files.html +2 -0
  76. data/doc/cxxapi/functions_0x63.html +6 -3
  77. data/doc/cxxapi/functions_0x64.html +9 -2
  78. data/doc/cxxapi/functions_0x67.html +6 -9
  79. data/doc/cxxapi/functions_0x69.html +3 -0
  80. data/doc/cxxapi/functions_0x77.html +8 -8
  81. data/doc/cxxapi/functions_eval.html +6 -0
  82. data/doc/cxxapi/functions_func.html +18 -17
  83. data/doc/cxxapi/functions_vars.html +8 -0
  84. data/doc/cxxapi/graph_legend.png +0 -0
  85. data/doc/cxxapi/group__Core.png +0 -0
  86. data/doc/cxxapi/group__Hooks.png +0 -0
  87. data/doc/cxxapi/hierarchy.html +3 -0
  88. data/doc/cxxapi/inherit__graph__14.map +1 -1
  89. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  90. data/doc/cxxapi/inherit__graph__14.png +0 -0
  91. data/doc/cxxapi/inherit__graph__15.map +1 -3
  92. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  93. data/doc/cxxapi/inherit__graph__15.png +0 -0
  94. data/doc/cxxapi/inherit__graph__16.map +3 -1
  95. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  96. data/doc/cxxapi/inherit__graph__16.png +0 -0
  97. data/doc/cxxapi/inherit__graph__17.map +1 -1
  98. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  99. data/doc/cxxapi/inherit__graph__17.png +0 -0
  100. data/doc/cxxapi/inherit__graph__18.map +1 -2
  101. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  102. data/doc/cxxapi/inherit__graph__18.png +0 -0
  103. data/doc/cxxapi/inherit__graph__19.map +2 -1
  104. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  105. data/doc/cxxapi/inherit__graph__19.png +0 -0
  106. data/doc/cxxapi/inherit__graph__20.map +1 -1
  107. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  108. data/doc/cxxapi/inherit__graph__20.png +0 -0
  109. data/doc/cxxapi/inherit__graph__21.map +1 -1
  110. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  111. data/doc/cxxapi/inherit__graph__21.png +0 -0
  112. data/doc/cxxapi/inherit__graph__22.map +1 -1
  113. data/doc/cxxapi/inherit__graph__22.md5 +1 -1
  114. data/doc/cxxapi/inherit__graph__22.png +0 -0
  115. data/doc/cxxapi/inherit__graph__23.map +1 -1
  116. data/doc/cxxapi/inherit__graph__23.md5 +1 -1
  117. data/doc/cxxapi/inherit__graph__23.png +0 -0
  118. data/doc/cxxapi/inherit__graph__24.map +1 -1
  119. data/doc/cxxapi/inherit__graph__24.md5 +1 -1
  120. data/doc/cxxapi/inherit__graph__24.png +0 -0
  121. data/doc/cxxapi/inherit__graph__25.map +1 -1
  122. data/doc/cxxapi/inherit__graph__25.md5 +1 -1
  123. data/doc/cxxapi/inherit__graph__25.png +0 -0
  124. data/doc/cxxapi/inherit__graph__26.map +1 -1
  125. data/doc/cxxapi/inherit__graph__26.md5 +1 -1
  126. data/doc/cxxapi/inherit__graph__26.png +0 -0
  127. data/doc/cxxapi/inherit__graph__27.map +1 -1
  128. data/doc/cxxapi/inherit__graph__27.md5 +1 -1
  129. data/doc/cxxapi/inherit__graph__27.png +0 -0
  130. data/doc/cxxapi/inherit__graph__28.map +1 -2
  131. data/doc/cxxapi/inherit__graph__28.md5 +1 -1
  132. data/doc/cxxapi/inherit__graph__28.png +0 -0
  133. data/doc/cxxapi/inherit__graph__29.map +1 -1
  134. data/doc/cxxapi/inherit__graph__29.md5 +1 -1
  135. data/doc/cxxapi/inherit__graph__29.png +0 -0
  136. data/doc/cxxapi/inherit__graph__30.map +1 -1
  137. data/doc/cxxapi/inherit__graph__30.md5 +1 -1
  138. data/doc/cxxapi/inherit__graph__30.png +0 -0
  139. data/doc/cxxapi/inherit__graph__31.map +2 -1
  140. data/doc/cxxapi/inherit__graph__31.md5 +1 -1
  141. data/doc/cxxapi/inherit__graph__31.png +0 -0
  142. data/doc/cxxapi/inherit__graph__32.map +1 -3
  143. data/doc/cxxapi/inherit__graph__32.md5 +1 -1
  144. data/doc/cxxapi/inherit__graph__32.png +0 -0
  145. data/doc/cxxapi/inherit__graph__33.map +1 -1
  146. data/doc/cxxapi/inherit__graph__33.md5 +1 -1
  147. data/doc/cxxapi/inherit__graph__33.png +0 -0
  148. data/doc/cxxapi/inherit__graph__34.map +1 -1
  149. data/doc/cxxapi/inherit__graph__34.md5 +1 -1
  150. data/doc/cxxapi/inherit__graph__34.png +0 -0
  151. data/doc/cxxapi/inherit__graph__35.map +3 -1
  152. data/doc/cxxapi/inherit__graph__35.md5 +1 -1
  153. data/doc/cxxapi/inherit__graph__35.png +0 -0
  154. data/doc/cxxapi/inherit__graph__36.map +1 -1
  155. data/doc/cxxapi/inherit__graph__36.md5 +1 -1
  156. data/doc/cxxapi/inherit__graph__36.png +0 -0
  157. data/doc/cxxapi/inherit__graph__37.map +1 -1
  158. data/doc/cxxapi/inherit__graph__37.md5 +1 -1
  159. data/doc/cxxapi/inherit__graph__37.png +0 -0
  160. data/doc/cxxapi/inherit__graph__38.map +3 -1
  161. data/doc/cxxapi/inherit__graph__38.md5 +1 -1
  162. data/doc/cxxapi/inherit__graph__38.png +0 -0
  163. data/doc/cxxapi/inherit__graph__39.map +3 -1
  164. data/doc/cxxapi/inherit__graph__39.md5 +1 -1
  165. data/doc/cxxapi/inherit__graph__39.png +0 -0
  166. data/doc/cxxapi/inherits.html +33 -24
  167. data/doc/cxxapi/namespacePassenger.html +52 -0
  168. data/doc/cxxapi/namespacemembers.html +6 -0
  169. data/doc/cxxapi/namespacemembers_func.html +6 -0
  170. data/doc/cxxapi/tree.html +8 -0
  171. data/ext/apache2/Configuration.cpp +30 -8
  172. data/ext/apache2/Configuration.hpp +15 -14
  173. data/ext/apache2/DirectoryMapper.h +0 -16
  174. data/ext/apache2/Hooks.cpp +30 -29
  175. data/ext/boost/algorithm/string/detail/case_conv.hpp +6 -6
  176. data/ext/boost/algorithm/string/detail/find_format.hpp +14 -4
  177. data/ext/boost/algorithm/string/detail/find_format_all.hpp +13 -3
  178. data/ext/boost/algorithm/string/detail/find_format_store.hpp +11 -0
  179. data/ext/boost/algorithm/string/erase.hpp +2 -2
  180. data/ext/boost/bind/placeholders.hpp +2 -2
  181. data/ext/boost/concept/detail/backward_compatibility.hpp +16 -0
  182. data/ext/boost/concept/detail/general.hpp +15 -6
  183. data/ext/boost/concept/detail/has_constraints.hpp +5 -3
  184. data/ext/boost/concept/usage.hpp +5 -4
  185. data/ext/boost/concept_check.hpp +10 -1
  186. data/ext/boost/config/abi/borland_prefix.hpp +1 -1
  187. data/ext/boost/config/auto_link.hpp +68 -21
  188. data/ext/boost/config/compiler/borland.hpp +11 -3
  189. data/ext/boost/config/compiler/clang.hpp +62 -0
  190. data/ext/boost/config/compiler/codegear.hpp +21 -7
  191. data/ext/boost/config/compiler/common_edg.hpp +4 -2
  192. data/ext/boost/config/compiler/digitalmars.hpp +1 -1
  193. data/ext/boost/config/compiler/gcc.hpp +46 -7
  194. data/ext/boost/config/compiler/gcc_xml.hpp +25 -0
  195. data/ext/boost/config/compiler/intel.hpp +23 -0
  196. data/ext/boost/config/compiler/kai.hpp +1 -1
  197. data/ext/boost/config/compiler/metrowerks.hpp +1 -1
  198. data/ext/boost/config/compiler/nvcc.hpp +86 -0
  199. data/ext/boost/config/compiler/pgi.hpp +18 -3
  200. data/ext/boost/config/compiler/sunpro_cc.hpp +19 -5
  201. data/ext/boost/config/compiler/vacpp.hpp +8 -0
  202. data/ext/boost/config/compiler/visualc.hpp +27 -11
  203. data/ext/boost/config/platform/cygwin.hpp +0 -3
  204. data/ext/boost/config/platform/symbian.hpp +94 -0
  205. data/ext/boost/config/platform/win32.hpp +8 -1
  206. data/ext/boost/config/select_compiler_config.hpp +10 -0
  207. data/ext/boost/config/select_platform_config.hpp +4 -0
  208. data/ext/boost/config/stdlib/dinkumware.hpp +11 -1
  209. data/ext/boost/config/stdlib/libcomo.hpp +1 -0
  210. data/ext/boost/config/stdlib/libstdcpp3.hpp +1 -0
  211. data/ext/boost/config/stdlib/modena.hpp +1 -0
  212. data/ext/boost/config/stdlib/msl.hpp +1 -0
  213. data/ext/boost/config/stdlib/roguewave.hpp +1 -0
  214. data/ext/boost/config/stdlib/sgi.hpp +1 -0
  215. data/ext/boost/config/stdlib/stlport.hpp +1 -0
  216. data/ext/boost/config/stdlib/vacpp.hpp +1 -0
  217. data/ext/boost/config/suffix.hpp +40 -2
  218. data/ext/boost/cstdint.hpp +36 -7
  219. data/ext/boost/date_time/gregorian/conversion.hpp +4 -2
  220. data/ext/boost/date_time/microsec_time_clock.hpp +7 -7
  221. data/ext/boost/date_time/posix_time/conversion.hpp +4 -2
  222. data/ext/boost/date_time/time_facet.hpp +43 -4
  223. data/ext/boost/detail/endian.hpp +5 -2
  224. data/ext/boost/detail/lcast_precision.hpp +2 -2
  225. data/ext/boost/detail/sp_typeinfo.hpp +1 -1
  226. data/ext/boost/detail/workaround.hpp +5 -0
  227. data/ext/boost/exception/detail/error_info_impl.hpp +3 -3
  228. data/ext/boost/exception/detail/exception_ptr.hpp +76 -135
  229. data/ext/boost/exception/detail/is_output_streamable.hpp +15 -2
  230. data/ext/boost/exception/detail/type_info.hpp +9 -5
  231. data/ext/boost/exception/diagnostic_information.hpp +5 -3
  232. data/ext/boost/exception/exception.hpp +60 -46
  233. data/ext/boost/exception/info.hpp +47 -14
  234. data/ext/boost/function/function_base.hpp +4 -4
  235. data/ext/boost/integer.hpp +4 -0
  236. data/ext/boost/integer_fwd.hpp +9 -3
  237. data/ext/boost/iterator/iterator_concepts.hpp +284 -0
  238. data/ext/boost/iterator/transform_iterator.hpp +0 -1
  239. data/ext/boost/make_shared.hpp +17 -0
  240. data/ext/boost/mpl/aux_/config/has_xxx.hpp +4 -3
  241. data/ext/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp +2 -6
  242. data/ext/boost/mpl/aux_/template_arity.hpp +4 -4
  243. data/ext/boost/mpl/eval_if.hpp +3 -3
  244. data/ext/boost/mpl/has_xxx.hpp +369 -3
  245. data/ext/boost/optional/optional.hpp +3 -1
  246. data/ext/boost/optional/optional_fwd.hpp +1 -1
  247. data/ext/boost/preprocessor/repetition/enum_trailing_params.hpp +38 -0
  248. data/ext/boost/range/algorithm/equal.hpp +188 -0
  249. data/ext/boost/range/as_literal.hpp +15 -15
  250. data/ext/boost/range/concepts.hpp +331 -0
  251. data/ext/boost/range/const_iterator.hpp +7 -4
  252. data/ext/boost/range/detail/extract_optional_type.hpp +52 -0
  253. data/ext/boost/range/detail/implementation_help.hpp +7 -7
  254. data/ext/boost/range/detail/misc_concept.hpp +33 -0
  255. data/ext/boost/range/iterator.hpp +32 -32
  256. data/ext/boost/range/iterator_range.hpp +8 -651
  257. data/ext/boost/range/iterator_range_core.hpp +542 -0
  258. data/ext/boost/range/iterator_range_io.hpp +93 -0
  259. data/ext/boost/range/mutable_iterator.hpp +7 -4
  260. data/ext/boost/range/size.hpp +1 -1
  261. data/ext/boost/range/size_type.hpp +2 -1
  262. data/ext/boost/shared_array.hpp +19 -0
  263. data/ext/boost/smart_ptr/detail/sp_convertible.hpp +2 -2
  264. data/ext/boost/smart_ptr/detail/yield_k.hpp +1 -1
  265. data/ext/boost/smart_ptr/make_shared.hpp +508 -0
  266. data/ext/boost/smart_ptr/shared_array.hpp +147 -0
  267. data/ext/boost/src/pthread/thread.cpp +16 -21
  268. data/ext/boost/src/pthread/timeconv.inl +7 -4
  269. data/ext/boost/thread/barrier.hpp +2 -1
  270. data/ext/boost/thread/detail/config.hpp +7 -1
  271. data/ext/boost/thread/detail/platform.hpp +1 -1
  272. data/ext/boost/thread/detail/thread.hpp +62 -18
  273. data/ext/boost/thread/detail/thread_group.hpp +5 -2
  274. data/ext/boost/thread/detail/tss_hooks.hpp +8 -25
  275. data/ext/boost/thread/future.hpp +45 -34
  276. data/ext/boost/thread/locks.hpp +184 -55
  277. data/ext/boost/thread/pthread/condition_variable.hpp +7 -7
  278. data/ext/boost/thread/pthread/condition_variable_fwd.hpp +4 -2
  279. data/ext/boost/thread/pthread/mutex.hpp +29 -17
  280. data/ext/boost/thread/pthread/once.hpp +5 -0
  281. data/ext/boost/thread/pthread/recursive_mutex.hpp +97 -18
  282. data/ext/boost/thread/pthread/shared_mutex.hpp +1 -1
  283. data/ext/boost/thread/pthread/thread_heap_alloc.hpp +1 -1
  284. data/ext/boost/thread/tss.hpp +2 -0
  285. data/ext/boost/throw_exception.hpp +21 -5
  286. data/ext/boost/token_functions.hpp +111 -91
  287. data/ext/boost/type_traits/add_reference.hpp +19 -1
  288. data/ext/boost/type_traits/function_traits.hpp +2 -2
  289. data/ext/boost/type_traits/is_const.hpp +24 -5
  290. data/ext/boost/type_traits/is_convertible.hpp +1 -1
  291. data/ext/boost/type_traits/is_function.hpp +3 -0
  292. data/ext/boost/type_traits/is_lvalue_reference.hpp +118 -0
  293. data/ext/boost/type_traits/is_reference.hpp +8 -81
  294. data/ext/boost/type_traits/is_rvalue_reference.hpp +29 -0
  295. data/ext/boost/type_traits/is_same.hpp +2 -2
  296. data/ext/boost/type_traits/is_volatile.hpp +26 -7
  297. data/ext/boost/type_traits/remove_const.hpp +12 -0
  298. data/ext/boost/type_traits/remove_cv.hpp +23 -1
  299. data/ext/boost/type_traits/remove_reference.hpp +21 -1
  300. data/ext/boost/type_traits/type_with_alignment.hpp +10 -10
  301. data/ext/boost/units/detail/utility.hpp +104 -0
  302. data/ext/boost/utility/compare_pointees.hpp +1 -1
  303. data/ext/common/AgentsStarter.hpp +151 -161
  304. data/ext/common/ApplicationPool/Pool.h +16 -4
  305. data/ext/common/Constants.h +1 -1
  306. data/ext/common/EventedClient.h +130 -26
  307. data/ext/common/Exceptions.h +15 -2
  308. data/ext/common/FileDescriptor.h +76 -12
  309. data/ext/common/IniFile.h +488 -0
  310. data/ext/common/LoggingAgent/LoggingServer.h +2 -2
  311. data/ext/common/LoggingAgent/RemoteSender.h +15 -6
  312. data/ext/common/MessageChannel.h +17 -101
  313. data/ext/common/PoolOptions.h +1 -0
  314. data/ext/common/ResourceLocator.h +78 -28
  315. data/ext/common/SafeLibev.h +149 -0
  316. data/ext/common/ServerInstanceDir.h +11 -7
  317. data/ext/common/Session.h +1 -1
  318. data/ext/common/SpawnManager.h +14 -14
  319. data/ext/common/StaticString.h +75 -0
  320. data/ext/common/Utils.cpp +304 -12
  321. data/ext/common/Utils.h +17 -0
  322. data/ext/common/Utils/BufferedIO.h +196 -0
  323. data/ext/common/Utils/IOUtils.cpp +159 -0
  324. data/ext/common/Utils/IOUtils.h +118 -1
  325. data/ext/common/Utils/ProcessMetricsCollector.h +184 -56
  326. data/ext/common/Utils/StrIntUtils.cpp +45 -11
  327. data/ext/common/Utils/StrIntUtils.h +8 -5
  328. data/ext/common/Utils/Timer.h +22 -0
  329. data/ext/common/Utils/utf8.h +35 -0
  330. data/ext/common/Utils/utf8/checked.h +324 -0
  331. data/ext/common/Utils/utf8/core.h +359 -0
  332. data/ext/common/Utils/utf8/unchecked.h +229 -0
  333. data/ext/common/Watchdog.cpp +52 -85
  334. data/ext/libev/config.h +122 -0
  335. data/ext/nginx/Configuration.c +7 -1
  336. data/ext/nginx/HelperAgent.cpp +16 -18
  337. data/ext/nginx/config +6 -4
  338. data/ext/oxt/system_calls.cpp +10 -0
  339. data/ext/oxt/system_calls.hpp +2 -0
  340. data/lib/phusion_passenger.rb +6 -11
  341. data/lib/phusion_passenger/dependencies.rb +2 -0
  342. data/lib/phusion_passenger/packaging.rb +5 -5
  343. data/lib/phusion_passenger/platform_info.rb +88 -0
  344. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -17
  345. data/lib/phusion_passenger/platform_info/compiler.rb +14 -32
  346. data/lib/phusion_passenger/platform_info/curl.rb +6 -1
  347. data/lib/phusion_passenger/platform_info/operating_system.rb +107 -0
  348. data/lib/phusion_passenger/public_api.rb +2 -2
  349. data/lib/phusion_passenger/rails3_extensions/init.rb +5 -2
  350. data/lib/phusion_passenger/standalone/command.rb +6 -2
  351. data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
  352. data/lib/phusion_passenger/standalone/runtime_installer.rb +17 -5
  353. data/lib/phusion_passenger/standalone/start_command.rb +12 -12
  354. data/lib/phusion_passenger/standalone/stop_command.rb +3 -3
  355. data/lib/phusion_passenger/standalone/utils.rb +6 -2
  356. data/lib/phusion_passenger/templates/standalone/config.erb +37 -5
  357. data/lib/phusion_passenger/utils.rb +4 -7
  358. data/resources/mime.types +73 -0
  359. data/{misc → resources}/union_station_gateway.crt +0 -0
  360. data/test/cxx/BufferedIOTest.cpp +364 -0
  361. data/test/cxx/EventedClientTest.cpp +150 -13
  362. data/test/cxx/IOUtilsTest.cpp +399 -1
  363. data/test/cxx/MessageChannelTest.cpp +5 -120
  364. data/test/cxx/ProcessMetricsCollectorTest.cpp +121 -0
  365. data/test/cxx/StaticStringTest.cpp +134 -0
  366. data/test/cxx/UtilsTest.cpp +16 -46
  367. data/test/stub/rails_apps/2.3/mycook/public/dispatch.cgi +2 -2
  368. data/test/stub/rails_apps/2.3/mycook/public/dispatch.fcgi +1 -1
  369. data/test/stub/rails_apps/2.3/mycook/public/dispatch.rb +1 -1
  370. data/test/stub/rails_apps/3.0/empty/Gemfile.lock +73 -0
  371. data/test/support/allocate_memory.c +14 -0
  372. data/test/support/test_helper.rb +3 -0
  373. metadata +57 -174
  374. data/bin/passenger-stress-test +0 -345
  375. data/debian/postinst +0 -24
  376. data/doc/rdoc/classes/ConditionVariable.html +0 -215
  377. data/doc/rdoc/classes/Exception.html +0 -120
  378. data/doc/rdoc/classes/GC.html +0 -113
  379. data/doc/rdoc/classes/IO.html +0 -221
  380. data/doc/rdoc/classes/PhusionPassenger.html +0 -397
  381. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
  382. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
  383. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
  384. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
  385. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  386. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  387. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  388. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  389. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
  390. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
  391. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
  392. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
  393. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
  394. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
  395. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
  396. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
  397. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
  398. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
  399. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
  400. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
  401. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
  402. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -341
  403. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -294
  404. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -199
  405. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
  406. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
  407. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
  408. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
  409. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
  410. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
  411. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
  412. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
  413. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
  414. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
  415. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
  416. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  417. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
  418. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  419. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
  420. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  421. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  422. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
  423. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
  424. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
  425. data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +0 -134
  426. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
  427. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1809
  428. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
  429. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  430. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
  431. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
  432. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
  433. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
  434. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -256
  435. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
  436. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
  437. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
  438. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
  439. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
  440. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
  441. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
  442. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
  443. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
  444. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
  445. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
  446. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
  447. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
  448. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
  449. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
  450. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
  451. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
  452. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
  453. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  454. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1550
  455. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
  456. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
  457. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
  458. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
  459. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
  460. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
  461. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  462. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
  463. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  464. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  465. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
  466. data/doc/rdoc/classes/Process.html +0 -115
  467. data/doc/rdoc/classes/Signal.html +0 -139
  468. data/doc/rdoc/created.rid +0 -1
  469. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -276
  470. data/doc/rdoc/files/README.html +0 -157
  471. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
  472. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
  473. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  474. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  475. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
  476. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
  477. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  478. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
  479. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
  480. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
  481. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
  482. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
  483. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
  484. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
  485. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  486. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  487. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
  488. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
  489. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  490. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
  491. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  492. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
  493. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -132
  494. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  495. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
  496. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
  497. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -126
  498. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
  499. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
  500. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
  501. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
  502. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
  503. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
  504. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
  505. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
  506. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
  507. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
  508. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  509. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
  510. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  511. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
  512. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
  513. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -135
  514. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
  515. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
  516. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
  517. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
  518. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -133
  519. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
  520. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
  521. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
  522. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
  523. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
  524. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
  525. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
  526. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  527. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
  528. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
  529. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
  530. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
  531. data/doc/rdoc/fr_class_index.html +0 -138
  532. data/doc/rdoc/fr_file_index.html +0 -108
  533. data/doc/rdoc/fr_method_index.html +0 -430
  534. data/doc/rdoc/index.html +0 -26
  535. data/doc/rdoc/rdoc-style.css +0 -187
  536. data/ext/apache2/LICENSE-CNRI.TXT +0 -79
  537. data/ext/common/Utils/BlockingScalar.h +0 -50
  538. data/ext/common/Utils/FileHandleGuard.h +0 -81
@@ -1,134 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: PhusionPassenger::NativeSupportLoader</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::NativeSupportLoader</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/native_support_rb.html">lib/phusion_passenger/native_support.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- Object
67
- </td>
68
- </tr>
69
- </table>
70
- </td>
71
- </tr>
72
- </table>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
- <div id="content">
77
-
78
-
79
-
80
-
81
- <div class="sectiontitle">Methods</div>
82
- <ul>
83
- <li><a href="#M000307">start</a></li>
84
- <li><a href="#M000306">supported?</a></li>
85
- </ul>
86
-
87
-
88
-
89
-
90
-
91
-
92
- <div class="sectiontitle">Public Instance methods</div>
93
- <div class="method">
94
- <div class="title">
95
- <a name="M000307"></a><b>start</b>()
96
- </div>
97
- <div class="sourcecode">
98
- <p class="source-link">[ <a href="javascript:toggleSource('M000307_source')" id="l_M000307_source">show source</a> ]</p>
99
- <div id="M000307_source" class="dyn-source">
100
- <pre>
101
- <span class="ruby-comment cmt"># File lib/phusion_passenger/native_support.rb, line 31</span>
102
- 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
103
- 32: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger'</span>
104
- 33: <span class="ruby-identifier">load_from_source_dir</span> <span class="ruby-operator">||</span>
105
- 34: <span class="ruby-identifier">load_from_load_path</span> <span class="ruby-operator">||</span>
106
- 35: <span class="ruby-identifier">load_from_home</span> <span class="ruby-operator">||</span>
107
- 36: <span class="ruby-identifier">compile_and_load</span>
108
- 37: <span class="ruby-keyword kw">end</span>
109
- </pre>
110
- </div>
111
- </div>
112
- </div>
113
- <div class="method">
114
- <div class="title">
115
- <a name="M000306"></a><b>supported?</b>()
116
- </div>
117
- <div class="sourcecode">
118
- <p class="source-link">[ <a href="javascript:toggleSource('M000306_source')" id="l_M000306_source">show source</a> ]</p>
119
- <div id="M000306_source" class="dyn-source">
120
- <pre>
121
- <span class="ruby-comment cmt"># File lib/phusion_passenger/native_support.rb, line 27</span>
122
- 27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">supported?</span>
123
- 28: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">RUBY_ENGINE</span>) <span class="ruby-operator">||</span> <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;ruby&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;rbx&quot;</span>
124
- 29: <span class="ruby-keyword kw">end</span>
125
- </pre>
126
- </div>
127
- </div>
128
- </div>
129
- </div>
130
-
131
- </div>
132
-
133
- </body>
134
- </html>
@@ -1,129 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: PhusionPassenger::Packaging</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::Packaging</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/packaging_rb.html">lib/phusion_passenger/packaging.rb</a>
61
- </td>
62
- </tr>
63
- </table>
64
- </td>
65
- </tr>
66
- </table>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
- <div id="content">
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
- <div class="sectiontitle">Constants</div>
80
- <table border='0' cellpadding='5'>
81
- <tr valign='top'>
82
- <td class="attr-name">ASCII_DOCS</td>
83
- <td>=</td>
84
- <td class="attr-value">[ 'doc/Users guide Apache.html', 'doc/Users guide Nginx.html', 'doc/Users guide Standalone.html', 'doc/Security of user switching support.html', 'doc/Architectural overview.html'</td>
85
- </tr>
86
- <tr valign='top'>
87
- <td>&nbsp;</td>
88
- <td colspan="2" class="attr-desc">
89
- A list of HTML files that are generated with Asciidoc.
90
-
91
- </td>
92
- </tr>
93
- <tr valign='top'>
94
- <td class="attr-name">USER_EXECUTABLES</td>
95
- <td>=</td>
96
- <td class="attr-value">[ 'passenger', 'passenger-install-apache2-module', 'passenger-install-nginx-module', 'passenger-config', 'passenger-stress-test'</td>
97
- </tr>
98
- <tr valign='top'>
99
- <td class="attr-name">SUPER_USER_EXECUTABLES</td>
100
- <td>=</td>
101
- <td class="attr-value">[ 'passenger-status', 'passenger-memory-stats', 'passenger-make-enterprisey'</td>
102
- </tr>
103
- <tr valign='top'>
104
- <td class="attr-name">GLOB</td>
105
- <td>=</td>
106
- <td class="attr-value">[ 'Rakefile', 'README', 'DEVELOPERS.TXT', 'PACKAGING.TXT', 'LICENSE', 'INSTALL', 'NEWS', 'build/*.rb', 'lib/*.rb', 'lib/**/*.rb', 'lib/**/*.py', 'lib/phusion_passenger/templates/*', 'lib/phusion_passenger/templates/apache2/*', 'lib/phusion_passenger/templates/nginx/*', 'lib/phusion_passenger/templates/standalone/*', 'lib/phusion_passenger/templates/standalone_default_root/*', 'bin/*', 'doc/**/*', 'man/*', 'debian/*', 'helper-scripts/*', 'ext/common/**/*.{cpp,c,h,hpp}', 'ext/apache2/*.{cpp,h,hpp,c,TXT}', 'ext/nginx/*.{c,cpp,h}', 'ext/nginx/config', 'ext/boost/**/*', 'ext/google/**/*', 'ext/libev/{LICENSE,Changes,README,Makefile.am,Makefile.in}', 'ext/libev/{*.m4,autogen.sh,config.guess,config.h.in,config.sub}', 'ext/libev/{configure,configure.ac,install-sh,ltmain.sh,missing,mkinstalldirs}', 'ext/libev/{*.h,*.c}', 'ext/oxt/*.hpp', 'ext/oxt/*.cpp', 'ext/oxt/detail/*.hpp', 'ext/ruby/*.{c,rb}', 'misc/*', 'test/*.example', 'test/support/*.{cpp,h,rb}', 'test/tut/*', 'test/cxx/*.{cpp,h}', 'test/oxt/*.{cpp,hpp}', 'test/ruby/**/*', 'test/integration_tests/**/*', 'test/stub/**/*'</td>
107
- </tr>
108
- <tr valign='top'>
109
- <td>&nbsp;</td>
110
- <td colspan="2" class="attr-desc">
111
- A list of globs which match all files that should be packaged in the
112
- Phusion Passenger gem or tarball.
113
-
114
- </td>
115
- </tr>
116
- <tr valign='top'>
117
- <td class="attr-name">EXCLUDE_GLOB</td>
118
- <td>=</td>
119
- <td class="attr-value">[ 'test/stub/rails_apps/3.0/empty/help/**/*'</td>
120
- </tr>
121
- </table>
122
-
123
-
124
- </div>
125
-
126
- </div>
127
-
128
- </body>
129
- </html>
@@ -1,1809 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: PhusionPassenger::PlatformInfo</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::PlatformInfo</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/platform_info_rb.html">lib/phusion_passenger/platform_info.rb</a>
61
- <a href="../../files/lib/phusion_passenger/platform_info/apache_rb.html">lib/phusion_passenger/platform_info/apache.rb</a>
62
- <a href="../../files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html">lib/phusion_passenger/platform_info/binary_compatibility.rb</a>
63
- <a href="../../files/lib/phusion_passenger/platform_info/compiler_rb.html">lib/phusion_passenger/platform_info/compiler.rb</a>
64
- <a href="../../files/lib/phusion_passenger/platform_info/curl_rb.html">lib/phusion_passenger/platform_info/curl.rb</a>
65
- <a href="../../files/lib/phusion_passenger/platform_info/documentation_tools_rb.html">lib/phusion_passenger/platform_info/documentation_tools.rb</a>
66
- <a href="../../files/lib/phusion_passenger/platform_info/linux_rb.html">lib/phusion_passenger/platform_info/linux.rb</a>
67
- <a href="../../files/lib/phusion_passenger/platform_info/operating_system_rb.html">lib/phusion_passenger/platform_info/operating_system.rb</a>
68
- <a href="../../files/lib/phusion_passenger/platform_info/ruby_rb.html">lib/phusion_passenger/platform_info/ruby.rb</a>
69
- <a href="../../files/lib/phusion_passenger/platform_info/zlib_rb.html">lib/phusion_passenger/platform_info/zlib.rb</a>
70
- </td>
71
- </tr>
72
- </table>
73
- </td>
74
- </tr>
75
- </table>
76
- <!-- banner header -->
77
-
78
- <div id="bodyContent">
79
- <div id="content">
80
-
81
- <div class="description"><p>
82
- Users can change the detection behavior by setting the environment variable
83
- <tt>APXS2</tt> to the correct &#8216;apxs&#8217; (or &#8216;<a
84
- href="PlatformInfo.html#M000030">apxs2</a>&#8217;) binary, as provided by
85
- Apache.
86
- </p>
87
- </div>
88
-
89
-
90
-
91
- <div class="sectiontitle">Methods</div>
92
- <ul>
93
- <li><a href="#M000035">apache2_bindir</a></li>
94
- <li><a href="#M000037">apache2_module_cflags</a></li>
95
- <li><a href="#M000038">apache2_module_ldflags</a></li>
96
- <li><a href="#M000036">apache2_sbindir</a></li>
97
- <li><a href="#M000031">apache2ctl</a></li>
98
- <li><a href="#M000033">apr_config</a></li>
99
- <li><a href="#M000043">apr_config_needed_for_building_apache_modules?</a></li>
100
- <li><a href="#M000039">apr_flags</a></li>
101
- <li><a href="#M000040">apr_libs</a></li>
102
- <li><a href="#M000034">apu_config</a></li>
103
- <li><a href="#M000041">apu_flags</a></li>
104
- <li><a href="#M000042">apu_libs</a></li>
105
- <li><a href="#M000030">apxs2</a></li>
106
- <li><a href="#M000060">asciidoc</a></li>
107
- <li><a href="#M000047">cc</a></li>
108
- <li><a href="#M000050">compiler_supports_visibility_flag?</a></li>
109
- <li><a href="#M000051">compiler_supports_wno_attributes_flag?</a></li>
110
- <li><a href="#M000052">compiler_visibility_flag_generates_warnings?</a></li>
111
- <li><a href="#M000044">cpu_architecture</a></li>
112
- <li><a href="#M000057">curl_flags</a></li>
113
- <li><a href="#M000058">curl_libs</a></li>
114
- <li><a href="#M000059">curl_supports_ssl?</a></li>
115
- <li><a href="#M000048">cxx</a></li>
116
- <li><a href="#M000055">debugging_cflags</a></li>
117
- <li><a href="#M000029">env_defined?</a></li>
118
- <li><a href="#M000056">export_dynamic_flags</a></li>
119
- <li><a href="#M000028">find_command</a></li>
120
- <li><a href="#M000068">gem_command</a></li>
121
- <li><a href="#M000049">gnu_make</a></li>
122
- <li><a href="#M000032">httpd</a></li>
123
- <li><a href="#M000072">in_rvm?</a></li>
124
- <li><a href="#M000064">library_extension</a></li>
125
- <li><a href="#M000061">linux_distro</a></li>
126
- <li><a href="#M000062">linux_distro_tags</a></li>
127
- <li><a href="#M000076">locate_ruby_tool</a></li>
128
- <li><a href="#M000063">os_name</a></li>
129
- <li><a href="#M000046">passenger_binary_compatibility_id</a></li>
130
- <li><a href="#M000053">portability_cflags</a></li>
131
- <li><a href="#M000054">portability_ldflags</a></li>
132
- <li><a href="#M000069">rake</a></li>
133
- <li><a href="#M000070">rake_command</a></li>
134
- <li><a href="#M000071">rspec</a></li>
135
- <li><a href="#M000065">ruby_command</a></li>
136
- <li><a href="#M000066">ruby_executable</a></li>
137
- <li><a href="#M000045">ruby_extension_binary_compatibility_ids</a></li>
138
- <li><a href="#M000075">ruby_sudo_command</a></li>
139
- <li><a href="#M000067">ruby_supports_fork?</a></li>
140
- <li><a href="#M000073">rvm_path</a></li>
141
- <li><a href="#M000074">rvm_ruby_string</a></li>
142
- <li><a href="#M000077">zlib_flags</a></li>
143
- <li><a href="#M000078">zlib_libs</a></li>
144
- </ul>
145
-
146
-
147
-
148
-
149
- <div class="sectiontitle">Constants</div>
150
- <table border='0' cellpadding='5'>
151
- <tr valign='top'>
152
- <td class="attr-name">GEM_HOME</td>
153
- <td>=</td>
154
- <td class="attr-value">gem_home</td>
155
- </tr>
156
- <tr valign='top'>
157
- <td class="attr-name">RUBY_ENGINE</td>
158
- <td>=</td>
159
- <td class="attr-value">::RUBY_ENGINE</td>
160
- </tr>
161
- <tr valign='top'>
162
- <td class="attr-name">RUBY_ENGINE</td>
163
- <td>=</td>
164
- <td class="attr-value">&quot;ruby&quot;</td>
165
- </tr>
166
- </table>
167
-
168
-
169
- <div class="sectiontitle">Public Class methods</div>
170
- <div class="method">
171
- <div class="title">
172
- <a name="M000035"></a><b>apache2_bindir</b>()
173
- </div>
174
- <div class="description">
175
- <p>
176
- The absolute path to the Apache 2 &#8216;bin&#8217; directory, or nil if
177
- unknown.
178
- </p>
179
- </div>
180
- <div class="sourcecode">
181
- <p class="source-link">[ <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show source</a> ]</p>
182
- <div id="M000035_source" class="dyn-source">
183
- <pre>
184
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 140</span>
185
- 140: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_bindir</span>
186
- 141: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
187
- 142: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
188
- 143: <span class="ruby-keyword kw">else</span>
189
- 144: <span class="ruby-keyword kw">return</span> <span class="ruby-node">`#{apxs2} -q BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
190
- 145: <span class="ruby-keyword kw">end</span>
191
- 146: <span class="ruby-keyword kw">end</span>
192
- </pre>
193
- </div>
194
- </div>
195
- </div>
196
- <div class="method">
197
- <div class="title">
198
- <a name="M000037"></a><b>apache2_module_cflags</b>(with_apr_flags = true)
199
- </div>
200
- <div class="description">
201
- <p>
202
- The C compiler flags that are necessary to compile an Apache module. Also
203
- includes APR and APU compiler flags if with_apr_flags is true.
204
- </p>
205
- </div>
206
- <div class="sourcecode">
207
- <p class="source-link">[ <a href="javascript:toggleSource('M000037_source')" id="l_M000037_source">show source</a> ]</p>
208
- <div id="M000037_source" class="dyn-source">
209
- <pre>
210
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 164</span>
211
- 164: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_module_cflags</span>(<span class="ruby-identifier">with_apr_flags</span> = <span class="ruby-keyword kw">true</span>)
212
- 165: <span class="ruby-identifier">flags</span> = [<span class="ruby-value str">&quot;-fPIC&quot;</span>]
213
- 166: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_supports_visibility_flag?</span>
214
- 167: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED&quot;</span>
215
- 168: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_visibility_flag_generates_warnings?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">compiler_supports_wno_attributes_flag?</span>
216
- 169: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-Wno-attributes&quot;</span>
217
- 170: <span class="ruby-keyword kw">end</span>
218
- 171: <span class="ruby-keyword kw">end</span>
219
- 172: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">with_apr_flags</span>
220
- 173: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apr_flags</span>
221
- 174: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apu_flags</span>
222
- 175: <span class="ruby-keyword kw">end</span>
223
- 176: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
224
- 177: <span class="ruby-identifier">apxs2_flags</span> = <span class="ruby-node">`#{apxs2} -q CFLAGS`</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; -I&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">`#{apxs2} -q INCLUDEDIR`</span>.<span class="ruby-identifier">strip</span>
225
- 178: <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/-O\d? /</span>, <span class="ruby-value str">''</span>)
226
- 179:
227
- 180: <span class="ruby-comment cmt"># Remove flags not supported by GCC</span>
228
- 181: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span> <span class="ruby-comment cmt"># TODO: Add support for people using SunStudio</span>
229
- 182: <span class="ruby-comment cmt"># The big problem is Coolstack apxs includes a bunch of solaris -x directives.</span>
230
- 183: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">split</span>
231
- 184: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-x/</span> }
232
- 185: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-Xa/</span> }
233
- 186: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-fast/</span> }
234
- 187: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-mt/</span> }
235
- 188: <span class="ruby-identifier">apxs2_flags</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
236
- 189: <span class="ruby-keyword kw">end</span>
237
- 190:
238
- 191: <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">strip!</span>
239
- 192: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apxs2_flags</span>
240
- 193: <span class="ruby-keyword kw">end</span>
241
- 194: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">httpd</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
242
- 195: <span class="ruby-comment cmt"># The default Apache install on OS X is a universal binary.</span>
243
- 196: <span class="ruby-comment cmt"># Figure out which architectures it's compiled for and do the same</span>
244
- 197: <span class="ruby-comment cmt"># thing for mod_passenger. We use the 'file' utility to do this.</span>
245
- 198: <span class="ruby-comment cmt">#</span>
246
- 199: <span class="ruby-comment cmt"># Running 'file' on the Apache executable usually outputs something</span>
247
- 200: <span class="ruby-comment cmt"># like this:</span>
248
- 201: <span class="ruby-comment cmt">#</span>
249
- 202: <span class="ruby-comment cmt"># /usr/sbin/httpd: Mach-O universal binary with 4 architectures</span>
250
- 203: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture ppc7400): Mach-O executable ppc</span>
251
- 204: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture ppc64): Mach-O 64-bit executable ppc64</span>
252
- 205: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture i386): Mach-O executable i386</span>
253
- 206: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable x86_64</span>
254
- 207: <span class="ruby-comment cmt">#</span>
255
- 208: <span class="ruby-comment cmt"># But on some machines, it may output just:</span>
256
- 209: <span class="ruby-comment cmt">#</span>
257
- 210: <span class="ruby-comment cmt"># /usr/sbin/httpd: Mach-O fat file with 4 architectures</span>
258
- 211: <span class="ruby-comment cmt">#</span>
259
- 212: <span class="ruby-comment cmt"># (http://code.google.com/p/phusion-passenger/issues/detail?id=236)</span>
260
- 213: <span class="ruby-identifier">output</span> = <span class="ruby-node">`file &quot;#{httpd}&quot;`</span>.<span class="ruby-identifier">strip</span>
261
- 214: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Mach-O fat file/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/for architecture/</span>
262
- 215: <span class="ruby-identifier">architectures</span> = [<span class="ruby-value str">&quot;-arch i386 -arch ppc -arch x86_64 -arch ppc64&quot;</span>]
263
- 216: <span class="ruby-keyword kw">else</span>
264
- 217: <span class="ruby-identifier">architectures</span> = []
265
- 218: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/for architecture/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
266
- 219: <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/for architecture (.*?)\)/</span>
267
- 220: <span class="ruby-identifier">architectures</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-arch #{$1}&quot;</span>
268
- 221: <span class="ruby-keyword kw">end</span>
269
- 222: <span class="ruby-keyword kw">end</span>
270
- 223: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">architectures</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
271
- 224: <span class="ruby-keyword kw">end</span>
272
- 225: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>
273
- 226: <span class="ruby-keyword kw">end</span>
274
- </pre>
275
- </div>
276
- </div>
277
- </div>
278
- <div class="method">
279
- <div class="title">
280
- <a name="M000038"></a><b>apache2_module_ldflags</b>()
281
- </div>
282
- <div class="description">
283
- <p>
284
- Linker flags that are necessary for linking an Apache module. Already
285
- includes APR and APU linker flags.
286
- </p>
287
- </div>
288
- <div class="sourcecode">
289
- <p class="source-link">[ <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show source</a> ]</p>
290
- <div id="M000038_source" class="dyn-source">
291
- <pre>
292
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 231</span>
293
- 231: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_module_ldflags</span>
294
- 232: <span class="ruby-identifier">flags</span> = <span class="ruby-node">&quot;-fPIC #{apr_libs} #{apu_libs}&quot;</span>
295
- 233: <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">strip!</span>
296
- 234: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>
297
- 235: <span class="ruby-keyword kw">end</span>
298
- </pre>
299
- </div>
300
- </div>
301
- </div>
302
- <div class="method">
303
- <div class="title">
304
- <a name="M000036"></a><b>apache2_sbindir</b>()
305
- </div>
306
- <div class="description">
307
- <p>
308
- The absolute path to the Apache 2 &#8216;sbin&#8217; directory, or nil if
309
- unknown.
310
- </p>
311
- </div>
312
- <div class="sourcecode">
313
- <p class="source-link">[ <a href="javascript:toggleSource('M000036_source')" id="l_M000036_source">show source</a> ]</p>
314
- <div id="M000036_source" class="dyn-source">
315
- <pre>
316
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 150</span>
317
- 150: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_sbindir</span>
318
- 151: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
319
- 152: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
320
- 153: <span class="ruby-keyword kw">else</span>
321
- 154: <span class="ruby-keyword kw">return</span> <span class="ruby-node">`#{apxs2} -q SBINDIR`</span>.<span class="ruby-identifier">strip</span>
322
- 155: <span class="ruby-keyword kw">end</span>
323
- 156: <span class="ruby-keyword kw">end</span>
324
- </pre>
325
- </div>
326
- </div>
327
- </div>
328
- <div class="method">
329
- <div class="title">
330
- <a name="M000031"></a><b>apache2ctl</b>()
331
- </div>
332
- <div class="description">
333
- <p>
334
- The absolute path to the &#8216;apachectl&#8217; or &#8216;<a
335
- href="PlatformInfo.html#M000031">apache2ctl</a>&#8217; binary, or nil if
336
- not found.
337
- </p>
338
- </div>
339
- <div class="sourcecode">
340
- <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p>
341
- <div id="M000031_source" class="dyn-source">
342
- <pre>
343
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 60</span>
344
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2ctl</span>
345
- 61: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_apache2_executable</span>(<span class="ruby-value str">'apache2ctl'</span>, <span class="ruby-value str">'apachectl2'</span>, <span class="ruby-value str">'apachectl'</span>)
346
- 62: <span class="ruby-keyword kw">end</span>
347
- </pre>
348
- </div>
349
- </div>
350
- </div>
351
- <div class="method">
352
- <div class="title">
353
- <a name="M000033"></a><b>apr_config</b>()
354
- </div>
355
- <div class="description">
356
- <p>
357
- The absolute path to the &#8216;apr-config&#8217; or
358
- &#8216;apr-1-config&#8217; executable, or nil if not found.
359
- </p>
360
- </div>
361
- <div class="sourcecode">
362
- <p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p>
363
- <div id="M000033_source" class="dyn-source">
364
- <pre>
365
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 86</span>
366
- 86: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_config</span>
367
- 87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'APR_CONFIG'</span>)
368
- 88: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'APR_CONFIG'</span>]
369
- 89: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
370
- 90: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
371
- 91: <span class="ruby-keyword kw">else</span>
372
- 92: <span class="ruby-identifier">filename</span> = <span class="ruby-node">`#{apxs2} -q APR_CONFIG 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
373
- 93: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">empty?</span>
374
- 94: <span class="ruby-identifier">apr_bindir</span> = <span class="ruby-node">`#{apxs2} -q APR_BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
375
- 95: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apr_bindir</span>.<span class="ruby-identifier">empty?</span>
376
- 96: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
377
- 97: <span class="ruby-keyword kw">else</span>
378
- 98: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">select_executable</span>(<span class="ruby-identifier">apr_bindir</span>,
379
- 99: <span class="ruby-value str">&quot;apr-1-config&quot;</span>, <span class="ruby-value str">&quot;apr-config&quot;</span>)
380
- 100: <span class="ruby-keyword kw">end</span>
381
- 101: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
382
- 102: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
383
- 103: <span class="ruby-keyword kw">else</span>
384
- 104: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
385
- 105: <span class="ruby-keyword kw">end</span>
386
- 106: <span class="ruby-keyword kw">end</span>
387
- 107: <span class="ruby-keyword kw">end</span>
388
- </pre>
389
- </div>
390
- </div>
391
- </div>
392
- <div class="method">
393
- <div class="title">
394
- <a name="M000043"></a><b>apr_config_needed_for_building_apache_modules?</b>()
395
- </div>
396
- <div class="description">
397
- <p>
398
- Returns whether it is necessary to use information outputted by
399
- &#8216;apr-config&#8217; and &#8216;apu-config&#8217; in order to compile
400
- an Apache module. When Apache is installed with &#8212;with-included-apr,
401
- the APR/APU headers are placed into the same directory as the Apache
402
- headers, and so &#8216;apr-config&#8217; and &#8216;apu-config&#8217;
403
- won&#8216;t be necessary in that case.
404
- </p>
405
- </div>
406
- <div class="sourcecode">
407
- <p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p>
408
- <div id="M000043_source" class="dyn-source">
409
- <pre>
410
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 266</span>
411
- 266: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_config_needed_for_building_apache_modules?</span>
412
- 267: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-node">&quot;/tmp/passenger-platform-check-#{Process.pid}.c&quot;</span>)
413
- 268: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
414
- 269: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;#include &lt;apr.h&gt;&quot;</span>)
415
- 270: <span class="ruby-keyword kw">end</span>
416
- 271: <span class="ruby-keyword kw">begin</span>
417
- 272: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>(<span class="ruby-node">&quot;(gcc #{apache2_module_cflags(false)} -c '#{filename}' -o '#{filename}.o') &gt;/dev/null 2&gt;/dev/null&quot;</span>)
418
- 273: <span class="ruby-keyword kw">ensure</span>
419
- 274: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
420
- 275: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-node">&quot;#{filename}.o&quot;</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
421
- 276: <span class="ruby-keyword kw">end</span>
422
- 277: <span class="ruby-keyword kw">end</span>
423
- </pre>
424
- </div>
425
- </div>
426
- </div>
427
- <div class="method">
428
- <div class="title">
429
- <a name="M000039"></a><b>apr_flags</b>()
430
- </div>
431
- <div class="description">
432
- <p>
433
- The C compiler flags that are necessary for programs that use APR.
434
- </p>
435
- </div>
436
- <div class="sourcecode">
437
- <p class="source-link">[ <a href="javascript:toggleSource('M000039_source')" id="l_M000039_source">show source</a> ]</p>
438
- <div id="M000039_source" class="dyn-source">
439
- <pre>
440
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 239</span>
441
- 239: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_flags</span>
442
- 240: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apr_info</span>[<span class="ruby-value">0</span>]
443
- 241: <span class="ruby-keyword kw">end</span>
444
- </pre>
445
- </div>
446
- </div>
447
- </div>
448
- <div class="method">
449
- <div class="title">
450
- <a name="M000040"></a><b>apr_libs</b>()
451
- </div>
452
- <div class="description">
453
- <p>
454
- The linker flags that are necessary for linking programs that use APR.
455
- </p>
456
- </div>
457
- <div class="sourcecode">
458
- <p class="source-link">[ <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show source</a> ]</p>
459
- <div id="M000040_source" class="dyn-source">
460
- <pre>
461
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 244</span>
462
- 244: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_libs</span>
463
- 245: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apr_info</span>[<span class="ruby-value">1</span>]
464
- 246: <span class="ruby-keyword kw">end</span>
465
- </pre>
466
- </div>
467
- </div>
468
- </div>
469
- <div class="method">
470
- <div class="title">
471
- <a name="M000034"></a><b>apu_config</b>()
472
- </div>
473
- <div class="description">
474
- <p>
475
- The absolute path to the &#8216;apu-config&#8217; or
476
- &#8216;apu-1-config&#8217; executable, or nil if not found.
477
- </p>
478
- </div>
479
- <div class="sourcecode">
480
- <p class="source-link">[ <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show source</a> ]</p>
481
- <div id="M000034_source" class="dyn-source">
482
- <pre>
483
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 112</span>
484
- 112: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_config</span>
485
- 113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'APU_CONFIG'</span>)
486
- 114: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'APU_CONFIG'</span>]
487
- 115: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
488
- 116: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
489
- 117: <span class="ruby-keyword kw">else</span>
490
- 118: <span class="ruby-identifier">filename</span> = <span class="ruby-node">`#{apxs2} -q APU_CONFIG 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
491
- 119: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">empty?</span>
492
- 120: <span class="ruby-identifier">apu_bindir</span> = <span class="ruby-node">`#{apxs2} -q APU_BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
493
- 121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apu_bindir</span>.<span class="ruby-identifier">empty?</span>
494
- 122: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
495
- 123: <span class="ruby-keyword kw">else</span>
496
- 124: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">select_executable</span>(<span class="ruby-identifier">apu_bindir</span>,
497
- 125: <span class="ruby-value str">&quot;apu-1-config&quot;</span>, <span class="ruby-value str">&quot;apu-config&quot;</span>)
498
- 126: <span class="ruby-keyword kw">end</span>
499
- 127: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
500
- 128: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
501
- 129: <span class="ruby-keyword kw">else</span>
502
- 130: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
503
- 131: <span class="ruby-keyword kw">end</span>
504
- 132: <span class="ruby-keyword kw">end</span>
505
- 133: <span class="ruby-keyword kw">end</span>
506
- </pre>
507
- </div>
508
- </div>
509
- </div>
510
- <div class="method">
511
- <div class="title">
512
- <a name="M000041"></a><b>apu_flags</b>()
513
- </div>
514
- <div class="description">
515
- <p>
516
- The C compiler flags that are necessary for programs that use APR-Util.
517
- </p>
518
- </div>
519
- <div class="sourcecode">
520
- <p class="source-link">[ <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show source</a> ]</p>
521
- <div id="M000041_source" class="dyn-source">
522
- <pre>
523
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 249</span>
524
- 249: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_flags</span>
525
- 250: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apu_info</span>[<span class="ruby-value">0</span>]
526
- 251: <span class="ruby-keyword kw">end</span>
527
- </pre>
528
- </div>
529
- </div>
530
- </div>
531
- <div class="method">
532
- <div class="title">
533
- <a name="M000042"></a><b>apu_libs</b>()
534
- </div>
535
- <div class="description">
536
- <p>
537
- The linker flags that are necessary for linking programs that use APR-Util.
538
- </p>
539
- </div>
540
- <div class="sourcecode">
541
- <p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>
542
- <div id="M000042_source" class="dyn-source">
543
- <pre>
544
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 254</span>
545
- 254: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_libs</span>
546
- 255: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apu_info</span>[<span class="ruby-value">1</span>]
547
- 256: <span class="ruby-keyword kw">end</span>
548
- </pre>
549
- </div>
550
- </div>
551
- </div>
552
- <div class="method">
553
- <div class="title">
554
- <a name="M000030"></a><b>apxs2</b>()
555
- </div>
556
- <div class="description">
557
- <p>
558
- The absolute path to the &#8216;apxs&#8217; or &#8216;<a
559
- href="PlatformInfo.html#M000030">apxs2</a>&#8217; executable, or nil if not
560
- found.
561
- </p>
562
- </div>
563
- <div class="sourcecode">
564
- <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p>
565
- <div id="M000030_source" class="dyn-source">
566
- <pre>
567
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 44</span>
568
- 44: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apxs2</span>
569
- 45: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">&quot;APXS2&quot;</span>)
570
- 46: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;APXS2&quot;</span>]
571
- 47: <span class="ruby-keyword kw">end</span>
572
- 48: [<span class="ruby-value str">'apxs2'</span>, <span class="ruby-value str">'apxs'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
573
- 49: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
574
- 50: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">command</span>.<span class="ruby-identifier">nil?</span>
575
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
576
- 52: <span class="ruby-keyword kw">end</span>
577
- 53: <span class="ruby-keyword kw">end</span>
578
- 54: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
579
- 55: <span class="ruby-keyword kw">end</span>
580
- </pre>
581
- </div>
582
- </div>
583
- </div>
584
- <div class="method">
585
- <div class="title">
586
- <a name="M000060"></a><b>asciidoc</b>()
587
- </div>
588
- <div class="sourcecode">
589
- <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
590
- <div id="M000060_source" class="dyn-source">
591
- <pre>
592
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/documentation_tools.rb, line 29</span>
593
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">asciidoc</span>
594
- 30: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'asciidoc'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'mizuho-asciidoc'</span>)
595
- 31: <span class="ruby-keyword kw">end</span>
596
- </pre>
597
- </div>
598
- </div>
599
- </div>
600
- <div class="method">
601
- <div class="title">
602
- <a name="M000047"></a><b>cc</b>()
603
- </div>
604
- <div class="sourcecode">
605
- <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>
606
- <div id="M000047_source" class="dyn-source">
607
- <pre>
608
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 29</span>
609
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cc</span>
610
- 30: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'CC'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;gcc&quot;</span>
611
- 31: <span class="ruby-keyword kw">end</span>
612
- </pre>
613
- </div>
614
- </div>
615
- </div>
616
- <div class="method">
617
- <div class="title">
618
- <a name="M000050"></a><b>compiler_supports_visibility_flag?</b>()
619
- </div>
620
- <div class="sourcecode">
621
- <p class="source-link">[ <a href="javascript:toggleSource('M000050_source')" id="l_M000050_source">show source</a> ]</p>
622
- <div id="M000050_source" class="dyn-source">
623
- <pre>
624
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 56</span>
625
- 56: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compiler_supports_visibility_flag?</span>
626
- 57: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:c</span>, <span class="ruby-value str">''</span>, <span class="ruby-value str">'-fvisibility=hidden'</span>)
627
- 58: <span class="ruby-keyword kw">end</span>
628
- </pre>
629
- </div>
630
- </div>
631
- </div>
632
- <div class="method">
633
- <div class="title">
634
- <a name="M000051"></a><b>compiler_supports_wno_attributes_flag?</b>()
635
- </div>
636
- <div class="sourcecode">
637
- <p class="source-link">[ <a href="javascript:toggleSource('M000051_source')" id="l_M000051_source">show source</a> ]</p>
638
- <div id="M000051_source" class="dyn-source">
639
- <pre>
640
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 61</span>
641
- 61: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compiler_supports_wno_attributes_flag?</span>
642
- 62: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:c</span>, <span class="ruby-value str">''</span>, <span class="ruby-value str">'-Wno-attributes'</span>)
643
- 63: <span class="ruby-keyword kw">end</span>
644
- </pre>
645
- </div>
646
- </div>
647
- </div>
648
- <div class="method">
649
- <div class="title">
650
- <a name="M000052"></a><b>compiler_visibility_flag_generates_warnings?</b>()
651
- </div>
652
- <div class="description">
653
- <p>
654
- Returns whether compiling C++ with -fvisibility=hidden might result in tons
655
- of useless warnings, like this: <a
656
- href="http://code.google.com/p/phusion-passenger/issues/detail?id=526">code.google.com/p/phusion-passenger/issues/detail?id=526</a>
657
- This appears to be a bug in older g++ versions: <a
658
- href="http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00861.html">gcc.gnu.org/ml/gcc-patches/2006-07/msg00861.html</a>
659
- Warnings should be suppressed with -Wno-attributes.
660
- </p>
661
- </div>
662
- <div class="sourcecode">
663
- <p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
664
- <div id="M000052_source" class="dyn-source">
665
- <pre>
666
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 72</span>
667
- 72: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compiler_visibility_flag_generates_warnings?</span>
668
- 73: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/linux/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-node">`#{cxx} -v 2&gt;&amp;1`</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/gcc version (.*?)/</span>
669
- 74: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">$1</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value str">&quot;4.1.2&quot;</span>
670
- 75: <span class="ruby-keyword kw">else</span>
671
- 76: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
672
- 77: <span class="ruby-keyword kw">end</span>
673
- 78: <span class="ruby-keyword kw">end</span>
674
- </pre>
675
- </div>
676
- </div>
677
- </div>
678
- <div class="method">
679
- <div class="title">
680
- <a name="M000044"></a><b>cpu_architecture</b>()
681
- </div>
682
- <div class="description">
683
- <p>
684
- Returns the host machine&#8216;s CPU architecture. Please note that this
685
- may not be the same as the Ruby interpreter&#8216;s CPU architecture
686
- because the Ruby interpreter may be running on a different architectural
687
- mode than the default one.
688
- </p>
689
- </div>
690
- <div class="sourcecode">
691
- <p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p>
692
- <div id="M000044_source" class="dyn-source">
693
- <pre>
694
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/binary_compatibility.rb, line 35</span>
695
- 35: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cpu_architecture</span>
696
- 36: <span class="ruby-identifier">result</span> = <span class="ruby-value">`uname -p`</span>.<span class="ruby-identifier">strip</span>
697
- 37: <span class="ruby-comment cmt"># On some systems 'uname -p' returns something like</span>
698
- 38: <span class="ruby-comment cmt"># 'Intel(R) Pentium(R) M processor 1400MHz'.</span>
699
- 39: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;unknown&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/ /</span>
700
- 40: <span class="ruby-identifier">result</span> = <span class="ruby-value">`uname -m`</span>.<span class="ruby-identifier">strip</span>
701
- 41: <span class="ruby-keyword kw">end</span>
702
- 42: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
703
- 43: <span class="ruby-keyword kw">end</span>
704
- </pre>
705
- </div>
706
- </div>
707
- </div>
708
- <div class="method">
709
- <div class="title">
710
- <a name="M000057"></a><b>curl_flags</b>()
711
- </div>
712
- <div class="sourcecode">
713
- <p class="source-link">[ <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show source</a> ]</p>
714
- <div id="M000057_source" class="dyn-source">
715
- <pre>
716
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/curl.rb, line 29</span>
717
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">curl_flags</span>
718
- 30: <span class="ruby-identifier">result</span> = <span class="ruby-value">`(curl-config --cflags) 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
719
- 31: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
720
- 32: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
721
- 33: <span class="ruby-keyword kw">else</span>
722
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
723
- 35: <span class="ruby-keyword kw">end</span>
724
- 36: <span class="ruby-keyword kw">end</span>
725
- </pre>
726
- </div>
727
- </div>
728
- </div>
729
- <div class="method">
730
- <div class="title">
731
- <a name="M000058"></a><b>curl_libs</b>()
732
- </div>
733
- <div class="sourcecode">
734
- <p class="source-link">[ <a href="javascript:toggleSource('M000058_source')" id="l_M000058_source">show source</a> ]</p>
735
- <div id="M000058_source" class="dyn-source">
736
- <pre>
737
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/curl.rb, line 39</span>
738
- 39: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">curl_libs</span>
739
- 40: <span class="ruby-identifier">result</span> = <span class="ruby-value">`(curl-config --libs) 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
740
- 41: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
741
- 42: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
742
- 43: <span class="ruby-keyword kw">else</span>
743
- 44: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
744
- 45: <span class="ruby-keyword kw">end</span>
745
- 46: <span class="ruby-keyword kw">end</span>
746
- </pre>
747
- </div>
748
- </div>
749
- </div>
750
- <div class="method">
751
- <div class="title">
752
- <a name="M000059"></a><b>curl_supports_ssl?</b>()
753
- </div>
754
- <div class="sourcecode">
755
- <p class="source-link">[ <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show source</a> ]</p>
756
- <div id="M000059_source" class="dyn-source">
757
- <pre>
758
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/curl.rb, line 49</span>
759
- 49: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">curl_supports_ssl?</span>
760
- 50: <span class="ruby-identifier">features</span> = <span class="ruby-value">`(curl-config --features) 2&gt;/dev/null`</span>
761
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">features</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/SSL/</span>
762
- 52: <span class="ruby-keyword kw">end</span>
763
- </pre>
764
- </div>
765
- </div>
766
- </div>
767
- <div class="method">
768
- <div class="title">
769
- <a name="M000048"></a><b>cxx</b>()
770
- </div>
771
- <div class="sourcecode">
772
- <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>
773
- <div id="M000048_source" class="dyn-source">
774
- <pre>
775
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 33</span>
776
- 33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cxx</span>
777
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'CXX'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;g++&quot;</span>
778
- 35: <span class="ruby-keyword kw">end</span>
779
- </pre>
780
- </div>
781
- </div>
782
- </div>
783
- <div class="method">
784
- <div class="title">
785
- <a name="M000055"></a><b>debugging_cflags</b>()
786
- </div>
787
- <div class="description">
788
- <p>
789
- C compiler flags that should be passed in order to enable debugging
790
- information.
791
- </p>
792
- </div>
793
- <div class="sourcecode">
794
- <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
795
- <div id="M000055_source" class="dyn-source">
796
- <pre>
797
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 159</span>
798
- 159: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debugging_cflags</span>
799
- 160: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/openbsd/</span>
800
- 161: <span class="ruby-comment cmt"># According to OpenBSD's pthreads man page, pthreads do not work</span>
801
- 162: <span class="ruby-comment cmt"># correctly when an app is compiled with -g. It recommends using</span>
802
- 163: <span class="ruby-comment cmt"># -ggdb instead.</span>
803
- 164: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-ggdb'</span>
804
- 165: <span class="ruby-keyword kw">else</span>
805
- 166: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-g'</span>
806
- 167: <span class="ruby-keyword kw">end</span>
807
- 168: <span class="ruby-keyword kw">end</span>
808
- </pre>
809
- </div>
810
- </div>
811
- </div>
812
- <div class="method">
813
- <div class="title">
814
- <a name="M000029"></a><b>env_defined?</b>(name)
815
- </div>
816
- <div class="sourcecode">
817
- <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
818
- <div id="M000029_source" class="dyn-source">
819
- <pre>
820
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 155</span>
821
- 155: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">env_defined?</span>(<span class="ruby-identifier">name</span>)
822
- 156: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">empty?</span>
823
- 157: <span class="ruby-keyword kw">end</span>
824
- </pre>
825
- </div>
826
- </div>
827
- </div>
828
- <div class="method">
829
- <div class="title">
830
- <a name="M000056"></a><b>export_dynamic_flags</b>()
831
- </div>
832
- <div class="sourcecode">
833
- <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p>
834
- <div id="M000056_source" class="dyn-source">
835
- <pre>
836
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 170</span>
837
- 170: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">export_dynamic_flags</span>
838
- 171: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/linux/</span>
839
- 172: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-rdynamic'</span>
840
- 173: <span class="ruby-keyword kw">else</span>
841
- 174: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
842
- 175: <span class="ruby-keyword kw">end</span>
843
- 176: <span class="ruby-keyword kw">end</span>
844
- </pre>
845
- </div>
846
- </div>
847
- </div>
848
- <div class="method">
849
- <div class="title">
850
- <a name="M000028"></a><b>find_command</b>(name)
851
- </div>
852
- <div class="description">
853
- <p>
854
- Check whether the specified command is in $PATH, and return its absolute
855
- filename. Returns nil if the command is not found.
856
- </p>
857
- <p>
858
- This function exists because system(&#8216;which&#8217;) doesn&#8216;t
859
- always behave correctly, for some weird reason.
860
- </p>
861
- </div>
862
- <div class="sourcecode">
863
- <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p>
864
- <div id="M000028_source" class="dyn-source">
865
- <pre>
866
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 145</span>
867
- 145: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
868
- 146: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PATH'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">detect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">directory</span><span class="ruby-operator">|</span>
869
- 147: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
870
- 148: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">path</span>)
871
- 149: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span>
872
- 150: <span class="ruby-keyword kw">end</span>
873
- 151: <span class="ruby-keyword kw">end</span>
874
- 152: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
875
- 153: <span class="ruby-keyword kw">end</span>
876
- </pre>
877
- </div>
878
- </div>
879
- </div>
880
- <div class="method">
881
- <div class="title">
882
- <a name="M000068"></a><b>gem_command</b>()
883
- </div>
884
- <div class="description">
885
- <p>
886
- Returns the correct &#8216;gem&#8217; command for this Ruby interpreter.
887
- </p>
888
- </div>
889
- <div class="sourcecode">
890
- <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p>
891
- <div id="M000068_source" class="dyn-source">
892
- <pre>
893
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 110</span>
894
- 110: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gem_command</span>
895
- 111: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_tool</span>(<span class="ruby-value str">'gem'</span>)
896
- 112: <span class="ruby-keyword kw">end</span>
897
- </pre>
898
- </div>
899
- </div>
900
- </div>
901
- <div class="method">
902
- <div class="title">
903
- <a name="M000049"></a><b>gnu_make</b>()
904
- </div>
905
- <div class="sourcecode">
906
- <p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>
907
- <div id="M000049_source" class="dyn-source">
908
- <pre>
909
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 37</span>
910
- 37: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gnu_make</span>
911
- 38: <span class="ruby-identifier">gmake</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'gmake'</span>)
912
- 39: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">gmake</span>
913
- 40: <span class="ruby-identifier">gmake</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'make'</span>)
914
- 41: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">gmake</span>
915
- 42: <span class="ruby-keyword kw">if</span> <span class="ruby-node">`#{gmake} --version 2&gt;&amp;1`</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/GNU/</span>
916
- 43: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">gmake</span>
917
- 44: <span class="ruby-keyword kw">else</span>
918
- 45: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
919
- 46: <span class="ruby-keyword kw">end</span>
920
- 47: <span class="ruby-keyword kw">else</span>
921
- 48: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
922
- 49: <span class="ruby-keyword kw">end</span>
923
- 50: <span class="ruby-keyword kw">else</span>
924
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">gmake</span>
925
- 52: <span class="ruby-keyword kw">end</span>
926
- 53: <span class="ruby-keyword kw">end</span>
927
- </pre>
928
- </div>
929
- </div>
930
- </div>
931
- <div class="method">
932
- <div class="title">
933
- <a name="M000032"></a><b>httpd</b>()
934
- </div>
935
- <div class="description">
936
- <p>
937
- The absolute path to the Apache binary (that is, &#8216;<a
938
- href="PlatformInfo.html#M000032">httpd</a>&#8217;, &#8216;httpd2&#8217;,
939
- &#8216;apache&#8217; or &#8216;apache2&#8217;), or nil if not found.
940
- </p>
941
- </div>
942
- <div class="sourcecode">
943
- <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p>
944
- <div id="M000032_source" class="dyn-source">
945
- <pre>
946
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 67</span>
947
- 67: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">httpd</span>
948
- 68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'HTTPD'</span>)
949
- 69: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HTTPD'</span>]
950
- 70: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
951
- 71: [<span class="ruby-value str">&quot;apache2&quot;</span>, <span class="ruby-value str">&quot;httpd2&quot;</span>, <span class="ruby-value str">&quot;apache&quot;</span>, <span class="ruby-value str">&quot;httpd&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
952
- 72: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
953
- 73: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">command</span>.<span class="ruby-identifier">nil?</span>
954
- 74: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
955
- 75: <span class="ruby-keyword kw">end</span>
956
- 76: <span class="ruby-keyword kw">end</span>
957
- 77: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
958
- 78: <span class="ruby-keyword kw">else</span>
959
- 79: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_apache2_executable</span>(<span class="ruby-node">`#{apxs2} -q TARGET`</span>.<span class="ruby-identifier">strip</span>)
960
- 80: <span class="ruby-keyword kw">end</span>
961
- 81: <span class="ruby-keyword kw">end</span>
962
- </pre>
963
- </div>
964
- </div>
965
- </div>
966
- <div class="method">
967
- <div class="title">
968
- <a name="M000072"></a><b>in_rvm?</b>()
969
- </div>
970
- <div class="description">
971
- <p>
972
- Returns whether the current Ruby interpreter is managed by RVM.
973
- </p>
974
- </div>
975
- <div class="sourcecode">
976
- <p class="source-link">[ <a href="javascript:toggleSource('M000072_source')" id="l_M000072_source">show source</a> ]</p>
977
- <div id="M000072_source" class="dyn-source">
978
- <pre>
979
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 154</span>
980
- 154: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">in_rvm?</span>
981
- 155: <span class="ruby-identifier">bindir</span> = <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>]
982
- 156: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">bindir</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'/.rvm/'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">bindir</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'/rvm/'</span>)
983
- 157: <span class="ruby-keyword kw">end</span>
984
- </pre>
985
- </div>
986
- </div>
987
- </div>
988
- <div class="method">
989
- <div class="title">
990
- <a name="M000064"></a><b>library_extension</b>()
991
- </div>
992
- <div class="description">
993
- <p>
994
- The current platform&#8216;s shared library extension (&#8216;so&#8217; on
995
- most Unices).
996
- </p>
997
- </div>
998
- <div class="sourcecode">
999
- <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p>
1000
- <div id="M000064_source" class="dyn-source">
1001
- <pre>
1002
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/operating_system.rb, line 42</span>
1003
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">library_extension</span>
1004
- 43: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
1005
- 44: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;bundle&quot;</span>
1006
- 45: <span class="ruby-keyword kw">else</span>
1007
- 46: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;so&quot;</span>
1008
- 47: <span class="ruby-keyword kw">end</span>
1009
- 48: <span class="ruby-keyword kw">end</span>
1010
- </pre>
1011
- </div>
1012
- </div>
1013
- </div>
1014
- <div class="method">
1015
- <div class="title">
1016
- <a name="M000061"></a><b>linux_distro</b>()
1017
- </div>
1018
- <div class="description">
1019
- <p>
1020
- An identifier for the current Linux distribution. nil if the operating
1021
- system is not Linux.
1022
- </p>
1023
- </div>
1024
- <div class="sourcecode">
1025
- <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
1026
- <div id="M000061_source" class="dyn-source">
1027
- <pre>
1028
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/linux.rb, line 30</span>
1029
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">linux_distro</span>
1030
- 31: <span class="ruby-identifier">tags</span> = <span class="ruby-identifier">linux_distro_tags</span>
1031
- 32: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tags</span>
1032
- 33: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">first</span>
1033
- 34: <span class="ruby-keyword kw">else</span>
1034
- 35: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1035
- 36: <span class="ruby-keyword kw">end</span>
1036
- 37: <span class="ruby-keyword kw">end</span>
1037
- </pre>
1038
- </div>
1039
- </div>
1040
- </div>
1041
- <div class="method">
1042
- <div class="title">
1043
- <a name="M000062"></a><b>linux_distro_tags</b>()
1044
- </div>
1045
- <div class="description">
1046
- <p>
1047
- Autodetects the current Linux distribution and return a number of
1048
- identifier tags. The first tag identifies the distribution while the other
1049
- tags indicate which distributions it is likely compatible with. Returns nil
1050
- if the operating system is not Linux.
1051
- </p>
1052
- </div>
1053
- <div class="sourcecode">
1054
- <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
1055
- <div id="M000062_source" class="dyn-source">
1056
- <pre>
1057
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/linux.rb, line 43</span>
1058
- 43: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">linux_distro_tags</span>
1059
- 44: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/linux/</span>
1060
- 45: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1061
- 46: <span class="ruby-keyword kw">end</span>
1062
- 47: <span class="ruby-identifier">lsb_release</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-value str">&quot;/etc/lsb-release&quot;</span>)
1063
- 48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lsb_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Ubuntu/</span>
1064
- 49: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:ubuntu</span>, <span class="ruby-identifier">:debian</span>]
1065
- 50: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/debian_version&quot;</span>)
1066
- 51: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:debian</span>]
1067
- 52: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/redhat-release&quot;</span>)
1068
- 53: <span class="ruby-identifier">redhat_release</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-value str">&quot;/etc/redhat-release&quot;</span>)
1069
- 54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/CentOS/</span>
1070
- 55: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:centos</span>, <span class="ruby-identifier">:redhat</span>]
1071
- 56: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Fedora/</span>
1072
- 57: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:fedora</span>, <span class="ruby-identifier">:redhat</span>]
1073
- 58: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Mandriva/</span>
1074
- 59: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:mandriva</span>, <span class="ruby-identifier">:redhat</span>]
1075
- 60: <span class="ruby-keyword kw">else</span>
1076
- 61: <span class="ruby-comment cmt"># On official RHEL distros, the content is in the form of</span>
1077
- 62: <span class="ruby-comment cmt"># &quot;Red Hat Enterprise Linux Server release 5.1 (Tikanga)&quot;</span>
1078
- 63: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:rhel</span>, <span class="ruby-identifier">:redhat</span>]
1079
- 64: <span class="ruby-keyword kw">end</span>
1080
- 65: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/suse-release&quot;</span>)
1081
- 66: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:suse</span>]
1082
- 67: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/gentoo-release&quot;</span>)
1083
- 68: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:gentoo</span>]
1084
- 69: <span class="ruby-keyword kw">else</span>
1085
- 70: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:unknown</span>]
1086
- 71: <span class="ruby-keyword kw">end</span>
1087
- 72: <span class="ruby-comment cmt"># TODO: Slackware</span>
1088
- 73: <span class="ruby-keyword kw">end</span>
1089
- </pre>
1090
- </div>
1091
- </div>
1092
- </div>
1093
- <div class="method">
1094
- <div class="title">
1095
- <a name="M000076"></a><b>locate_ruby_tool</b>(name)
1096
- </div>
1097
- <div class="description">
1098
- <p>
1099
- Locates a Ruby tool command, e.g. &#8216;gem&#8217;, &#8216;<a
1100
- href="PlatformInfo.html#M000069">rake</a>&#8217;, &#8216;bundle&#8217;,
1101
- etc. Instead of naively looking in $PATH, this function uses a variety of
1102
- search heuristics to find the command that&#8216;s really associated with
1103
- the current Ruby interpreter. It should never locate a command that&#8216;s
1104
- actually associated with a different Ruby interpreter. Returns nil when
1105
- nothing&#8216;s found.
1106
- </p>
1107
- </div>
1108
- <div class="sourcecode">
1109
- <p class="source-link">[ <a href="javascript:toggleSource('M000076_source')" id="l_M000076_source">show source</a> ]</p>
1110
- <div id="M000076_source" class="dyn-source">
1111
- <pre>
1112
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 246</span>
1113
- 246: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">locate_ruby_tool</span>(<span class="ruby-identifier">name</span>)
1114
- 247: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">locate_ruby_tool_by_basename</span>(<span class="ruby-identifier">name</span>)
1115
- 248: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>
1116
- 249: <span class="ruby-identifier">exeext</span> = <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'EXEEXT'</span>]
1117
- 250: <span class="ruby-identifier">exeext</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exeext</span>.<span class="ruby-identifier">empty?</span>
1118
- 251: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exeext</span>
1119
- 252: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">locate_ruby_tool_by_basename</span>(<span class="ruby-node">&quot;#{name}#{exeext}&quot;</span>)
1120
- 253: <span class="ruby-keyword kw">end</span>
1121
- 254: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>
1122
- 255: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">locate_ruby_tool_by_basename</span>(<span class="ruby-identifier">transform_according_to_ruby_exec_format</span>(<span class="ruby-identifier">name</span>))
1123
- 256: <span class="ruby-keyword kw">end</span>
1124
- 257: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exeext</span>
1125
- 258: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">locate_ruby_tool_by_basename</span>(<span class="ruby-identifier">transform_according_to_ruby_exec_format</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">exeext</span>)
1126
- 259: <span class="ruby-keyword kw">end</span>
1127
- 260: <span class="ruby-keyword kw">end</span>
1128
- 261: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
1129
- 262: <span class="ruby-keyword kw">end</span>
1130
- </pre>
1131
- </div>
1132
- </div>
1133
- </div>
1134
- <div class="method">
1135
- <div class="title">
1136
- <a name="M000063"></a><b>os_name</b>()
1137
- </div>
1138
- <div class="description">
1139
- <p>
1140
- Returns the operating system&#8216;s name. This name is in lowercase and
1141
- contains no spaces, and thus is suitable to be used in some kind of ID.
1142
- E.g. &quot;linux&quot;, &quot;macosx&quot;.
1143
- </p>
1144
- </div>
1145
- <div class="sourcecode">
1146
- <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
1147
- <div id="M000063_source" class="dyn-source">
1148
- <pre>
1149
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/operating_system.rb, line 32</span>
1150
- 32: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">os_name</span>
1151
- 33: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'target_os'</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">sw_vers</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'sw_vers'</span>))
1152
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;macosx&quot;</span>
1153
- 35: <span class="ruby-keyword kw">else</span>
1154
- 36: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">RUBY_PLATFORM</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/.*?-/</span>, <span class="ruby-value str">''</span>)
1155
- 37: <span class="ruby-keyword kw">end</span>
1156
- 38: <span class="ruby-keyword kw">end</span>
1157
- </pre>
1158
- </div>
1159
- </div>
1160
- </div>
1161
- <div class="method">
1162
- <div class="title">
1163
- <a name="M000046"></a><b>passenger_binary_compatibility_id</b>()
1164
- </div>
1165
- <div class="description">
1166
- <p>
1167
- Returns an identifier string that describes the current platform&#8216;s
1168
- binary compatibility with regard to Phusion Passenger binaries, both the
1169
- Ruby extension and the C++ binaries. Two systems with the same binary
1170
- compatibility identifiers are able to run the same Phusion Passenger
1171
- binaries.
1172
- </p>
1173
- <p>
1174
- The the string depends on the following factors:
1175
- </p>
1176
- <ul>
1177
- <li>The Ruby extension binary compatibility identifiers.
1178
-
1179
- </li>
1180
- <li>The operating system name.
1181
-
1182
- </li>
1183
- <li>Operating system runtime identifier. This may include the kernel version,
1184
- libc version, C++ ABI version, etc. Everything that is of interest for
1185
- binary compatibility with Phusion Passenger&#8216;s C++ components.
1186
-
1187
- </li>
1188
- <li>Operating system default runtime architecture. This is not the same as the
1189
- CPU architecture; some CPUs support multiple architectures, e.g. Intel Core
1190
- 2 Duo supports x86 and x86_64. Some operating systems actually support
1191
- multiple runtime architectures: a lot of x86_64 Linux distributions also
1192
- include 32-bit runtimes, and OS X Snow Leopard is x86_64 by default but all
1193
- system libraries also support x86. This component identifies the
1194
- architecture that is used when compiling a binary with the system&#8216;s
1195
- C++ compiler with its default options.
1196
-
1197
- </li>
1198
- </ul>
1199
- </div>
1200
- <div class="sourcecode">
1201
- <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p>
1202
- <div id="M000046_source" class="dyn-source">
1203
- <pre>
1204
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/binary_compatibility.rb, line 117</span>
1205
- 117: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_binary_compatibility_id</span>
1206
- 118: <span class="ruby-identifier">ruby_engine</span>, <span class="ruby-identifier">ruby_ext_version</span>, <span class="ruby-identifier">ruby_arch</span>, <span class="ruby-identifier">os_name</span> =
1207
- 119: <span class="ruby-identifier">ruby_extension_binary_compatibility_ids</span>
1208
- 120:
1209
- 121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">os_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;macosx&quot;</span>
1210
- 122: <span class="ruby-comment cmt"># RUBY_PLATFORM gives us the kernel version, but we want</span>
1211
- 123: <span class="ruby-comment cmt"># the OS X version.</span>
1212
- 124: <span class="ruby-identifier">os_version_string</span> = <span class="ruby-value">`sw_vers -productVersion`</span>.<span class="ruby-identifier">strip</span>
1213
- 125: <span class="ruby-comment cmt"># sw_vers returns something like &quot;10.6.2&quot;. We're only</span>
1214
- 126: <span class="ruby-comment cmt"># interested in the first two digits (MAJOR.MINOR) since</span>
1215
- 127: <span class="ruby-comment cmt"># tiny releases tend to be binary compatible with each</span>
1216
- 128: <span class="ruby-comment cmt"># other.</span>
1217
- 129: <span class="ruby-identifier">components</span> = <span class="ruby-identifier">os_version_string</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>)
1218
- 130: <span class="ruby-identifier">os_version</span> = <span class="ruby-node">&quot;#{components[0]}.#{components[1]}&quot;</span>
1219
- 131: <span class="ruby-identifier">os_runtime</span> = <span class="ruby-identifier">os_version</span>
1220
- 132:
1221
- 133: <span class="ruby-identifier">os_arch</span> = <span class="ruby-identifier">cpu_architecture</span>
1222
- 134: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">os_version</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value str">&quot;10.5&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">os_arch</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^i.86$/</span>
1223
- 135: <span class="ruby-comment cmt"># On Snow Leopard, 'uname -m' returns i386 but</span>
1224
- 136: <span class="ruby-comment cmt"># we *know* that everything is x86_64 by default.</span>
1225
- 137: <span class="ruby-identifier">os_arch</span> = <span class="ruby-value str">&quot;x86_64&quot;</span>
1226
- 138: <span class="ruby-keyword kw">end</span>
1227
- 139: <span class="ruby-keyword kw">else</span>
1228
- 140: <span class="ruby-identifier">os_arch</span> = <span class="ruby-identifier">cpu_architecture</span>
1229
- 141:
1230
- 142: <span class="ruby-identifier">cpp</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'cpp'</span>)
1231
- 143: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cpp</span>
1232
- 144: <span class="ruby-identifier">macros</span> = <span class="ruby-node">`#{cpp} -dM &lt; /dev/null`</span>
1233
- 145:
1234
- 146: <span class="ruby-comment cmt"># Can be something like &quot;4.3.2&quot;</span>
1235
- 147: <span class="ruby-comment cmt"># or &quot;4.2.1 20070719 (FreeBSD)&quot;</span>
1236
- 148: <span class="ruby-identifier">macros</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/__VERSION__ &quot;(.+)&quot;/</span>
1237
- 149: <span class="ruby-identifier">compiler_version</span> = <span class="ruby-identifier">$1</span>
1238
- 150: <span class="ruby-identifier">compiler_version</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/ .*/</span>, <span class="ruby-value str">''</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_version</span>
1239
- 151:
1240
- 152: <span class="ruby-identifier">macros</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/__GXX_ABI_VERSION (.+)$/</span>
1241
- 153: <span class="ruby-identifier">cxx_abi_version</span> = <span class="ruby-identifier">$1</span>
1242
- 154: <span class="ruby-keyword kw">else</span>
1243
- 155: <span class="ruby-identifier">compiler_version</span> = <span class="ruby-keyword kw">nil</span>
1244
- 156: <span class="ruby-identifier">cxx_abi_version</span> = <span class="ruby-keyword kw">nil</span>
1245
- 157: <span class="ruby-keyword kw">end</span>
1246
- 158:
1247
- 159: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cxx_abi_version</span>
1248
- 160: <span class="ruby-identifier">os_runtime</span> = <span class="ruby-node">&quot;gcc#{compiler_version}-#{cxx_abi_version}&quot;</span>
1249
- 161: <span class="ruby-keyword kw">else</span>
1250
- 162: <span class="ruby-identifier">os_runtime</span> = [<span class="ruby-identifier">compiler_version</span>, <span class="ruby-identifier">cxx_abi_version</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;-&quot;</span>)
1251
- 163: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">os_runtime</span>.<span class="ruby-identifier">empty?</span>
1252
- 164: <span class="ruby-identifier">os_runtime</span> = <span class="ruby-value">`uname -r`</span>.<span class="ruby-identifier">strip</span>
1253
- 165: <span class="ruby-keyword kw">end</span>
1254
- 166: <span class="ruby-keyword kw">end</span>
1255
- 167: <span class="ruby-keyword kw">end</span>
1256
- 168:
1257
- 169: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ruby_engine</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;jruby&quot;</span>
1258
- 170: <span class="ruby-comment cmt"># For JRuby it's kinda useless to prepend &quot;java&quot; as extension</span>
1259
- 171: <span class="ruby-comment cmt"># architecture because JRuby doesn't allow any other extension</span>
1260
- 172: <span class="ruby-comment cmt"># architecture.</span>
1261
- 173: <span class="ruby-identifier">identifier</span> = <span class="ruby-value str">&quot;&quot;</span>
1262
- 174: <span class="ruby-keyword kw">else</span>
1263
- 175: <span class="ruby-identifier">identifier</span> = <span class="ruby-node">&quot;#{ruby_arch}-&quot;</span>
1264
- 176: <span class="ruby-keyword kw">end</span>
1265
- 177: <span class="ruby-identifier">identifier</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{ruby_engine}#{ruby_ext_version}-&quot;</span>
1266
- 178: <span class="ruby-comment cmt"># If the extension architecture is the same as the OS architecture</span>
1267
- 179: <span class="ruby-comment cmt"># then there's no need to specify it twice.</span>
1268
- 180: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ruby_arch</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">os_arch</span>
1269
- 181: <span class="ruby-identifier">identifier</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{os_arch}-&quot;</span>
1270
- 182: <span class="ruby-keyword kw">end</span>
1271
- 183: <span class="ruby-identifier">identifier</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{os_name}-#{os_runtime}&quot;</span>
1272
- 184: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">identifier</span>
1273
- 185: <span class="ruby-keyword kw">end</span>
1274
- </pre>
1275
- </div>
1276
- </div>
1277
- </div>
1278
- <div class="method">
1279
- <div class="title">
1280
- <a name="M000053"></a><b>portability_cflags</b>()
1281
- </div>
1282
- <div class="description">
1283
- <p>
1284
- Compiler flags that should be used for compiling every C/C++ program, for
1285
- portability reasons. These flags should be specified as last when invoking
1286
- the compiler.
1287
- </p>
1288
- </div>
1289
- <div class="sourcecode">
1290
- <p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
1291
- <div id="M000053_source" class="dyn-source">
1292
- <pre>
1293
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 84</span>
1294
- 84: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">portability_cflags</span>
1295
- 85: <span class="ruby-identifier">flags</span> = [<span class="ruby-value str">&quot;-D_REENTRANT -I/usr/local/include&quot;</span>]
1296
- 86:
1297
- 87: <span class="ruby-comment cmt"># Google SparseHash flags.</span>
1298
- 88: <span class="ruby-comment cmt"># Figure out header for hash function object and its namespace.</span>
1299
- 89: <span class="ruby-comment cmt"># Based on stl_hash.m4 and stl_hash_fun.m4 in the Google SparseHash sources.</span>
1300
- 90: <span class="ruby-identifier">hash_namespace</span> = <span class="ruby-keyword kw">nil</span>
1301
- 91: <span class="ruby-identifier">ok</span> = <span class="ruby-keyword kw">false</span>
1302
- 92: [<span class="ruby-value str">'__gnu_cxx'</span>, <span class="ruby-value str">''</span>, <span class="ruby-value str">'std'</span>, <span class="ruby-value str">'stdext'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">namespace</span><span class="ruby-operator">|</span>
1303
- 93: [<span class="ruby-value str">'ext/hash_map'</span>, <span class="ruby-value str">'hash_map'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash_map_header</span><span class="ruby-operator">|</span>
1304
- 94: <span class="ruby-identifier">ok</span> = <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:cxx</span>, <span class="ruby-node">%Q{
1305
- 95: #include &lt;#{hash_map_header}&gt;
1306
- 96: int
1307
- 97: main() {
1308
- 98: #{namespace}::hash_map&lt;int, int&gt; m;
1309
- 99: return 0;
1310
- 100: }
1311
- 101: }</span>)
1312
- 102: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ok</span>
1313
- 103: <span class="ruby-identifier">hash_namespace</span> = <span class="ruby-identifier">namespace</span>
1314
- 104: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-DHASH_NAMESPACE=\&quot;#{namespace}\&quot;&quot;</span>
1315
- 105: <span class="ruby-keyword kw">end</span>
1316
- 106: <span class="ruby-keyword kw">end</span>
1317
- 107: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ok</span>
1318
- 108: <span class="ruby-keyword kw">end</span>
1319
- 109: [<span class="ruby-value str">'ext/hash_fun.h'</span>, <span class="ruby-value str">'functional'</span>, <span class="ruby-value str">'tr1/functional'</span>,
1320
- 110: <span class="ruby-value str">'ext/stl_hash_fun.h'</span>, <span class="ruby-value str">'hash_fun.h'</span>, <span class="ruby-value str">'stl_hash_fun.h'</span>,
1321
- 111: <span class="ruby-value str">'stl/_hash_fun.h'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash_function_header</span><span class="ruby-operator">|</span>
1322
- 112: <span class="ruby-identifier">ok</span> = <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:cxx</span>, <span class="ruby-node">%Q{
1323
- 113: #include &lt;#{hash_function_header}&gt;
1324
- 114: int
1325
- 115: main() {
1326
- 116: #{hash_namespace}::hash&lt;int&gt;()(5);
1327
- 117: return 0;
1328
- 118: }
1329
- 119: }</span>)
1330
- 120: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ok</span>
1331
- 121: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-DHASH_FUN_H=\&quot;&lt;#{hash_function_header}&gt;\&quot;&quot;</span>
1332
- 122: <span class="ruby-keyword kw">break</span>
1333
- 123: <span class="ruby-keyword kw">end</span>
1334
- 124: <span class="ruby-keyword kw">end</span>
1335
- 125:
1336
- 126: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span>
1337
- 127: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-pthreads'</span>
1338
- 128: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'</span>
1339
- 129: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_HAS_STDINT_H'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris2.9/</span>
1340
- 130: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris2.9/</span>
1341
- 131: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-mcpu=ultrasparc'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/sparc/</span>
1342
- 132: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/openbsd/</span>
1343
- 133: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_HAS_STDINT_H -D_GLIBCPP__PTHREADS'</span>
1344
- 134: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/aix/</span>
1345
- 135: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DOXT_DISABLE_BACKTRACES'</span>
1346
- 136: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(sparc-linux|arm-linux|^arm.*-linux|sh4-linux)/</span>
1347
- 137: <span class="ruby-comment cmt"># http://code.google.com/p/phusion-passenger/issues/detail?id=200</span>
1348
- 138: <span class="ruby-comment cmt"># http://groups.google.com/group/phusion-passenger/t/6b904a962ee28e5c</span>
1349
- 139: <span class="ruby-comment cmt"># http://groups.google.com/group/phusion-passenger/browse_thread/thread/aad4bd9d8d200561</span>
1350
- 140: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_SP_USE_PTHREADS'</span>
1351
- 141: <span class="ruby-keyword kw">end</span>
1352
- 142: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot; &quot;</span>).<span class="ruby-identifier">strip</span>
1353
- 143: <span class="ruby-keyword kw">end</span>
1354
- </pre>
1355
- </div>
1356
- </div>
1357
- </div>
1358
- <div class="method">
1359
- <div class="title">
1360
- <a name="M000054"></a><b>portability_ldflags</b>()
1361
- </div>
1362
- <div class="description">
1363
- <p>
1364
- Linker flags that should be used for linking every C/C++ program, for
1365
- portability reasons. These flags should be specified as last when invoking
1366
- the linker.
1367
- </p>
1368
- </div>
1369
- <div class="sourcecode">
1370
- <p class="source-link">[ <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show source</a> ]</p>
1371
- <div id="M000054_source" class="dyn-source">
1372
- <pre>
1373
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 149</span>
1374
- 149: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">portability_ldflags</span>
1375
- 150: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span>
1376
- 151: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lxnet -lrt -lsocket -lnsl -lpthread'</span>
1377
- 152: <span class="ruby-keyword kw">else</span>
1378
- 153: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lpthread'</span>
1379
- 154: <span class="ruby-keyword kw">end</span>
1380
- 155: <span class="ruby-keyword kw">end</span>
1381
- </pre>
1382
- </div>
1383
- </div>
1384
- </div>
1385
- <div class="method">
1386
- <div class="title">
1387
- <a name="M000069"></a><b>rake</b>()
1388
- </div>
1389
- <div class="description">
1390
- <p>
1391
- Returns the absolute path to the Rake executable that belongs to the
1392
- current Ruby interpreter. Returns nil if it doesn&#8216;t exist.
1393
- </p>
1394
- <p>
1395
- The return value may not be the actual correct invocation for Rake. Use <a
1396
- href="PlatformInfo.html#M000070">rake_command</a> for that.
1397
- </p>
1398
- </div>
1399
- <div class="sourcecode">
1400
- <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p>
1401
- <div id="M000069_source" class="dyn-source">
1402
- <pre>
1403
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 121</span>
1404
- 121: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rake</span>
1405
- 122: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_tool</span>(<span class="ruby-value str">'rake'</span>)
1406
- 123: <span class="ruby-keyword kw">end</span>
1407
- </pre>
1408
- </div>
1409
- </div>
1410
- </div>
1411
- <div class="method">
1412
- <div class="title">
1413
- <a name="M000070"></a><b>rake_command</b>()
1414
- </div>
1415
- <div class="description">
1416
- <p>
1417
- Returns the correct command string for invoking the Rake executable that
1418
- belongs to the current Ruby interpreter. Returns nil if Rake is not found.
1419
- </p>
1420
- </div>
1421
- <div class="sourcecode">
1422
- <p class="source-link">[ <a href="javascript:toggleSource('M000070_source')" id="l_M000070_source">show source</a> ]</p>
1423
- <div id="M000070_source" class="dyn-source">
1424
- <pre>
1425
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 129</span>
1426
- 129: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rake_command</span>
1427
- 130: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">rake</span>
1428
- 131: <span class="ruby-comment cmt"># If the Rake executable is a Ruby program then we need to run</span>
1429
- 132: <span class="ruby-comment cmt"># it in the correct Ruby interpreter just in case Rake doesn't</span>
1430
- 133: <span class="ruby-comment cmt"># have the correct shebang line; we don't want a totally different</span>
1431
- 134: <span class="ruby-comment cmt"># Ruby than the current one to be invoked.</span>
1432
- 135: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">is_ruby_program?</span>(<span class="ruby-identifier">filename</span>)
1433
- 136: <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{ruby_command} #{filename}&quot;</span>
1434
- 137: <span class="ruby-keyword kw">else</span>
1435
- 138: <span class="ruby-comment cmt"># If it's not a Ruby program then it's probably a wrapper</span>
1436
- 139: <span class="ruby-comment cmt"># script as is the case with e.g. RVM (~/.rvm/wrappers).</span>
1437
- 140: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
1438
- 141: <span class="ruby-keyword kw">end</span>
1439
- 142: <span class="ruby-keyword kw">end</span>
1440
- </pre>
1441
- </div>
1442
- </div>
1443
- </div>
1444
- <div class="method">
1445
- <div class="title">
1446
- <a name="M000071"></a><b>rspec</b>()
1447
- </div>
1448
- <div class="description">
1449
- <p>
1450
- Returns the absolute path to the RSpec runner program that belongs to the
1451
- current Ruby interpreter. Returns nil if it doesn&#8216;t exist.
1452
- </p>
1453
- </div>
1454
- <div class="sourcecode">
1455
- <p class="source-link">[ <a href="javascript:toggleSource('M000071_source')" id="l_M000071_source">show source</a> ]</p>
1456
- <div id="M000071_source" class="dyn-source">
1457
- <pre>
1458
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 148</span>
1459
- 148: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rspec</span>
1460
- 149: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_tool</span>(<span class="ruby-value str">'spec'</span>)
1461
- 150: <span class="ruby-keyword kw">end</span>
1462
- </pre>
1463
- </div>
1464
- </div>
1465
- </div>
1466
- <div class="method">
1467
- <div class="title">
1468
- <a name="M000065"></a><b>ruby_command</b>()
1469
- </div>
1470
- <div class="description">
1471
- <p>
1472
- Returns correct command for invoking the current Ruby interpreter. In case
1473
- of RVM this function will return the path to the RVM wrapper script that
1474
- executes the current Ruby interpreter in the currently active gem set.
1475
- </p>
1476
- </div>
1477
- <div class="sourcecode">
1478
- <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p>
1479
- <div id="M000065_source" class="dyn-source">
1480
- <pre>
1481
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 48</span>
1482
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_command</span>
1483
- 49: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1484
- 50: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">rvm_ruby_string</span>
1485
- 51: <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">rvm_path</span>
1486
- 52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">dir</span>
1487
- 53: <span class="ruby-identifier">filename</span> = <span class="ruby-node">&quot;#{dir}/wrappers/#{name}/ruby&quot;</span>
1488
- 54: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
1489
- 55: <span class="ruby-identifier">contents</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'rb'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
1490
- 56: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>
1491
- 57: <span class="ruby-keyword kw">end</span>
1492
- 58: <span class="ruby-comment cmt"># Old wrapper scripts reference $HOME which causes</span>
1493
- 59: <span class="ruby-comment cmt"># things to blow up when run by a different user.</span>
1494
- 60: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;$HOME&quot;</span>)
1495
- 61: <span class="ruby-identifier">filename</span> = <span class="ruby-keyword kw">nil</span>
1496
- 62: <span class="ruby-keyword kw">end</span>
1497
- 63: <span class="ruby-keyword kw">else</span>
1498
- 64: <span class="ruby-identifier">filename</span> = <span class="ruby-keyword kw">nil</span>
1499
- 65: <span class="ruby-keyword kw">end</span>
1500
- 66: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>
1501
- 67: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
1502
- 68: <span class="ruby-keyword kw">else</span>
1503
- 69: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Your RVM wrapper scripts are too old. Please &quot;</span> <span class="ruby-operator">+</span>
1504
- 70: <span class="ruby-value str">&quot;update them first by running 'rvm update --head &amp;&amp; &quot;</span> <span class="ruby-operator">+</span>
1505
- 71: <span class="ruby-value str">&quot;rvm reload &amp;&amp; rvm repair all'.&quot;</span>
1506
- 72: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
1507
- 73: <span class="ruby-keyword kw">end</span>
1508
- 74: <span class="ruby-keyword kw">else</span>
1509
- 75: <span class="ruby-comment cmt"># Something's wrong with the user's RVM installation.</span>
1510
- 76: <span class="ruby-comment cmt"># Raise an error so that the user knows this instead of</span>
1511
- 77: <span class="ruby-comment cmt"># having things fail randomly later on.</span>
1512
- 78: <span class="ruby-comment cmt"># 'name' is guaranteed to be non-nil because rvm_ruby_string</span>
1513
- 79: <span class="ruby-comment cmt"># already raises an exception on error.</span>
1514
- 80: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Your RVM installation appears to be broken: the RVM &quot;</span> <span class="ruby-operator">+</span>
1515
- 81: <span class="ruby-value str">&quot;path cannot be found. Please fix your RVM installation &quot;</span> <span class="ruby-operator">+</span>
1516
- 82: <span class="ruby-value str">&quot;or contact the RVM developers for support.&quot;</span>
1517
- 83: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
1518
- 84: <span class="ruby-keyword kw">end</span>
1519
- 85: <span class="ruby-keyword kw">else</span>
1520
- 86: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ruby_executable</span>
1521
- 87: <span class="ruby-keyword kw">end</span>
1522
- 88: <span class="ruby-keyword kw">end</span>
1523
- </pre>
1524
- </div>
1525
- </div>
1526
- </div>
1527
- <div class="method">
1528
- <div class="title">
1529
- <a name="M000066"></a><b>ruby_executable</b>()
1530
- </div>
1531
- <div class="description">
1532
- <p>
1533
- Returns the full path to the current Ruby interpreter&#8216;s executable
1534
- file. This might not be the actual correct command to use for invoking the
1535
- Ruby interpreter; use <a href="PlatformInfo.html#M000065">ruby_command</a>
1536
- instead.
1537
- </p>
1538
- </div>
1539
- <div class="sourcecode">
1540
- <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p>
1541
- <div id="M000066_source" class="dyn-source">
1542
- <pre>
1543
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 94</span>
1544
- 94: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_executable</span>
1545
- 95: <span class="ruby-ivar">@@ruby_executable</span> <span class="ruby-operator">||=</span>
1546
- 96: <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'RUBY_INSTALL_NAME'</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'EXEEXT'</span>]
1547
- 97: <span class="ruby-keyword kw">end</span>
1548
- </pre>
1549
- </div>
1550
- </div>
1551
- </div>
1552
- <div class="method">
1553
- <div class="title">
1554
- <a name="M000045"></a><b>ruby_extension_binary_compatibility_ids</b>()
1555
- </div>
1556
- <div class="description">
1557
- <p>
1558
- Returns an array of identifiers that describe the current Ruby
1559
- interpreter&#8216;s extension binary compatibility. A Ruby extension
1560
- compiled for a certain Ruby interpreter can also be loaded on a different
1561
- Ruby interpreter with the same binary compatibility identifiers.
1562
- </p>
1563
- <p>
1564
- The identifiers depend on the following factors:
1565
- </p>
1566
- <ul>
1567
- <li>Ruby engine name.
1568
-
1569
- </li>
1570
- <li>Ruby extension version. This is not the same as the Ruby language version,
1571
- which identifies language-level compatibility. This is rather about binary
1572
- compatibility of extensions. MRI seems to break source compatibility
1573
- between tiny releases, though patchlevel releases tend to be source and
1574
- binary compatible.
1575
-
1576
- </li>
1577
- <li>Ruby extension architecture. This is not necessarily the same as the
1578
- operating system runtime architecture or the CPU architecture. For example,
1579
- in case of JRuby, the extension architecture is just &quot;java&quot;
1580
- because all extensions target the Java platform; the architecture the JVM
1581
- was compiled for has no effect on compatibility. On systems with universal
1582
- binaries support there may be multiple architectures. In this case the
1583
- architecture is &quot;universal&quot; because extensions must be able to
1584
- support all of the Ruby executable&#8216;s architectures.
1585
-
1586
- </li>
1587
- <li>The operating system for which the Ruby interpreter was compiled.
1588
-
1589
- </li>
1590
- </ul>
1591
- </div>
1592
- <div class="sourcecode">
1593
- <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p>
1594
- <div id="M000045_source" class="dyn-source">
1595
- <pre>
1596
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/binary_compatibility.rb, line 73</span>
1597
- 73: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_extension_binary_compatibility_ids</span>
1598
- 74: <span class="ruby-identifier">ruby_engine</span> = <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">RUBY_ENGINE</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;ruby&quot;</span>
1599
- 75: <span class="ruby-identifier">ruby_ext_version</span> = <span class="ruby-constant">RUBY_VERSION</span>
1600
- 76: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
1601
- 77: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/universal/</span>
1602
- 78: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-value str">&quot;universal&quot;</span>
1603
- 79: <span class="ruby-keyword kw">else</span>
1604
- 80: <span class="ruby-comment cmt"># Something like:</span>
1605
- 81: <span class="ruby-comment cmt"># &quot;/opt/ruby-enterprise/bin/ruby: Mach-O 64-bit executable x86_64&quot;</span>
1606
- 82: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-node">`file -L &quot;#{ruby_executable}&quot;`</span>.<span class="ruby-identifier">strip</span>
1607
- 83: <span class="ruby-identifier">ruby_arch</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/.* /</span>, <span class="ruby-value str">''</span>)
1608
- 84: <span class="ruby-keyword kw">end</span>
1609
- 85: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;java&quot;</span>
1610
- 86: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-value str">&quot;java&quot;</span>
1611
- 87: <span class="ruby-keyword kw">else</span>
1612
- 88: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-identifier">cpu_architecture</span>
1613
- 89: <span class="ruby-keyword kw">end</span>
1614
- 90: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">ruby_engine</span>, <span class="ruby-identifier">ruby_ext_version</span>, <span class="ruby-identifier">ruby_arch</span>, <span class="ruby-identifier">os_name</span>]
1615
- 91: <span class="ruby-keyword kw">end</span>
1616
- </pre>
1617
- </div>
1618
- </div>
1619
- </div>
1620
- <div class="method">
1621
- <div class="title">
1622
- <a name="M000075"></a><b>ruby_sudo_command</b>()
1623
- </div>
1624
- <div class="description">
1625
- <p>
1626
- Returns either &#8216;sudo&#8217; or &#8216;rvmsudo&#8217; depending on
1627
- whether the current Ruby interpreter is managed by RVM.
1628
- </p>
1629
- </div>
1630
- <div class="sourcecode">
1631
- <p class="source-link">[ <a href="javascript:toggleSource('M000075_source')" id="l_M000075_source">show source</a> ]</p>
1632
- <div id="M000075_source" class="dyn-source">
1633
- <pre>
1634
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 232</span>
1635
- 232: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_sudo_command</span>
1636
- 233: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1637
- 234: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;rvmsudo&quot;</span>
1638
- 235: <span class="ruby-keyword kw">else</span>
1639
- 236: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;sudo&quot;</span>
1640
- 237: <span class="ruby-keyword kw">end</span>
1641
- 238: <span class="ruby-keyword kw">end</span>
1642
- </pre>
1643
- </div>
1644
- </div>
1645
- </div>
1646
- <div class="method">
1647
- <div class="title">
1648
- <a name="M000067"></a><b>ruby_supports_fork?</b>()
1649
- </div>
1650
- <div class="description">
1651
- <p>
1652
- Returns whether the Ruby interpreter supports process forking.
1653
- </p>
1654
- </div>
1655
- <div class="sourcecode">
1656
- <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p>
1657
- <div id="M000067_source" class="dyn-source">
1658
- <pre>
1659
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 100</span>
1660
- 100: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_supports_fork?</span>
1661
- 101: <span class="ruby-comment cmt"># MRI &gt;= 1.9.2's respond_to? returns false for methods</span>
1662
- 102: <span class="ruby-comment cmt"># that are not implemented.</span>
1663
- 103: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:fork</span>) <span class="ruby-operator">&amp;&amp;</span>
1664
- 104: <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;jruby&quot;</span> <span class="ruby-operator">&amp;&amp;</span>
1665
- 105: <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;macruby&quot;</span> <span class="ruby-operator">&amp;&amp;</span>
1666
- 106: <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'target_os'</span>] <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/mswin|windows|mingw/</span>
1667
- 107: <span class="ruby-keyword kw">end</span>
1668
- </pre>
1669
- </div>
1670
- </div>
1671
- </div>
1672
- <div class="method">
1673
- <div class="title">
1674
- <a name="M000073"></a><b>rvm_path</b>()
1675
- </div>
1676
- <div class="description">
1677
- <p>
1678
- If the current Ruby interpreter is managed by RVM, returns the directory in
1679
- which RVM places its working files. Otherwise returns nil.
1680
- </p>
1681
- </div>
1682
- <div class="sourcecode">
1683
- <p class="source-link">[ <a href="javascript:toggleSource('M000073_source')" id="l_M000073_source">show source</a> ]</p>
1684
- <div id="M000073_source" class="dyn-source">
1685
- <pre>
1686
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 162</span>
1687
- 162: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rvm_path</span>
1688
- 163: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1689
- 164: [<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'rvm_path'</span>], <span class="ruby-value str">&quot;~/.rvm&quot;</span>, <span class="ruby-value str">&quot;/usr/local/rvm&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
1690
- 165: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">nil?</span>
1691
- 166: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
1692
- 167: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
1693
- 168: <span class="ruby-keyword kw">end</span>
1694
- 169: <span class="ruby-comment cmt"># Failure to locate the RVM path is probably caused by the</span>
1695
- 170: <span class="ruby-comment cmt"># user customizing $rvm_path. Older RVM versions don't</span>
1696
- 171: <span class="ruby-comment cmt"># export $rvm_path, making us unable to detect its value.</span>
1697
- 172: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Unable to locate the RVM path. Your RVM installation &quot;</span> <span class="ruby-operator">+</span>
1698
- 173: <span class="ruby-value str">&quot;is probably too old. Please update it with &quot;</span> <span class="ruby-operator">+</span>
1699
- 174: <span class="ruby-value str">&quot;'rvm update --head &amp;&amp; rvm reload &amp;&amp; rvm repair all'.&quot;</span>
1700
- 175: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
1701
- 176: <span class="ruby-keyword kw">else</span>
1702
- 177: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1703
- 178: <span class="ruby-keyword kw">end</span>
1704
- 179: <span class="ruby-keyword kw">end</span>
1705
- </pre>
1706
- </div>
1707
- </div>
1708
- </div>
1709
- <div class="method">
1710
- <div class="title">
1711
- <a name="M000074"></a><b>rvm_ruby_string</b>()
1712
- </div>
1713
- <div class="description">
1714
- <p>
1715
- If the current Ruby interpreter is managed by RVM, returns the RVM name
1716
- which identifies the current Ruby interpreter plus the currently active
1717
- gemset, e.g. something like this: &quot;ruby-1.9.2-p0@mygemset&quot;
1718
- </p>
1719
- <p>
1720
- Returns nil otherwise.
1721
- </p>
1722
- </div>
1723
- <div class="sourcecode">
1724
- <p class="source-link">[ <a href="javascript:toggleSource('M000074_source')" id="l_M000074_source">show source</a> ]</p>
1725
- <div id="M000074_source" class="dyn-source">
1726
- <pre>
1727
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 188</span>
1728
- 188: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rvm_ruby_string</span>
1729
- 189: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1730
- 190: <span class="ruby-comment cmt"># RVM used to export the necessary information through</span>
1731
- 191: <span class="ruby-comment cmt"># environment variables, but doesn't always do that anymore</span>
1732
- 192: <span class="ruby-comment cmt"># in the latest versions in order to fight env var pollution.</span>
1733
- 193: <span class="ruby-comment cmt"># Scanning $LOAD_PATH seems to be the only way to obtain</span>
1734
- 194: <span class="ruby-comment cmt"># the information.</span>
1735
- 195:
1736
- 196: <span class="ruby-comment cmt"># Getting the RVM name of the Ruby interpreter (&quot;ruby-1.9.2&quot;)</span>
1737
- 197: <span class="ruby-comment cmt"># isn't so hard, we can extract it from the #ruby_executable</span>
1738
- 198: <span class="ruby-comment cmt"># string. Getting the gemset name is a bit harder, so let's</span>
1739
- 199: <span class="ruby-comment cmt"># try various strategies...</span>
1740
- 200:
1741
- 201: <span class="ruby-comment cmt"># $GEM_HOME usually contains the gem set name.</span>
1742
- 202: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">GEM_HOME</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">GEM_HOME</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;rvm/gems/&quot;</span>)
1743
- 203: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-constant">GEM_HOME</span>)
1744
- 204: <span class="ruby-keyword kw">end</span>
1745
- 205:
1746
- 206: <span class="ruby-comment cmt"># User somehow managed to nuke $GEM_HOME. Extract info</span>
1747
- 207: <span class="ruby-comment cmt"># from $LOAD_PATH.</span>
1748
- 208: <span class="ruby-identifier">matching_path</span> = <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
1749
- 209: <span class="ruby-identifier">item</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;rvm/gems/&quot;</span>)
1750
- 210: <span class="ruby-keyword kw">end</span>
1751
- 211: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matching_path</span>
1752
- 212: <span class="ruby-identifier">subpath</span> = <span class="ruby-identifier">matching_path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^.*rvm\/gems\//</span>, <span class="ruby-value str">''</span>)
1753
- 213: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">subpath</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>).<span class="ruby-identifier">first</span>
1754
- 214: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>
1755
- 215: <span class="ruby-keyword kw">end</span>
1756
- 216:
1757
- 217: <span class="ruby-comment cmt"># On Ruby 1.9, $LOAD_PATH does not contain any gem paths until</span>
1758
- 218: <span class="ruby-comment cmt"># at least one gem has been required so the above can fail.</span>
1759
- 219: <span class="ruby-comment cmt"># We're out of options now, we can't detect the gem set.</span>
1760
- 220: <span class="ruby-comment cmt"># Raise an exception so that the user knows what's going on</span>
1761
- 221: <span class="ruby-comment cmt"># instead of having things fail in obscure ways later.</span>
1762
- 222: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Unable to autodetect the currently active RVM gem &quot;</span> <span class="ruby-operator">+</span>
1763
- 223: <span class="ruby-value str">&quot;set name. Please contact this program's author for support.&quot;</span>
1764
- 224: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
1765
- 225: <span class="ruby-keyword kw">end</span>
1766
- 226: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1767
- 227: <span class="ruby-keyword kw">end</span>
1768
- </pre>
1769
- </div>
1770
- </div>
1771
- </div>
1772
- <div class="method">
1773
- <div class="title">
1774
- <a name="M000077"></a><b>zlib_flags</b>()
1775
- </div>
1776
- <div class="sourcecode">
1777
- <p class="source-link">[ <a href="javascript:toggleSource('M000077_source')" id="l_M000077_source">show source</a> ]</p>
1778
- <div id="M000077_source" class="dyn-source">
1779
- <pre>
1780
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/zlib.rb, line 29</span>
1781
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zlib_flags</span>
1782
- 30: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1783
- 31: <span class="ruby-keyword kw">end</span>
1784
- </pre>
1785
- </div>
1786
- </div>
1787
- </div>
1788
- <div class="method">
1789
- <div class="title">
1790
- <a name="M000078"></a><b>zlib_libs</b>()
1791
- </div>
1792
- <div class="sourcecode">
1793
- <p class="source-link">[ <a href="javascript:toggleSource('M000078_source')" id="l_M000078_source">show source</a> ]</p>
1794
- <div id="M000078_source" class="dyn-source">
1795
- <pre>
1796
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/zlib.rb, line 33</span>
1797
- 33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zlib_libs</span>
1798
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lz'</span>
1799
- 35: <span class="ruby-keyword kw">end</span>
1800
- </pre>
1801
- </div>
1802
- </div>
1803
- </div>
1804
- </div>
1805
-
1806
- </div>
1807
-
1808
- </body>
1809
- </html>