passenger 6.1.4 → 6.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -1
- data/Rakefile +1 -1
- data/build/agent.rb +15 -15
- data/build/apache2.rb +18 -18
- data/build/basics.rb +1 -1
- data/build/common_library.rb +21 -20
- data/build/cxx_tests.rb +19 -19
- data/build/integration_tests.rb +3 -3
- data/build/misc.rb +10 -9
- data/build/nginx.rb +12 -12
- data/build/oxt_tests.rb +7 -7
- data/build/packaging.rb +11 -11
- data/build/ruby_extension.rb +3 -3
- data/build/ruby_tests.rb +1 -1
- data/build/schema_printer.rb +13 -13
- data/build/support/cplusplus.rb +8 -8
- data/build/support/cxx_dependency_map.rb +622 -622
- data/build/support/general.rb +0 -1
- data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +4 -4
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +1 -1
- data/build/test_basics.rb +4 -4
- data/dev/colorize-logs +6 -6
- data/dev/copy_boost_headers +8 -8
- data/dev/index_cxx_dependencies.rb +6 -6
- data/dev/install_scripts_bootstrap_code.rb +4 -4
- data/dev/list_tests +2 -2
- data/dev/nginx_version_sha256 +2 -2
- data/dev/parse_file_descriptor_log +1 -1
- data/passenger.gemspec +4 -4
- data/src/agent/Core/Config.h +1 -1
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Watchdog/Config.h +1 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/helper-scripts/backtrace-sanitizer.rb +2 -2
- data/src/helper-scripts/download_binaries/extconf.rb +8 -8
- data/src/helper-scripts/meteor-loader.rb +39 -39
- data/src/helper-scripts/rack-loader.rb +1 -0
- data/src/helper-scripts/rack-preloader.rb +2 -1
- data/src/ruby_native_extension/extconf.rb +27 -28
- data/src/ruby_supportlib/phusion_passenger/abstract_installer.rb +27 -27
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +5 -4
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +9 -8
- data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +24 -24
- data/src/ruby_supportlib/phusion_passenger/admin_tools.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +526 -526
- data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +105 -105
- data/src/ruby_supportlib/phusion_passenger/config/about_command.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +7 -6
- data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/compile_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/config/detach_process_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +17 -17
- data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +18 -18
- data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +10 -10
- data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +12 -12
- data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +24 -23
- data/src/ruby_supportlib/phusion_passenger/config/main.rb +26 -26
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +5 -4
- data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +14 -13
- data/src/ruby_supportlib/phusion_passenger/config/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +34 -33
- data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +3 -2
- data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +35 -36
- data/src/ruby_supportlib/phusion_passenger/message_channel.rb +17 -16
- data/src/ruby_supportlib/phusion_passenger/message_client.rb +5 -4
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +42 -42
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +548 -548
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +6 -6
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +85 -84
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +13 -13
- data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +65 -65
- data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +6 -6
- data/src/ruby_supportlib/phusion_passenger/platform_info/curl.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +10 -10
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck.rb +6 -5
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/libs.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +14 -13
- data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +27 -26
- data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +16 -16
- data/src/ruby_supportlib/phusion_passenger/platform_info/pcre.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +29 -28
- data/src/ruby_supportlib/phusion_passenger/platform_info/zlib.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/platform_info.rb +37 -36
- data/src/ruby_supportlib/phusion_passenger/plugin.rb +3 -3
- data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +16 -15
- data/src/ruby_supportlib/phusion_passenger/public_api.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/out_of_band_gc.rb +5 -4
- data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +8 -7
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +9 -11
- data/src/ruby_supportlib/phusion_passenger/request_handler.rb +27 -26
- data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +6 -5
- data/src/ruby_supportlib/phusion_passenger/ruby_core_io_enhancements.rb +7 -6
- data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +13 -13
- data/src/ruby_supportlib/phusion_passenger/standalone/command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +351 -351
- data/src/ruby_supportlib/phusion_passenger/standalone/main.rb +11 -11
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +13 -14
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +21 -23
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +6 -6
- data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/download.rb +12 -11
- data/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb +9 -9
- data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +8 -7
- data/src/ruby_supportlib/phusion_passenger/utils/json.rb +7 -6
- data/src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/utils/progress_bar.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/shellwords.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/strscan.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/utils/tee_input.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +13 -12
- data/src/ruby_supportlib/phusion_passenger/utils/tmpio.rb +2 -3
- data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/utils.rb +17 -16
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +3 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +2 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +3 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +13 -13
- data/src/ruby_supportlib/phusion_passenger.rb +23 -22
- metadata +2 -2
|
@@ -32,9 +32,9 @@ module PhusionPassenger
|
|
|
32
32
|
def self.detect_language_extension(language)
|
|
33
33
|
case language
|
|
34
34
|
when :c
|
|
35
|
-
|
|
35
|
+
"c"
|
|
36
36
|
when :cxx
|
|
37
|
-
|
|
37
|
+
"cpp"
|
|
38
38
|
else
|
|
39
39
|
raise ArgumentError, "Unsupported language #{language.inspect}"
|
|
40
40
|
end
|
|
@@ -44,9 +44,9 @@ module PhusionPassenger
|
|
|
44
44
|
def self.detect_compiler_type_name(language)
|
|
45
45
|
case language
|
|
46
46
|
when :c
|
|
47
|
-
|
|
47
|
+
"C"
|
|
48
48
|
when :cxx
|
|
49
|
-
|
|
49
|
+
"C++"
|
|
50
50
|
else
|
|
51
51
|
raise ArgumentError, "Unsupported language #{language.inspect}"
|
|
52
52
|
end
|
|
@@ -56,17 +56,17 @@ module PhusionPassenger
|
|
|
56
56
|
def self.create_compiler_command(language, flags1, flags2, link = false)
|
|
57
57
|
case language
|
|
58
58
|
when :c
|
|
59
|
-
result = [cc, link ? ENV['EXTRA_PRE_LDFLAGS'] : nil,
|
|
59
|
+
result = [ cc, link ? ENV['EXTRA_PRE_LDFLAGS'] : nil,
|
|
60
60
|
ENV['EXTRA_PRE_CFLAGS'], flags1, flags2, ENV['EXTRA_CFLAGS'],
|
|
61
|
-
ENV['EXTRA_LDFLAGS']]
|
|
61
|
+
ENV['EXTRA_LDFLAGS'] ]
|
|
62
62
|
when :cxx
|
|
63
|
-
result = [cxx, link ? ENV['EXTRA_PRE_LDFLAGS'] : nil,
|
|
63
|
+
result = [ cxx, link ? ENV['EXTRA_PRE_LDFLAGS'] : nil,
|
|
64
64
|
ENV['EXTRA_PRE_CXXFLAGS'], flags1, flags2, ENV['EXTRA_CXXFLAGS'],
|
|
65
|
-
ENV['EXTRA_LDFLAGS']]
|
|
65
|
+
ENV['EXTRA_LDFLAGS'] ]
|
|
66
66
|
else
|
|
67
67
|
raise ArgumentError, "Unsupported language #{language.inspect}"
|
|
68
68
|
end
|
|
69
|
-
|
|
69
|
+
result.compact.join(" ").strip
|
|
70
70
|
end
|
|
71
71
|
private_class_method :create_compiler_command
|
|
72
72
|
|
|
@@ -96,20 +96,20 @@ module PhusionPassenger
|
|
|
96
96
|
end
|
|
97
97
|
if result.nil?
|
|
98
98
|
log("Command could not be executed! #{exec_error_reason}".strip)
|
|
99
|
-
|
|
99
|
+
false
|
|
100
100
|
elsif result
|
|
101
101
|
log("Check succeeded")
|
|
102
102
|
if capture_output
|
|
103
|
-
|
|
103
|
+
{ result: true, output: output }
|
|
104
104
|
else
|
|
105
|
-
|
|
105
|
+
true
|
|
106
106
|
end
|
|
107
107
|
else
|
|
108
108
|
log("Check failed with exit status #{$?.exitstatus}")
|
|
109
109
|
if capture_output == :always
|
|
110
|
-
|
|
110
|
+
{ result: false, output: output }
|
|
111
111
|
else
|
|
112
|
-
|
|
112
|
+
false
|
|
113
113
|
end
|
|
114
114
|
end
|
|
115
115
|
end
|
|
@@ -135,20 +135,20 @@ module PhusionPassenger
|
|
|
135
135
|
private_class_method :cc_or_cxx_supports_feliminate_unused_debug?
|
|
136
136
|
|
|
137
137
|
def self.cc_or_cxx_supports_blocks?(language)
|
|
138
|
-
command = create_compiler_command(language,"-E -dM",'- </dev/null')
|
|
138
|
+
command = create_compiler_command(language, "-E -dM", '- </dev/null')
|
|
139
139
|
result = `#{command}`
|
|
140
|
-
|
|
140
|
+
result.include? "__BLOCKS__"
|
|
141
141
|
end
|
|
142
142
|
private_class_method :cc_or_cxx_supports_blocks?
|
|
143
143
|
|
|
144
144
|
public
|
|
145
145
|
def self.cc
|
|
146
|
-
|
|
146
|
+
string_env('CC', default_cc)
|
|
147
147
|
end
|
|
148
148
|
memoize :cc
|
|
149
149
|
|
|
150
150
|
def self.cxx
|
|
151
|
-
|
|
151
|
+
string_env('CXX', default_cxx)
|
|
152
152
|
end
|
|
153
153
|
memoize :cxx
|
|
154
154
|
|
|
@@ -164,17 +164,17 @@ module PhusionPassenger
|
|
|
164
164
|
# compiled with GCC.
|
|
165
165
|
# https://code.google.com/p/phusion-passenger/issues/detail?id=950
|
|
166
166
|
if PlatformInfo.find_command('cc')
|
|
167
|
-
|
|
167
|
+
'cc'
|
|
168
168
|
else
|
|
169
|
-
|
|
169
|
+
'gcc'
|
|
170
170
|
end
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
def self.default_cxx
|
|
174
174
|
if PlatformInfo.find_command('c++')
|
|
175
|
-
|
|
175
|
+
'c++'
|
|
176
176
|
else
|
|
177
|
-
|
|
177
|
+
'g++'
|
|
178
178
|
end
|
|
179
179
|
end
|
|
180
180
|
|
|
@@ -217,9 +217,9 @@ module PhusionPassenger
|
|
|
217
217
|
def self.find_header(header_name, language, flags = nil)
|
|
218
218
|
extension = detect_language_extension(language)
|
|
219
219
|
create_temp_file("passenger-compile-check.#{extension}") do |filename, f|
|
|
220
|
-
source = %Q
|
|
220
|
+
source = %Q(
|
|
221
221
|
#include <#{header_name}>
|
|
222
|
-
|
|
222
|
+
)
|
|
223
223
|
f.puts(source)
|
|
224
224
|
f.close
|
|
225
225
|
begin
|
|
@@ -228,7 +228,7 @@ module PhusionPassenger
|
|
|
228
228
|
flags)
|
|
229
229
|
if result = run_compiler("Checking for #{header_name}", command, filename, source, true)
|
|
230
230
|
result[:output] =~ /^#include <...> search starts here:$(.+?)^End of search list\.$/m
|
|
231
|
-
search_paths = $1.to_s.strip.split("\n").map{ |line| line.strip }
|
|
231
|
+
search_paths = $1.to_s.strip.split("\n").map { |line| line.strip }
|
|
232
232
|
search_paths.each do |dir|
|
|
233
233
|
if File.file?("#{dir}/#{header_name}")
|
|
234
234
|
return "#{dir}/#{header_name}"
|
|
@@ -333,13 +333,13 @@ module PhusionPassenger
|
|
|
333
333
|
|
|
334
334
|
# Checks whether the compiler supports "-arch #{arch}".
|
|
335
335
|
def self.compiler_supports_architecture?(arch)
|
|
336
|
-
|
|
336
|
+
try_compile("Checking for C compiler '-arch' support",
|
|
337
337
|
:c, '', "-arch #{arch}")
|
|
338
338
|
end
|
|
339
339
|
|
|
340
340
|
def self.cc_supports_visibility_flag?
|
|
341
341
|
return false if os_name_simple == "aix"
|
|
342
|
-
|
|
342
|
+
try_compile("Checking for C compiler '-fvisibility' support",
|
|
343
343
|
:c, '', '-fvisibility=hidden')
|
|
344
344
|
end
|
|
345
345
|
memoize :cc_supports_visibility_flag?, true
|
|
@@ -360,62 +360,62 @@ module PhusionPassenger
|
|
|
360
360
|
|
|
361
361
|
def self.cxx_supports_visibility_flag?
|
|
362
362
|
return false if os_name_simple == "aix"
|
|
363
|
-
|
|
363
|
+
try_compile("Checking for C++ compiler '-fvisibility' support",
|
|
364
364
|
:cxx, '', '-fvisibility=hidden')
|
|
365
365
|
end
|
|
366
366
|
memoize :cxx_supports_visibility_flag?, true
|
|
367
367
|
|
|
368
368
|
def self.cc_supports_wno_attributes_flag?
|
|
369
|
-
|
|
369
|
+
try_compile_with_warning_flag(
|
|
370
370
|
"Checking for C compiler '-Wno-attributes' support",
|
|
371
371
|
:c, '', '-Wno-attributes')
|
|
372
372
|
end
|
|
373
373
|
memoize :cc_supports_wno_attributes_flag?, true
|
|
374
374
|
|
|
375
375
|
def self.cxx_supports_wno_attributes_flag?
|
|
376
|
-
|
|
376
|
+
try_compile_with_warning_flag(
|
|
377
377
|
"Checking for C++ compiler '-Wno-attributes' support",
|
|
378
378
|
:cxx, '', '-Wno-attributes')
|
|
379
379
|
end
|
|
380
380
|
memoize :cxx_supports_wno_attributes_flag?, true
|
|
381
381
|
|
|
382
382
|
def self.cc_supports_wno_missing_field_initializers_flag?
|
|
383
|
-
|
|
383
|
+
try_compile_with_warning_flag(
|
|
384
384
|
"Checking for C compiler '-Wno-missing-field-initializers' support",
|
|
385
385
|
:c, '', '-Wno-missing-field-initializers')
|
|
386
386
|
end
|
|
387
387
|
memoize :cc_supports_wno_missing_field_initializers_flag?, true
|
|
388
388
|
|
|
389
389
|
def self.cxx_supports_wno_missing_field_initializers_flag?
|
|
390
|
-
|
|
390
|
+
try_compile_with_warning_flag(
|
|
391
391
|
"Checking for C++ compiler '-Wno-missing-field-initializers' support",
|
|
392
392
|
:cxx, '', '-Wno-missing-field-initializers')
|
|
393
393
|
end
|
|
394
394
|
memoize :cxx_supports_wno_missing_field_initializers_flag?, true
|
|
395
395
|
|
|
396
396
|
def self.cc_supports_wno_unknown_pragmas_flag?
|
|
397
|
-
|
|
397
|
+
try_compile_with_warning_flag(
|
|
398
398
|
"Checking for C compiler '-Wno-unknown-pragmas' support",
|
|
399
399
|
:c, '', '-Wno-unknown-pragmas')
|
|
400
400
|
end
|
|
401
401
|
memoize :cc_supports_wno_unknown_pragmas_flag?, true
|
|
402
402
|
|
|
403
403
|
def self.cxx_supports_wno_unknown_pragmas_flag?
|
|
404
|
-
|
|
404
|
+
try_compile_with_warning_flag(
|
|
405
405
|
"Checking for C++ compiler '-Wno-unknown-pragmas' support",
|
|
406
406
|
:cxx, '', '-Wno-unknown-pragmas')
|
|
407
407
|
end
|
|
408
408
|
memoize :cxx_supports_wno_unknown_pragmas_flag?, true
|
|
409
409
|
|
|
410
410
|
def self.cxx_supports_wno_unused_local_typedefs_flag?
|
|
411
|
-
|
|
411
|
+
try_compile_with_warning_flag(
|
|
412
412
|
"Checking for C++ compiler '-Wno-unused-local-typedefs' support",
|
|
413
413
|
:cxx, '', '-Wno-unused-local-typedefs')
|
|
414
414
|
end
|
|
415
415
|
memoize :cxx_supports_wno_unused_local_typedefs_flag?, true
|
|
416
416
|
|
|
417
417
|
def self.cxx_supports_wno_format_nonliteral_flag?
|
|
418
|
-
|
|
418
|
+
try_compile_with_warning_flag(
|
|
419
419
|
"Checking for C++ compiler '-Wno-format-nonliteral' support",
|
|
420
420
|
:cxx, '', '-Wno-format-nonliteral')
|
|
421
421
|
end
|
|
@@ -436,13 +436,13 @@ module PhusionPassenger
|
|
|
436
436
|
memoize :cxx_supports_fno_optimize_sibling_calls_flag?
|
|
437
437
|
|
|
438
438
|
def self.cc_supports_no_tls_direct_seg_refs_option?
|
|
439
|
-
|
|
439
|
+
try_compile("Checking for C compiler '-mno-tls-direct-seg-refs' support",
|
|
440
440
|
:c, '', '-mno-tls-direct-seg-refs')
|
|
441
441
|
end
|
|
442
442
|
memoize :cc_supports_no_tls_direct_seg_refs_option?, true
|
|
443
443
|
|
|
444
444
|
def self.cxx_supports_no_tls_direct_seg_refs_option?
|
|
445
|
-
|
|
445
|
+
try_compile("Checking for C++ compiler '-mno-tls-direct-seg-refs' support",
|
|
446
446
|
:cxx, '', '-mno-tls-direct-seg-refs')
|
|
447
447
|
end
|
|
448
448
|
memoize :cxx_supports_no_tls_direct_seg_refs_option?, true
|
|
@@ -455,27 +455,27 @@ module PhusionPassenger
|
|
|
455
455
|
memoize :compiler_supports_wno_ambiguous_member_template?, true
|
|
456
456
|
|
|
457
457
|
def self.cc_supports_feliminate_unused_debug?
|
|
458
|
-
|
|
458
|
+
cc_or_cxx_supports_feliminate_unused_debug?(:c)
|
|
459
459
|
end
|
|
460
460
|
memoize :cc_supports_feliminate_unused_debug?, true
|
|
461
461
|
|
|
462
462
|
def self.cxx_supports_feliminate_unused_debug?
|
|
463
|
-
|
|
463
|
+
cc_or_cxx_supports_feliminate_unused_debug?(:cxx)
|
|
464
464
|
end
|
|
465
465
|
memoize :cxx_supports_feliminate_unused_debug?, true
|
|
466
466
|
|
|
467
467
|
def self.cc_block_support_ok?
|
|
468
|
-
|
|
468
|
+
(os_name_simple != 'macosx' || cc_or_cxx_supports_blocks?(:c) || os_version >= "10.13")
|
|
469
469
|
end
|
|
470
470
|
memoize :cc_block_support_ok?, true
|
|
471
471
|
|
|
472
472
|
def self.cxx_block_support_ok?
|
|
473
|
-
|
|
473
|
+
(os_name_simple != 'macosx' || cc_or_cxx_supports_blocks?(:cxx) || os_version >= "10.13")
|
|
474
474
|
end
|
|
475
475
|
memoize :cxx_block_support_ok?, true
|
|
476
476
|
|
|
477
477
|
def self.cxx_supports_wno_vla_cxx_extension_flag?
|
|
478
|
-
|
|
478
|
+
try_compile_with_warning_flag(
|
|
479
479
|
"Checking for C++ compiler '-Wno-vla-cxx-extension' support",
|
|
480
480
|
:cxx, '', '-Wno-vla-cxx-extension')
|
|
481
481
|
end
|
|
@@ -489,18 +489,18 @@ module PhusionPassenger
|
|
|
489
489
|
# Warnings should be suppressed with -Wno-attributes.
|
|
490
490
|
def self.cc_visibility_flag_generates_warnings?
|
|
491
491
|
if os_name_simple == "linux" && `#{cc} -v 2>&1` =~ /gcc version (.*?)/
|
|
492
|
-
|
|
492
|
+
$1 <= "4.1.2"
|
|
493
493
|
else
|
|
494
|
-
|
|
494
|
+
false
|
|
495
495
|
end
|
|
496
496
|
end
|
|
497
497
|
memoize :cc_visibility_flag_generates_warnings?, true
|
|
498
498
|
|
|
499
499
|
def self.cxx_visibility_flag_generates_warnings?
|
|
500
500
|
if os_name_simple == "linux" && `#{cxx} -v 2>&1` =~ /gcc version (.*?)/
|
|
501
|
-
|
|
501
|
+
$1 <= "4.1.2"
|
|
502
502
|
else
|
|
503
|
-
|
|
503
|
+
false
|
|
504
504
|
end
|
|
505
505
|
end
|
|
506
506
|
memoize :cxx_visibility_flag_generates_warnings?, true
|
|
@@ -532,39 +532,39 @@ module PhusionPassenger
|
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
534
|
if try_compile("Checking for C++ -std=gnu++14 compiler flag", :cxx, source, '-std=gnu++14')
|
|
535
|
-
|
|
535
|
+
"-std=gnu++14"
|
|
536
536
|
elsif try_compile("Checking for C++ -std=c++14 compiler flag", :cxx, source, '-std=c++14')
|
|
537
|
-
|
|
537
|
+
"-std=c++14"
|
|
538
538
|
else
|
|
539
|
-
|
|
539
|
+
nil
|
|
540
540
|
end
|
|
541
541
|
end
|
|
542
542
|
memoize :cxx_14_flag, true
|
|
543
543
|
|
|
544
544
|
def self.has_rt_library?
|
|
545
|
-
|
|
545
|
+
try_link("Checking for -lrt support",
|
|
546
546
|
:c, "int main() { return 0; }\n", '-lrt')
|
|
547
547
|
end
|
|
548
548
|
memoize :has_rt_library?, true
|
|
549
549
|
|
|
550
550
|
def self.has_math_library?
|
|
551
|
-
|
|
551
|
+
try_link("Checking for -lmath support",
|
|
552
552
|
:c, "int main() { return 0; }\n", '-lmath')
|
|
553
553
|
end
|
|
554
554
|
memoize :has_math_library?, true
|
|
555
555
|
|
|
556
556
|
def self.has_dl_library?
|
|
557
|
-
|
|
557
|
+
try_link("Checking for -ldl support",
|
|
558
558
|
:c, "int main() { return 0; }\n", '-ldl')
|
|
559
559
|
end
|
|
560
560
|
memoize :has_dl_library?, true
|
|
561
561
|
|
|
562
562
|
def self.has_accept4?
|
|
563
|
-
|
|
563
|
+
try_compile("Checking for accept4()", :c, %Q(
|
|
564
564
|
#define _GNU_SOURCE
|
|
565
565
|
#include <sys/socket.h>
|
|
566
566
|
static void *foo = accept4;
|
|
567
|
-
|
|
567
|
+
))
|
|
568
568
|
end
|
|
569
569
|
memoize :has_accept4?, true
|
|
570
570
|
|
|
@@ -606,9 +606,9 @@ module PhusionPassenger
|
|
|
606
606
|
|
|
607
607
|
def self.export_dynamic_flags
|
|
608
608
|
if os_name_simple == "linux"
|
|
609
|
-
|
|
609
|
+
'-rdynamic'
|
|
610
610
|
else
|
|
611
|
-
|
|
611
|
+
nil
|
|
612
612
|
end
|
|
613
613
|
end
|
|
614
614
|
|
|
@@ -622,28 +622,28 @@ module PhusionPassenger
|
|
|
622
622
|
|
|
623
623
|
|
|
624
624
|
def self.make
|
|
625
|
-
|
|
625
|
+
string_env('MAKE', find_command('make'))
|
|
626
626
|
end
|
|
627
627
|
memoize :make, true
|
|
628
628
|
|
|
629
629
|
def self.gnu_make
|
|
630
630
|
if result = string_env('GMAKE')
|
|
631
|
-
|
|
631
|
+
result
|
|
632
632
|
else
|
|
633
633
|
result = find_command('gmake')
|
|
634
634
|
if !result
|
|
635
635
|
result = find_command('make')
|
|
636
636
|
if result
|
|
637
637
|
if `#{result} --version 2>&1` =~ /GNU/
|
|
638
|
-
|
|
638
|
+
result
|
|
639
639
|
else
|
|
640
|
-
|
|
640
|
+
nil
|
|
641
641
|
end
|
|
642
642
|
else
|
|
643
|
-
|
|
643
|
+
nil
|
|
644
644
|
end
|
|
645
645
|
else
|
|
646
|
-
|
|
646
|
+
result
|
|
647
647
|
end
|
|
648
648
|
end
|
|
649
649
|
end
|
|
@@ -652,9 +652,9 @@ module PhusionPassenger
|
|
|
652
652
|
def self.xcode_select_version
|
|
653
653
|
if find_command('xcode-select')
|
|
654
654
|
`xcode-select --version` =~ /version (.+)\./
|
|
655
|
-
|
|
655
|
+
$1
|
|
656
656
|
else
|
|
657
|
-
|
|
657
|
+
nil
|
|
658
658
|
end
|
|
659
659
|
end
|
|
660
660
|
end
|
|
@@ -34,12 +34,12 @@ module PhusionPassenger
|
|
|
34
34
|
suffix = ' -lcrypto'
|
|
35
35
|
if os_name_simple == "macosx"
|
|
36
36
|
if os_version < '10.13'
|
|
37
|
-
|
|
37
|
+
prefix
|
|
38
38
|
else
|
|
39
|
-
|
|
39
|
+
"#{prefix} #{openssl_extra_ldflags} #{suffix}"
|
|
40
40
|
end
|
|
41
41
|
else
|
|
42
|
-
|
|
42
|
+
suffix
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
memoize :crypto_libs
|
|
@@ -47,12 +47,12 @@ module PhusionPassenger
|
|
|
47
47
|
def self.crypto_extra_cflags
|
|
48
48
|
if os_name_simple == "macosx"
|
|
49
49
|
if os_version < '10.13'
|
|
50
|
-
|
|
50
|
+
' -Wno-deprecated-declarations'
|
|
51
51
|
else
|
|
52
|
-
|
|
52
|
+
" -Wno-deprecated-declarations #{openssl_extra_cflags}"
|
|
53
53
|
end
|
|
54
54
|
else
|
|
55
|
-
|
|
55
|
+
''
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
memoize :crypto_extra_cflags
|
|
@@ -30,14 +30,14 @@ module PhusionPassenger
|
|
|
30
30
|
def self.curl_flags
|
|
31
31
|
result = `(curl-config --cflags) 2>/dev/null`.strip
|
|
32
32
|
if result.empty?
|
|
33
|
-
|
|
33
|
+
nil
|
|
34
34
|
else
|
|
35
35
|
version = `curl-config --vernum`.strip
|
|
36
36
|
if version >= '070c01'
|
|
37
37
|
# Curl >= 7.12.1 supports curl_easy_reset()
|
|
38
38
|
result << " -DHAS_CURL_EASY_RESET"
|
|
39
39
|
end
|
|
40
|
-
|
|
40
|
+
result
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
memoize :curl_flags
|
|
@@ -48,16 +48,16 @@ module PhusionPassenger
|
|
|
48
48
|
result << ' -framework Foundation -framework SystemConfiguration'
|
|
49
49
|
end
|
|
50
50
|
if result.empty?
|
|
51
|
-
|
|
51
|
+
nil
|
|
52
52
|
else
|
|
53
|
-
|
|
53
|
+
result
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
memoize :curl_libs
|
|
57
57
|
|
|
58
58
|
def self.curl_supports_ssl?
|
|
59
59
|
features = `(curl-config --feature) 2>/dev/null`
|
|
60
|
-
|
|
60
|
+
features =~ /SSL/
|
|
61
61
|
end
|
|
62
62
|
memoize :curl_supports_ssl?
|
|
63
63
|
end
|
|
@@ -32,28 +32,28 @@ module PhusionPassenger
|
|
|
32
32
|
# Extra flags that should always be passed to the C compiler
|
|
33
33
|
# when linking, to be included last in the command string.
|
|
34
34
|
def self.portability_c_ldflags
|
|
35
|
-
|
|
35
|
+
portability_c_or_cxx_ldflags(:c)
|
|
36
36
|
end
|
|
37
37
|
memoize :portability_c_ldflags
|
|
38
38
|
|
|
39
39
|
# Extra flags that should always be passed to the C++ compiler
|
|
40
40
|
# when linking, to be included last in the command string.
|
|
41
41
|
def self.portability_cxx_ldflags
|
|
42
|
-
|
|
42
|
+
portability_c_or_cxx_ldflags(:cxx)
|
|
43
43
|
end
|
|
44
44
|
memoize :portability_cxx_ldflags
|
|
45
45
|
|
|
46
46
|
# Extra compiler flags that should always be passed to the C compiler,
|
|
47
47
|
# last in the command string.
|
|
48
48
|
def self.default_extra_cflags
|
|
49
|
-
|
|
49
|
+
default_extra_c_or_cxxflags(:cc)
|
|
50
50
|
end
|
|
51
51
|
memoize :default_extra_cflags, true
|
|
52
52
|
|
|
53
53
|
# Extra compiler flags that should always be passed to the C++ compiler,
|
|
54
54
|
# last in the command string.
|
|
55
55
|
def self.default_extra_cxxflags
|
|
56
|
-
|
|
56
|
+
default_extra_c_or_cxxflags(:cxx)
|
|
57
57
|
end
|
|
58
58
|
memoize :default_extra_cxxflags, true
|
|
59
59
|
|
|
@@ -61,8 +61,8 @@ module PhusionPassenger
|
|
|
61
61
|
def self.check_hash_map(flags)
|
|
62
62
|
hash_namespace = nil
|
|
63
63
|
ok = false
|
|
64
|
-
['__gnu_cxx', '', 'std', 'stdext'].each do |namespace|
|
|
65
|
-
['hash_map', 'ext/hash_map'].each do |hash_map_header|
|
|
64
|
+
[ '__gnu_cxx', '', 'std', 'stdext' ].each do |namespace|
|
|
65
|
+
[ 'hash_map', 'ext/hash_map' ].each do |hash_map_header|
|
|
66
66
|
ok = try_compile("Checking for #{hash_map_header}", :cxx, %Q{
|
|
67
67
|
#include <#{hash_map_header}>
|
|
68
68
|
int
|
|
@@ -81,9 +81,9 @@ module PhusionPassenger
|
|
|
81
81
|
end
|
|
82
82
|
break if ok
|
|
83
83
|
end
|
|
84
|
-
['ext/hash_fun.h', 'functional', 'tr1/functional',
|
|
84
|
+
[ 'ext/hash_fun.h', 'functional', 'tr1/functional',
|
|
85
85
|
'ext/stl_hash_fun.h', 'hash_fun.h', 'stl_hash_fun.h',
|
|
86
|
-
'stl/_hash_fun.h'].each do |hash_function_header|
|
|
86
|
+
'stl/_hash_fun.h' ].each do |hash_function_header|
|
|
87
87
|
ok = try_compile("Checking for #{hash_function_header}", :cxx, %Q{
|
|
88
88
|
#include <#{hash_function_header}>
|
|
89
89
|
int
|
|
@@ -186,7 +186,7 @@ module PhusionPassenger
|
|
|
186
186
|
flags << '-O'
|
|
187
187
|
end
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
flags.join(' ')
|
|
190
190
|
end
|
|
191
191
|
private_class_method :default_extra_c_or_cxxflags
|
|
192
192
|
|
|
@@ -201,7 +201,7 @@ module PhusionPassenger
|
|
|
201
201
|
result << '-lrt' if has_rt_library?
|
|
202
202
|
result << '-lmath' if has_math_library?
|
|
203
203
|
result << '-ldl' if has_dl_library?
|
|
204
|
-
|
|
204
|
+
result.join(' ')
|
|
205
205
|
end
|
|
206
206
|
private_class_method :portability_c_or_cxx_ldflags
|
|
207
207
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
|
+
|
|
2
3
|
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
|
3
4
|
PhusionPassenger.require_passenger_lib 'platform_info/linux'
|
|
4
5
|
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
|
@@ -200,7 +201,7 @@ module PhusionPassenger
|
|
|
200
201
|
def check_for_ruby_library(name)
|
|
201
202
|
begin
|
|
202
203
|
require(name)
|
|
203
|
-
{ :
|
|
204
|
+
{ found: true }
|
|
204
205
|
rescue LoadError
|
|
205
206
|
if defined?(Gem)
|
|
206
207
|
false
|
|
@@ -208,7 +209,7 @@ module PhusionPassenger
|
|
|
208
209
|
begin
|
|
209
210
|
require 'rubygems'
|
|
210
211
|
require(name)
|
|
211
|
-
{ :
|
|
212
|
+
{ found: true }
|
|
212
213
|
rescue LoadError
|
|
213
214
|
false
|
|
214
215
|
end
|
|
@@ -291,7 +292,7 @@ module PhusionPassenger
|
|
|
291
292
|
end
|
|
292
293
|
|
|
293
294
|
def gem_command
|
|
294
|
-
PlatformInfo.gem_command(:
|
|
295
|
+
PlatformInfo.gem_command(sudo: true) || 'gem'
|
|
295
296
|
end
|
|
296
297
|
|
|
297
298
|
def find_command(command, *args)
|
|
@@ -334,7 +335,7 @@ module PhusionPassenger
|
|
|
334
335
|
raise "Cannot find depcheck spec #{identifier.inspect}" if !dep
|
|
335
336
|
puts_header "Checking for #{dep.name}..."
|
|
336
337
|
result = dep.check
|
|
337
|
-
result = { :
|
|
338
|
+
result = { found: false } if !result
|
|
338
339
|
|
|
339
340
|
if result[:found] && !result[:error]
|
|
340
341
|
puts_detail "Found: <green>yes</green>"
|
|
@@ -355,7 +356,7 @@ module PhusionPassenger
|
|
|
355
356
|
end
|
|
356
357
|
end
|
|
357
358
|
|
|
358
|
-
|
|
359
|
+
@missing_dependencies.empty?
|
|
359
360
|
ensure
|
|
360
361
|
PlatformInfo.log_implementation = old_log_impl
|
|
361
362
|
end
|
|
@@ -7,7 +7,7 @@ define 'apache2' do
|
|
|
7
7
|
{
|
|
8
8
|
:found => true,
|
|
9
9
|
"Location of httpd" => PlatformInfo.httpd,
|
|
10
|
-
"Apache version" => PlatformInfo.httpd_version
|
|
10
|
+
"Apache version" => PlatformInfo.httpd_version,
|
|
11
11
|
}
|
|
12
12
|
else
|
|
13
13
|
false
|
|
@@ -15,7 +15,7 @@ define 'apache2' do
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
on :ubuntu do
|
|
18
|
-
if `#{PlatformInfo
|
|
18
|
+
if `#{PlatformInfo.uname_command} -a`.include? 'precise'
|
|
19
19
|
apt_get_install "apache2-mpm-worker"
|
|
20
20
|
else
|
|
21
21
|
apt_get_install "apache2"
|
|
@@ -43,7 +43,7 @@ define 'apache2-dev' do
|
|
|
43
43
|
if PlatformInfo.apxs2
|
|
44
44
|
{
|
|
45
45
|
:found => true,
|
|
46
|
-
"Location of apxs2" => PlatformInfo.apxs2
|
|
46
|
+
"Location of apxs2" => PlatformInfo.apxs2,
|
|
47
47
|
}
|
|
48
48
|
else
|
|
49
49
|
false
|
|
@@ -51,14 +51,14 @@ define 'apache2-dev' do
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
on :ubuntu do
|
|
54
|
-
if `#{PlatformInfo
|
|
54
|
+
if `#{PlatformInfo.uname_command} -a`.include? 'precise'
|
|
55
55
|
apt_get_install "apache2-threaded-dev"
|
|
56
56
|
else
|
|
57
57
|
apt_get_install "apache2-dev"
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
on :debian do
|
|
61
|
-
if PlatformInfo
|
|
61
|
+
if PlatformInfo.os_version >= '9.4'
|
|
62
62
|
apt_get_install "apache2-dev"
|
|
63
63
|
else
|
|
64
64
|
apt_get_install "apache2-threaded-dev"
|
|
@@ -87,7 +87,7 @@ define 'apr-dev' do
|
|
|
87
87
|
{
|
|
88
88
|
:found => true,
|
|
89
89
|
"Location" => PlatformInfo.apr_config,
|
|
90
|
-
"Version" => `#{PlatformInfo.apr_config} --version`.strip
|
|
90
|
+
"Version" => `#{PlatformInfo.apr_config} --version`.strip,
|
|
91
91
|
}
|
|
92
92
|
else
|
|
93
93
|
false
|
|
@@ -120,7 +120,7 @@ define 'apu-dev' do
|
|
|
120
120
|
{
|
|
121
121
|
:found => true,
|
|
122
122
|
"Location" => PlatformInfo.apu_config,
|
|
123
|
-
"Version" => `#{PlatformInfo.apu_config} --version`.strip
|
|
123
|
+
"Version" => `#{PlatformInfo.apu_config} --version`.strip,
|
|
124
124
|
}
|
|
125
125
|
else
|
|
126
126
|
false
|
|
@@ -22,7 +22,7 @@ define 'libcurl-dev' do
|
|
|
22
22
|
website "http://curl.haxx.se/libcurl"
|
|
23
23
|
define_checker do
|
|
24
24
|
PhusionPassenger.require_passenger_lib 'platform_info/curl'
|
|
25
|
-
result = { :
|
|
25
|
+
result = { found: false }
|
|
26
26
|
|
|
27
27
|
if !(curl_config = PlatformInfo.find_command('curl-config'))
|
|
28
28
|
result[:error] = "Cannot find the `curl-config` command."
|