public
Rubygem
Description: Johnson wraps JavaScript in a loving Ruby embrace.
Homepage: http://github.com/jbarnette/johnson/wikis
Clone URL: git://github.com/jbarnette/johnson.git
johnson / ext / spidermonkey / extconf.rb
100644 26 lines (17 sloc) 0.761 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# this needs to happen before mkmf is required.
ENV["ARCHFLAGS"] = "-arch #{`uname -p` =~ /powerpc/ ? 'ppc' : 'i386'}"
 
require "mkmf"
 
if Config::CONFIG['target_os'] == 'mingw32'
  $libs = append_library($libs, "winmm")
  $CFLAGS << " -DXP_WIN -DXP_WIN32"
else
  $CFLAGS << " -g -DXP_UNIX"
end
$CFLAGS << " -O3 -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline"
 
spidermonkey_base_dir = "../../vendor/spidermonkey"
 
spidermonkey_obj_dir = Dir[spidermonkey_base_dir + "/#{ENV['CROSS'] || ''}*.OBJ"].first
 
dir_config("johnson/spidermonkey")
 
find_header("jsautocfg.h", spidermonkey_obj_dir)
find_header("jsapi.h", spidermonkey_base_dir)
 
$LOCAL_LIBS << spidermonkey_obj_dir + "/libjs.a"
 
create_makefile("johnson/spidermonkey")