Skip to content

Commit d496f79

Browse files
joshflori
authored andcommitted
Revert "simplified build structure"
This reverts 76e017a commit.
1 parent ed3c612 commit d496f79

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
json_pure if extensiontask is not present.
66
* Thanks to Dustin Schneider <dustin@stocktwits.com>, who reported a memory
77
leak, which is fixed in this release.
8+
* Applied 993f261ccb8f911d2ae57e9db48ec7acd0187283 patch from josh@github.
89
2010-04-25 (1.4.1)
910
* Fix for a bug reported by Dan DeLeo <dan@kallistec.com>, caused by T_FIXNUM
1011
being different on 32bit/64bit architectures.

Rakefile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ PKG_TITLE = 'JSON Implementation for Ruby'
2424
PKG_VERSION = File.read('VERSION').chomp
2525
PKG_FILES = FileList["**/*"].exclude(/CVS|pkg|tmp|coverage|Makefile|\.nfs\./).exclude(/\.(so|bundle|o|#{CONFIG['DLEXT']})$/)
2626
EXT_ROOT_DIR = 'ext/json/ext'
27-
EXT_PARSER_DL = "#{EXT_ROOT_DIR}/parser.#{CONFIG['DLEXT']}"
28-
EXT_PARSER_SRC = "#{EXT_ROOT_DIR}/parser.c"
27+
EXT_PARSER_DIR = "#{EXT_ROOT_DIR}/parser"
28+
EXT_PARSER_DL = "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}"
29+
EXT_PARSER_SRC = "#{EXT_PARSER_DIR}/parser.c"
2930
PKG_FILES << EXT_PARSER_SRC
30-
EXT_GENERATOR_DL = "#{EXT_ROOT_DIR}/generator.#{CONFIG['DLEXT']}"
31-
EXT_GENERATOR_SRC = "#{EXT_ROOT_DIR}/generator.c"
31+
EXT_GENERATOR_DIR = "#{EXT_ROOT_DIR}/generator"
32+
EXT_GENERATOR_DL = "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}"
33+
EXT_GENERATOR_SRC = "#{EXT_GENERATOR_DIR}/generator.c"
3234
RAGEL_CODEGEN = %w[rlcodegen rlgen-cd ragel].find { |c| system(c, '-v') }
3335
RAGEL_DOTGEN = %w[rlgen-dot rlgen-cd ragel].find { |c| system(c, '-v') }
34-
RAGEL_PATH = "#{EXT_ROOT_DIR}/parser.rl"
36+
RAGEL_PATH = "#{EXT_PARSER_DIR}/parser.rl"
3537

3638
def myruby(*args, &block)
3739
@myruby ||= File.join(CONFIG['bindir'], CONFIG['ruby_install_name'])
@@ -73,17 +75,19 @@ desc "Compiling extension"
7375
task :compile_ext => [ EXT_PARSER_DL, EXT_GENERATOR_DL ]
7476

7577
file EXT_PARSER_DL => EXT_PARSER_SRC do
76-
cd EXT_ROOT_DIR do
77-
myruby 'extconf_parser.rb'
78+
cd EXT_PARSER_DIR do
79+
myruby 'extconf.rb'
7880
sh MAKE
7981
end
82+
cp "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
8083
end
8184

8285
file EXT_GENERATOR_DL => EXT_GENERATOR_SRC do
83-
cd EXT_ROOT_DIR do
84-
myruby 'extconf_generator.rb'
86+
cd EXT_GENERATOR_DIR do
87+
myruby 'extconf.rb'
8588
sh MAKE
8689
end
90+
cp "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
8791
end
8892

8993
desc "Generate parser with ragel"
@@ -94,7 +98,7 @@ task :ragel_clean do
9498
end
9599

96100
file EXT_PARSER_SRC => RAGEL_PATH do
97-
cd EXT_ROOT_DIR do
101+
cd EXT_PARSER_DIR do
98102
if RAGEL_CODEGEN == 'ragel'
99103
sh "ragel parser.rl -G2 -o parser.c"
100104
else
@@ -215,7 +219,7 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension
215219

216220
s.files = PKG_FILES
217221

218-
s.extensions = FileList['ext/**/extconf_*.rb']
222+
s.extensions = FileList['ext/**/extconf.rb']
219223

220224
s.require_path = EXT_ROOT_DIR
221225
s.require_paths << 'ext'
@@ -244,21 +248,19 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension
244248

245249
Rake::ExtensionTask.new do |ext|
246250
ext.name = 'parser'
247-
ext.config_script = 'extconf_parser.rb'
248251
ext.gem_spec = spec_ext
249252
ext.cross_compile = true
250253
ext.cross_platform = %w[i386-mswin32 i386-mingw32]
251-
ext.ext_dir = 'ext/json/ext'
254+
ext.ext_dir = 'ext/json/ext/parser'
252255
ext.lib_dir = 'lib/json/ext'
253256
end
254257

255258
Rake::ExtensionTask.new do |ext|
256259
ext.name = 'generator'
257-
ext.config_script = 'extconf_generator.rb'
258260
ext.gem_spec = spec_ext
259261
ext.cross_compile = true
260262
ext.cross_platform = %w[i386-mswin32 i386-mingw32]
261-
ext.ext_dir = 'ext/json/ext'
263+
ext.ext_dir = 'ext/json/ext/generator'
262264
ext.lib_dir = 'lib/json/ext'
263265
end
264266
end

ext/json/ext/extconf_generator.rb renamed to ext/json/ext/generator/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
have_header("ruby/re.h") || have_header("re.h")
1515
have_header("ruby/encoding.h")
16-
create_makefile 'generator'
16+
create_makefile 'json/ext/generator'
File renamed without changes.
File renamed without changes.

ext/json/ext/extconf_parser.rb renamed to ext/json/ext/parser/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
end
1313

1414
have_header("re.h")
15-
create_makefile 'parser'
15+
create_makefile 'json/ext/parser'
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)