summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-04-27 10:31:00 -0500
committerFlorian Frank <flori@ping.de>2010-04-28 00:40:03 +0200
commitd496f792bf98dc49512d8f04f5867d26f6b8aed3 (patch)
tree0be428e299b69f8e678501ea27cc7e2ad8202259
parented3c61202f3d06029f86d57c3641abc192507d9c (diff)
downloadjson-1.4.2.tar.gz
Revert "simplified build structure"v1.4.2
This reverts 76e017a1b8a042bcb682b68821cc33f29788cd9a commit.
-rw-r--r--CHANGES1
-rw-r--r--Rakefile32
-rw-r--r--ext/json/ext/generator/extconf.rb (renamed from ext/json/ext/extconf_generator.rb)2
-rw-r--r--ext/json/ext/generator/generator.c (renamed from ext/json/ext/generator.c)0
-rw-r--r--ext/json/ext/generator/generator.h (renamed from ext/json/ext/generator.h)0
-rw-r--r--ext/json/ext/parser/extconf.rb (renamed from ext/json/ext/extconf_parser.rb)2
-rw-r--r--ext/json/ext/parser/parser.c (renamed from ext/json/ext/parser.c)0
-rw-r--r--ext/json/ext/parser/parser.h (renamed from ext/json/ext/parser.h)0
-rw-r--r--ext/json/ext/parser/parser.rl (renamed from ext/json/ext/parser.rl)0
9 files changed, 20 insertions, 17 deletions
diff --git a/CHANGES b/CHANGES
index 367f017..f0e6c6e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,7 @@
json_pure if extensiontask is not present.
* Thanks to Dustin Schneider <dustin@stocktwits.com>, who reported a memory
leak, which is fixed in this release.
+ * Applied 993f261ccb8f911d2ae57e9db48ec7acd0187283 patch from josh@github.
2010-04-25 (1.4.1)
* Fix for a bug reported by Dan DeLeo <dan@kallistec.com>, caused by T_FIXNUM
being different on 32bit/64bit architectures.
diff --git a/Rakefile b/Rakefile
index b19536d..3922c26 100644
--- a/Rakefile
+++ b/Rakefile
@@ -24,14 +24,16 @@ PKG_TITLE = 'JSON Implementation for Ruby'
PKG_VERSION = File.read('VERSION').chomp
PKG_FILES = FileList["**/*"].exclude(/CVS|pkg|tmp|coverage|Makefile|\.nfs\./).exclude(/\.(so|bundle|o|#{CONFIG['DLEXT']})$/)
EXT_ROOT_DIR = 'ext/json/ext'
-EXT_PARSER_DL = "#{EXT_ROOT_DIR}/parser.#{CONFIG['DLEXT']}"
-EXT_PARSER_SRC = "#{EXT_ROOT_DIR}/parser.c"
+EXT_PARSER_DIR = "#{EXT_ROOT_DIR}/parser"
+EXT_PARSER_DL = "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}"
+EXT_PARSER_SRC = "#{EXT_PARSER_DIR}/parser.c"
PKG_FILES << EXT_PARSER_SRC
-EXT_GENERATOR_DL = "#{EXT_ROOT_DIR}/generator.#{CONFIG['DLEXT']}"
-EXT_GENERATOR_SRC = "#{EXT_ROOT_DIR}/generator.c"
+EXT_GENERATOR_DIR = "#{EXT_ROOT_DIR}/generator"
+EXT_GENERATOR_DL = "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}"
+EXT_GENERATOR_SRC = "#{EXT_GENERATOR_DIR}/generator.c"
RAGEL_CODEGEN = %w[rlcodegen rlgen-cd ragel].find { |c| system(c, '-v') }
RAGEL_DOTGEN = %w[rlgen-dot rlgen-cd ragel].find { |c| system(c, '-v') }
-RAGEL_PATH = "#{EXT_ROOT_DIR}/parser.rl"
+RAGEL_PATH = "#{EXT_PARSER_DIR}/parser.rl"
def myruby(*args, &block)
@myruby ||= File.join(CONFIG['bindir'], CONFIG['ruby_install_name'])
@@ -73,17 +75,19 @@ desc "Compiling extension"
task :compile_ext => [ EXT_PARSER_DL, EXT_GENERATOR_DL ]
file EXT_PARSER_DL => EXT_PARSER_SRC do
- cd EXT_ROOT_DIR do
- myruby 'extconf_parser.rb'
+ cd EXT_PARSER_DIR do
+ myruby 'extconf.rb'
sh MAKE
end
+ cp "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
end
file EXT_GENERATOR_DL => EXT_GENERATOR_SRC do
- cd EXT_ROOT_DIR do
- myruby 'extconf_generator.rb'
+ cd EXT_GENERATOR_DIR do
+ myruby 'extconf.rb'
sh MAKE
end
+ cp "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
end
desc "Generate parser with ragel"
@@ -94,7 +98,7 @@ task :ragel_clean do
end
file EXT_PARSER_SRC => RAGEL_PATH do
- cd EXT_ROOT_DIR do
+ cd EXT_PARSER_DIR do
if RAGEL_CODEGEN == 'ragel'
sh "ragel parser.rl -G2 -o parser.c"
else
@@ -215,7 +219,7 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension
s.files = PKG_FILES
- s.extensions = FileList['ext/**/extconf_*.rb']
+ s.extensions = FileList['ext/**/extconf.rb']
s.require_path = EXT_ROOT_DIR
s.require_paths << 'ext'
@@ -244,21 +248,19 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension
Rake::ExtensionTask.new do |ext|
ext.name = 'parser'
- ext.config_script = 'extconf_parser.rb'
ext.gem_spec = spec_ext
ext.cross_compile = true
ext.cross_platform = %w[i386-mswin32 i386-mingw32]
- ext.ext_dir = 'ext/json/ext'
+ ext.ext_dir = 'ext/json/ext/parser'
ext.lib_dir = 'lib/json/ext'
end
Rake::ExtensionTask.new do |ext|
ext.name = 'generator'
- ext.config_script = 'extconf_generator.rb'
ext.gem_spec = spec_ext
ext.cross_compile = true
ext.cross_platform = %w[i386-mswin32 i386-mingw32]
- ext.ext_dir = 'ext/json/ext'
+ ext.ext_dir = 'ext/json/ext/generator'
ext.lib_dir = 'lib/json/ext'
end
end
diff --git a/ext/json/ext/extconf_generator.rb b/ext/json/ext/generator/extconf.rb
index 38f678d..b0eab0d 100644
--- a/ext/json/ext/extconf_generator.rb
+++ b/ext/json/ext/generator/extconf.rb
@@ -13,4 +13,4 @@ end
have_header("ruby/re.h") || have_header("re.h")
have_header("ruby/encoding.h")
-create_makefile 'generator'
+create_makefile 'json/ext/generator'
diff --git a/ext/json/ext/generator.c b/ext/json/ext/generator/generator.c
index b398cac..b398cac 100644
--- a/ext/json/ext/generator.c
+++ b/ext/json/ext/generator/generator.c
diff --git a/ext/json/ext/generator.h b/ext/json/ext/generator/generator.h
index 37240a9..37240a9 100644
--- a/ext/json/ext/generator.h
+++ b/ext/json/ext/generator/generator.h
diff --git a/ext/json/ext/extconf_parser.rb b/ext/json/ext/parser/extconf.rb
index 786a831..f61fc94 100644
--- a/ext/json/ext/extconf_parser.rb
+++ b/ext/json/ext/parser/extconf.rb
@@ -12,4 +12,4 @@ if CONFIG['CC'] =~ /gcc/
end
have_header("re.h")
-create_makefile 'parser'
+create_makefile 'json/ext/parser'
diff --git a/ext/json/ext/parser.c b/ext/json/ext/parser/parser.c
index 1d639d2..1d639d2 100644
--- a/ext/json/ext/parser.c
+++ b/ext/json/ext/parser/parser.c
diff --git a/ext/json/ext/parser.h b/ext/json/ext/parser/parser.h
index 688ffda..688ffda 100644
--- a/ext/json/ext/parser.h
+++ b/ext/json/ext/parser/parser.h
diff --git a/ext/json/ext/parser.rl b/ext/json/ext/parser/parser.rl
index dd07485..dd07485 100644
--- a/ext/json/ext/parser.rl
+++ b/ext/json/ext/parser/parser.rl