Skip to content

Commit

Permalink
Temporarily revert "Do not use apr-config/apu-config on platforms on …
Browse files Browse the repository at this point in the history
…which it is not necessary."

This reverts commit fa8f9eb.
  • Loading branch information
FooBarWidget committed Jan 25, 2009
1 parent fa8f9eb commit f3a5947
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
6 changes: 2 additions & 4 deletions Rakefile
Expand Up @@ -36,10 +36,8 @@ include PlatformInfo
APXS2.nil? and raise "Could not find 'apxs' or 'apxs2'." APXS2.nil? and raise "Could not find 'apxs' or 'apxs2'."
APACHE2CTL.nil? and raise "Could not find 'apachectl' or 'apache2ctl'." APACHE2CTL.nil? and raise "Could not find 'apachectl' or 'apache2ctl'."
HTTPD.nil? and raise "Could not find the Apache web server binary." 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)."
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)."
APU_FLAGS.nil? and raise "Could not find Apache Portable Runtime Utility (APU)."
end


CXX = "g++" CXX = "g++"
THREADING_FLAGS = "-D_REENTRANT" THREADING_FLAGS = "-D_REENTRANT"
Expand Down
6 changes: 2 additions & 4 deletions bin/passenger-install-apache2-module
Expand Up @@ -46,13 +46,11 @@ class Installer
Dependencies::Rake, Dependencies::Rake,
Dependencies::Apache2, Dependencies::Apache2,
Dependencies::Apache2_DevHeaders, Dependencies::Apache2_DevHeaders,
Dependencies::APR_DevHeaders,
Dependencies::APU_DevHeaders,
Dependencies::FastThread, Dependencies::FastThread,
Dependencies::Rack Dependencies::Rack
] ]
if PlatformInfo.apr_config_needed?
REQUIRED_DEPENDENCIES << Dependencies::APR_DevHeaders
REQUIRED_DEPENDENCIES << Dependencies::APU_DevHeaders
end


def start def start
if natively_packaged? if natively_packaged?
Expand Down
27 changes: 2 additions & 25 deletions lib/passenger/platform_info.rb
Expand Up @@ -17,7 +17,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


require 'rbconfig' require 'rbconfig'
require 'tempfile'


# Wow, I can't believe in how many ways one can build Apache in OS # 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 # X! We have to resort to all sorts of tricks to make Passenger build
Expand Down Expand Up @@ -149,7 +148,7 @@ def self.find_apr_config
end end


def self.determine_apr_info def self.determine_apr_info
if !apr_config_needed? || APR_CONFIG.nil? if APR_CONFIG.nil?
return nil return nil
else else
flags = `#{APR_CONFIG} --cppflags --includes`.strip flags = `#{APR_CONFIG} --cppflags --includes`.strip
Expand Down Expand Up @@ -185,7 +184,7 @@ def self.find_apu_config
end end


def self.determine_apu_info def self.determine_apu_info
if !apr_config_needed? || APU_CONFIG.nil? if APU_CONFIG.nil?
return nil return nil
else else
flags = `#{APU_CONFIG} --includes`.strip flags = `#{APU_CONFIG} --includes`.strip
Expand Down Expand Up @@ -267,28 +266,6 @@ def self.find_command(name)
end end
return nil return nil
end 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. # The absolute path to the current Ruby interpreter.
RUBY = Config::CONFIG['bindir'] + '/' + Config::CONFIG['RUBY_INSTALL_NAME'] + Config::CONFIG['EXEEXT'] RUBY = Config::CONFIG['bindir'] + '/' + Config::CONFIG['RUBY_INSTALL_NAME'] + Config::CONFIG['EXEEXT']
Expand Down

0 comments on commit f3a5947

Please sign in to comment.