Permalink
Browse files

Temporarily revert "Do not use apr-config/apu-config on platforms on …

…which it is not necessary."

This reverts commit fa8f9eb.
  • Loading branch information...
FooBarWidget committed Jan 25, 2009
1 parent fa8f9eb commit f3a594721f91754671bfd0a7f0b989e78f13ab24
Showing with 6 additions and 33 deletions.
  1. +2 −4 Rakefile
  2. +2 −4 bin/passenger-install-apache2-module
  3. +2 −25 lib/passenger/platform_info.rb
View
@@ -36,10 +36,8 @@ include PlatformInfo
APXS2.nil? and raise "Could not find 'apxs' or 'apxs2'."
APACHE2CTL.nil? and raise "Could not find 'apachectl' or 'apache2ctl'."
HTTPD.nil? and raise "Could not find the Apache web server binary."
-if PlatformInfo.apr_config_needed?
- APR_FLAGS.nil? and raise "Could not find Apache Portable Runtime (APR)."
- APU_FLAGS.nil? and raise "Could not find Apache Portable Runtime Utility (APU)."
-end
+APR_FLAGS.nil? and raise "Could not find Apache Portable Runtime (APR)."
+APU_FLAGS.nil? and raise "Could not find Apache Portable Runtime Utility (APU)."
CXX = "g++"
THREADING_FLAGS = "-D_REENTRANT"
@@ -46,13 +46,11 @@ class Installer
Dependencies::Rake,
Dependencies::Apache2,
Dependencies::Apache2_DevHeaders,
+ Dependencies::APR_DevHeaders,
+ Dependencies::APU_DevHeaders,
Dependencies::FastThread,
Dependencies::Rack
]
- if PlatformInfo.apr_config_needed?
- REQUIRED_DEPENDENCIES << Dependencies::APR_DevHeaders
- REQUIRED_DEPENDENCIES << Dependencies::APU_DevHeaders
- end
def start
if natively_packaged?
@@ -17,7 +17,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
require 'rbconfig'
-require 'tempfile'
# Wow, I can't believe in how many ways one can build Apache in OS
# X! We have to resort to all sorts of tricks to make Passenger build
@@ -149,7 +148,7 @@ def self.find_apr_config
end
def self.determine_apr_info
- if !apr_config_needed? || APR_CONFIG.nil?
+ if APR_CONFIG.nil?
return nil
else
flags = `#{APR_CONFIG} --cppflags --includes`.strip
@@ -185,7 +184,7 @@ def self.find_apu_config
end
def self.determine_apu_info
- if !apr_config_needed? || APU_CONFIG.nil?
+ if APU_CONFIG.nil?
return nil
else
flags = `#{APU_CONFIG} --includes`.strip
@@ -267,28 +266,6 @@ def self.find_command(name)
end
return nil
end
-
- # Returns whether it is necessary to use information outputted by
- # 'apr-config' and 'apu-config' in order to compile an Apache module.
- # When Apache is installed with --with-included-apr, the APR/APU
- # headers are placed into the same directory as the Apache headers,
- # and so 'apr-config' and 'apu-config' won't be necessary in that case.
- def self.apr_config_needed?
- if @@apr_config_needed.nil?
- filename = File.join(Dir.tmpdir, "passenger-platform-check-#{Process.pid}.c")
- File.open(filename, "w") do |f|
- f.puts("#include <apr.h>")
- end
- begin
- @@apr_config_needed = !system("(gcc #{APXS2_FLAGS} -c '#{filename}' -o '#{filename}.o') >/dev/null 2>/dev/null")
- ensure
- File.unlink(filename) rescue nil
- File.unlink("#{filename}.o") rescue nil
- end
- end
- return @@apr_config_needed
- end
- @@apr_config_needed = nil
# The absolute path to the current Ruby interpreter.
RUBY = Config::CONFIG['bindir'] + '/' + Config::CONFIG['RUBY_INSTALL_NAME'] + Config::CONFIG['EXEEXT']

0 comments on commit f3a5947

Please sign in to comment.