Permalink
Browse files

clean up and fixes

  • Loading branch information...
zenspider committed Oct 26, 2009
1 parent 919cfe4 commit c71ae05e51e45dd19172d7094357ece916386ee1
Showing with 9 additions and 9 deletions.
  1. +1 −4 bin/phuby_server
  2. +8 −5 ext/phuby/extconf.rb
View
5 bin/phuby_server 100644 → 100755
@@ -4,10 +4,7 @@ require 'rubygems'
require 'phuby'
require 'webrick'
-s = WEBrick::HTTPServer.new(
- :Port => 10101,
- :DocumentRoot => ARGV[0]
-)
+s = WEBrick::HTTPServer.new(:Port => 10101, :DocumentRoot => ARGV[0])
s.mount('/', Phuby::PHPHandler)
View
@@ -4,18 +4,21 @@
require 'mkmf'
-php_inc, php_lib = dir_config('php5', '/usr/local/include', '/usr/local/lib')
+config = Dir["/{usr,opt}/local/bin/php-config"]
+prefix = `#{config} --prefix`.chomp
-$INCFLAGS = "-I#{File.join(php_inc, 'php')}".quote + " #{$INCFLAGS}"
+php_inc, php_lib = dir_config("php5", "#{prefix}/include", "#{prefix}/lib")
+
+$INCFLAGS = "-I#{File.join(php_inc, "php").quote} #{$INCFLAGS}"
%w{ Zend TSRM main }.each do |dir|
- $INCFLAGS = "-I#{File.join(php_inc, 'php', dir)}".quote + " #{$INCFLAGS}"
+ $INCFLAGS = "-I#{File.join(php_inc, "php", dir).quote} #{$INCFLAGS}"
end
-unless find_library('php5', 'php_embed_init', php_lib)
+unless find_library("php5", "php_embed_init", php_lib)
abort "php is missing!"
end
-create_makefile('phuby/phuby')
+create_makefile("phuby/phuby")
# :startdoc:

0 comments on commit c71ae05

Please sign in to comment.