libxml-ruby 2.7.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +6 -14
  2. data/HISTORY +33 -11
  3. data/README.rdoc +7 -7
  4. data/Rakefile +80 -77
  5. data/ext/libxml/extconf.h +4 -5
  6. data/ext/libxml/extconf.rb +57 -118
  7. data/ext/libxml/libxml.c +4 -0
  8. data/ext/libxml/ruby_xml.c +977 -893
  9. data/ext/libxml/ruby_xml.h +20 -10
  10. data/ext/libxml/ruby_xml_attr.c +333 -333
  11. data/ext/libxml/ruby_xml_attr_decl.c +2 -2
  12. data/ext/libxml/ruby_xml_cbg.c +85 -85
  13. data/ext/libxml/ruby_xml_document.c +1133 -1147
  14. data/ext/libxml/ruby_xml_dtd.c +261 -268
  15. data/ext/libxml/ruby_xml_encoding.c +262 -260
  16. data/ext/libxml/ruby_xml_encoding.h +19 -19
  17. data/ext/libxml/ruby_xml_html_parser_context.c +337 -338
  18. data/ext/libxml/ruby_xml_input_cbg.c +191 -191
  19. data/ext/libxml/ruby_xml_io.c +52 -50
  20. data/ext/libxml/ruby_xml_namespace.c +2 -2
  21. data/ext/libxml/ruby_xml_node.c +1446 -1452
  22. data/ext/libxml/ruby_xml_parser_context.c +999 -1001
  23. data/ext/libxml/ruby_xml_reader.c +1226 -1228
  24. data/ext/libxml/ruby_xml_relaxng.c +110 -111
  25. data/ext/libxml/ruby_xml_sax2_handler.c +326 -328
  26. data/ext/libxml/ruby_xml_schema.c +300 -301
  27. data/ext/libxml/ruby_xml_version.h +3 -3
  28. data/ext/libxml/ruby_xml_writer.c +34 -16
  29. data/ext/libxml/ruby_xml_xpath.c +188 -187
  30. data/ext/libxml/ruby_xml_xpath_context.c +360 -361
  31. data/ext/libxml/ruby_xml_xpath_object.c +335 -335
  32. data/libxml-ruby.gemspec +47 -44
  33. data/test/tc_attr.rb +5 -7
  34. data/test/tc_attr_decl.rb +5 -6
  35. data/test/tc_attributes.rb +1 -2
  36. data/test/tc_canonicalize.rb +1 -2
  37. data/test/tc_deprecated_require.rb +1 -2
  38. data/test/tc_document.rb +4 -5
  39. data/test/tc_document_write.rb +2 -3
  40. data/test/tc_dtd.rb +4 -5
  41. data/test/tc_encoding.rb +126 -126
  42. data/test/tc_encoding_sax.rb +4 -3
  43. data/test/tc_error.rb +14 -15
  44. data/test/tc_html_parser.rb +15 -7
  45. data/test/tc_html_parser_context.rb +1 -2
  46. data/test/tc_namespace.rb +2 -3
  47. data/test/tc_namespaces.rb +5 -6
  48. data/test/tc_node.rb +2 -3
  49. data/test/tc_node_cdata.rb +2 -3
  50. data/test/tc_node_comment.rb +1 -2
  51. data/test/tc_node_copy.rb +1 -2
  52. data/test/tc_node_edit.rb +5 -7
  53. data/test/tc_node_pi.rb +1 -2
  54. data/test/tc_node_text.rb +2 -3
  55. data/test/tc_node_write.rb +2 -3
  56. data/test/tc_node_xlink.rb +1 -2
  57. data/test/tc_parser.rb +18 -24
  58. data/test/tc_parser_context.rb +6 -7
  59. data/test/tc_properties.rb +1 -2
  60. data/test/tc_reader.rb +9 -10
  61. data/test/tc_relaxng.rb +4 -5
  62. data/test/tc_sax_parser.rb +9 -10
  63. data/test/tc_schema.rb +4 -5
  64. data/test/tc_traversal.rb +1 -2
  65. data/test/tc_writer.rb +1 -2
  66. data/test/tc_xinclude.rb +1 -2
  67. data/test/tc_xml.rb +1 -2
  68. data/test/tc_xpath.rb +8 -9
  69. data/test/tc_xpath_context.rb +3 -4
  70. data/test/tc_xpath_expression.rb +3 -4
  71. data/test/tc_xpointer.rb +1 -3
  72. data/test/test_helper.rb +3 -1
  73. data/test/test_suite.rb +0 -1
  74. metadata +90 -72
  75. data/test/etc_doc_to_s.rb +0 -21
  76. data/test/ets_doc_file.rb +0 -17
  77. data/test/ets_doc_to_s.rb +0 -23
  78. data/test/ets_gpx.rb +0 -28
  79. data/test/ets_node_gc.rb +0 -23
  80. data/test/ets_test.xml +0 -2
  81. data/test/ets_tsr.rb +0 -11
  82. data/test/model/kml_sample.xml +0 -915
  83. data/test/remove_test.rb +0 -9
  84. data/test/tc_gc.rb +0 -86
  85. data/test/tc_parser.rb.orig +0 -384
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWI3MjQyNWIwYzA5YWMxZmE4MjlhN2FjOGVmZTM2MDZkNWVmOTZlYg==
5
- data.tar.gz: !binary |-
6
- YzdhYzE3MmVjMWM2YmZiYWRiOGZhMzQ1NjMyODdmMDI1YmIyOTM0Nw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- N2NiZTI5YmRkY2IzODEyZGNiYjAxZGExOWY2MTRhZGIxYTQ0MTcwNzlhZjE5
10
- NjRlMGM1NzVjOTAxOTNlNjIwODIxNmNiZTlhZTVjNGQ2NDYzZDQ5Mzg3YmZm
11
- MDZlNjViNDBiMTY4ZDgzZjc1MGEyYTczM2E0MDkxZDdmOTA3MDU=
12
- data.tar.gz: !binary |-
13
- NDQ2MDNiZjRiZDg1YTg2Yjc0YjA0NzU5M2EwNzNhNTJmN2QyMzIzZDU3MWY2
14
- OThmZmRiZTFmZWRmYmRjN2U2OTlmZTliZDljMjEzMWM0MDhjNmU2OWI3MTMy
15
- YWZkZDM5NTI5MGExZGZjYjUyZDM4NDcyMGRmNjQxOTZhMDA5NmU=
2
+ SHA1:
3
+ metadata.gz: 19bae1f5824f98a959ddf6f19674ac0f2a750388
4
+ data.tar.gz: 8a2003b0eed642100d6520306a3cf609b739b2a7
5
+ SHA512:
6
+ metadata.gz: 730aeb8b63e92c5b362853b34df0e0cd84b502d5425f29a55722f74ddb1e98eabdc29f53d66bf5434460d96fe415e3e03c52aa3f3a024fb358f6b9d16bc7576e
7
+ data.tar.gz: a1585ebfe236cfa867b2a936836fb828783fe6d839d2ab03f45bd8ecaa77abec080a5e6480ce5357674de4803888fa0257db27b30d50fe3f9a3951f504ad14a9
data/HISTORY CHANGED
@@ -1,18 +1,40 @@
1
1
  = Release History
2
2
 
3
- == 2.7.0 / 2013-08-03 Charlie Savage
4
-
5
- * Do not call Ruby code during a GC cycle (Dirkjan Bussink)
6
- * Fix thread error handling (Geoffrey Giesemann)
3
+ == 2.9.0 / 2016-06-13 Charlie Savage
4
+
5
+ * Revamp libxml-ruby's memory management to not cause crashes when used with Nokogiri (James Laird-Wah)
6
+ * Fix garbage collection issue that sometimes caused the library to hang (Charlie Savage)
7
+ * Improved multi-threading support (Charlie Savage)
8
+ * Fix crash sometimes caused by a xml node being being freed twice (Charlie Savage)
9
+ * Fix memory leak when setting the text content of a node (Charlie Savage)
10
+ * Set a default task in the Rakefile - use "test" (Robert Haines)
11
+ * Add "hanna_gudao" gem and add "rake-compiler" to develpoment dependencies (Robert Haines)
12
+ * Use Process.getrlimit instead of `ulimit` in the tests (Robert Haines)
13
+ * Build on smartos (Steven Williamson)
14
+ * Fix compiler warnings (Charlie Savage)
15
+ * Add Xcode project for easier debugging on OSX (Charlie Savage)
16
+ * Switch from unit test to minitest (Charlie Savage)
17
+
18
+ == 2.8.0 / 2015-01-09 Charlie Savage
19
+
20
+ * Use RbConfig instead of Config in extconf.rb (Robert Haines)
21
+ * Correct xpath documentation XML (Bill Mill)
22
+ * Correct from_string method documentation (Bill Mill)
23
+ * Fix compile error with debug not enabled in libxml (Patrick Ziegler)
24
+ * Update gemspec to include license (Charlie Savage)
25
+ * In XML::Writer prevent writing to io while being GCed (Brett Gibson)
26
+
27
+ == 2.7.0 / 2013-08-13 Charlie Savage
28
+
29
+ * Don't call rb_warning in GC mark function (Dirkjan Bussink)
7
30
  * Set libxml error handler when a libxml-ruby error handler is set (Geoffrey Giesemann)
8
- * Fix tests for nil TypeErrors (Geoffrey Giesemann)
9
- * Fix segmentation fault for issue #62. The deregisternode function was incorrectly
10
- NULLing out a node's mark and free functions for nodes removed from a document tree (Charlie Savage)
11
- * Cleanup writer code (Charlie Savage)
12
- * Fix equality check of LibXML::XML::Error against other objects (Michał Szajbe)
13
- * Fix XML::Writer.set_quote_char UT, wrong expected string (#63). (julp)
31
+ * Fix tests for nil TypeErrors for ruby 2.0=< (Geoffrey Giesemann)
32
+ * Fix segmentation fault for issue #62 (Charlie Savage)
33
+ * Add #node_type method to dtd (Charlie Savage)
34
+ * Fixing equality check of LibXML::XML::Error against other objects (Michał Szajbe)
35
+ * Fix #63, XML::Writer.set_quote_char UT, wrong expected string (julp)
14
36
  * Fix potential segfault when GC occurs while creating ns from xpath (Timothy Elliott)
15
- * Fix segmentation fault after failing to load external schema (#59). (Clifford Heath)
37
+ * Fix for #59, segmentation fault after failure to load external schema (Clifford Heath)
16
38
 
17
39
  == 2.6.0 / 2013-02-16 Charlie Savage
18
40
 
data/README.rdoc CHANGED
@@ -31,8 +31,8 @@ The easiest way to install libxml-ruby is via Ruby Gems. To install:
31
31
 
32
32
  If you are running Windows, make sure to install the Win32 RubyGem
33
33
  which includes prebuilt extensions for Ruby 1.8, 1.9 and 2.0 preview. These
34
- extensions are built with MinGW32 against libxml2 version 2.9.0,
35
- iconv version 1.13 and zlib version 1.2.5. Note these binaries
34
+ extensions are built using MinGW64 and libxml2 version 2.9.3,
35
+ iconv version 1.14 and zlib version 1.2.8. Note these binaries
36
36
  are available in the lib\libs directory. To use them, put them
37
37
  someplace on your path.
38
38
 
@@ -114,8 +114,8 @@ For simplicity's sake, the documentation uses the xml module in its examples.
114
114
 
115
115
  == Memory Management
116
116
  libxml-ruby automatically manages memory associated with the
117
- underlying libxml2 library. There is however one corner case that
118
- your code must handle. If a node is imported into a document, but not
117
+ underlying libxml2 library. There is however one corner case that
118
+ your code must handle. If a node is imported into a document, but not
119
119
  added to the document, a segmentation fault may occur on program termination.
120
120
 
121
121
  # Do NOT do this
@@ -124,8 +124,8 @@ added to the document, a segmentation fault may occur on program termination.
124
124
  doc2 = XML::Document.string("test2")
125
125
  node = doc2.import(doc1.root)
126
126
 
127
- If doc2 is freed before node2 a segmentatin fault will occur since
128
- node2 references the document. To avoid this, simply make sure to add the
127
+ If doc2 is freed before the node a segmentation fault will occur since
128
+ the node references the document. To avoid this, simply make sure to add the
129
129
  node to the document:
130
130
 
131
131
  # DO this instead
@@ -133,7 +133,7 @@ node to the document:
133
133
  doc2 = XML::Document.string("test2")
134
134
  doc2.root << doc2.import(doc1.root)
135
135
 
136
- Alternatively, you can call node2.remove! to disassociate node2 from doc2.
136
+ Alternatively, you can call node.remove! to disassociate the node from doc2.
137
137
 
138
138
  == Threading
139
139
  libxml-ruby fully supports native, background Ruby threads. This of course
data/Rakefile CHANGED
@@ -1,78 +1,81 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "rubygems"
4
- require "rake/extensiontask"
5
- require "rake/testtask"
6
- require "rubygems/package_task"
7
- require "rdoc/task"
8
- require "yaml"
9
-
10
- GEM_NAME = "libxml-ruby"
11
- SO_NAME = "libxml_ruby"
12
-
13
- # Read the spec file
14
- spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
15
-
16
- # Setup compile tasks
17
- Rake::ExtensionTask.new do |ext|
18
- ext.gem_spec = spec
19
- ext.name = SO_NAME
20
- ext.ext_dir = "ext/libxml"
21
- ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
22
- ext.config_options << "--with-xml2-include=C:/MinGW/local/include/libxml2"
23
- ext.config_options << "--with-zlib-dir=C:/MinGW/local"
24
- end
25
-
26
- # Setup generic gem
27
- Gem::PackageTask.new(spec) do |pkg|
28
- pkg.package_dir = 'pkg'
29
- pkg.need_tar = false
30
- end
31
-
32
- # Setup Windows Gem
33
- if RUBY_PLATFORM.match(/win32|mingw32/)
34
- binaries = (FileList['lib/**/*.so',
35
- 'lib/**/*dll'])
36
-
37
- # Windows specification
38
- win_spec = spec.clone
39
- win_spec.platform = Gem::Platform::CURRENT
40
- win_spec.files += binaries.to_a
41
- win_spec.instance_variable_set(:@cache_file, nil)
42
-
43
- # Unset extensions
44
- win_spec.extensions = nil
45
-
46
- # Rake task to build the windows package
47
- Gem::PackageTask.new(win_spec) do |pkg|
48
- pkg.package_dir = 'pkg'
49
- pkg.need_tar = false
50
- end
51
- end
52
-
53
- # RDoc Task
54
- desc "Generate rdoc documentation"
55
- RDoc::Task.new("rdoc") do |rdoc|
56
- rdoc.rdoc_dir = 'website/_site/rdoc'
57
- rdoc.title = "LibXML"
58
- # Show source inline with line numbers
59
- rdoc.options << "--line-numbers"
60
- rdoc.options << "--charset=utf-8"
61
- rdoc.options << "--format=hanna"
62
- # Make the readme file the start page for the generated html
63
- rdoc.main = 'README.rdoc'
64
- rdoc.rdoc_files.include('doc/*.rdoc',
65
- 'ext/**/libxml.c',
66
- 'ext/**/ruby_xml.c',
67
- 'ext/**/*.c',
68
- 'lib/**/*.rb',
69
- 'README.rdoc',
70
- 'HISTORY',
71
- 'LICENSE')
72
- end
73
-
74
- # Test Task
75
- Rake::TestTask.new do |t|
76
- t.libs << "test"
77
- t.verbose = true
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "rake/extensiontask"
5
+ require "rake/testtask"
6
+ require "rubygems/package_task"
7
+ require "rdoc/task"
8
+ require "yaml"
9
+
10
+ GEM_NAME = "libxml-ruby"
11
+ SO_NAME = "libxml_ruby"
12
+
13
+ # Read the spec file
14
+ spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
15
+
16
+ task :default => [:test]
17
+
18
+ # Setup compile tasks
19
+ Rake::ExtensionTask.new do |ext|
20
+ ext.gem_spec = spec
21
+ ext.name = SO_NAME
22
+ ext.ext_dir = "ext/libxml"
23
+ ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
24
+ ext.config_options << "--with-xml2-include=C:/msys64/mingw64/include/libxml2"
25
+ ext.config_options << "--with-zlib-dir=C:/msys64/mingw64"
26
+ end
27
+
28
+ # Setup generic gem
29
+ Gem::PackageTask.new(spec) do |pkg|
30
+ pkg.package_dir = 'pkg'
31
+ pkg.need_tar = false
32
+ end
33
+
34
+ # Setup Windows Gem
35
+ if RUBY_PLATFORM.match(/win32|mingw32/)
36
+ binaries = (FileList['lib/**/*.so',
37
+ 'lib/**/*dll'])
38
+
39
+ # Windows specification
40
+ win_spec = spec.clone
41
+ win_spec.platform = Gem::Platform::CURRENT
42
+ win_spec.files += binaries.to_a
43
+ win_spec.instance_variable_set(:@cache_file, nil)
44
+
45
+ # Unset extensions
46
+ win_spec.extensions = nil
47
+
48
+ # Rake task to build the windows package
49
+ Gem::PackageTask.new(win_spec) do |pkg|
50
+ pkg.package_dir = 'pkg'
51
+ pkg.need_tar = false
52
+ end
53
+ end
54
+
55
+ # RDoc Task
56
+ desc 'Generate rdoc documentation'
57
+ RDoc::Task.new("rdoc") do |rdoc|
58
+ rdoc.rdoc_dir = 'website/_site/rdoc'
59
+ rdoc.title = 'LibXML'
60
+ rdoc.generator = 'hanna'
61
+
62
+ # Show source inline with line numbers
63
+ rdoc.options << '--line-numbers'
64
+ rdoc.options << '--charset=utf-8'
65
+ # Make the readme file the start page for the generated html
66
+ rdoc.main = 'README.rdoc'
67
+ rdoc.rdoc_files.include('doc/*.rdoc',
68
+ 'ext/**/libxml.c',
69
+ 'ext/**/ruby_xml.c',
70
+ 'ext/**/*.c',
71
+ 'lib/**/*.rb',
72
+ 'README.rdoc',
73
+ 'HISTORY',
74
+ 'LICENSE')
75
+ end
76
+
77
+ # Test Task
78
+ Rake::TestTask.new do |t|
79
+ t.libs << "test"
80
+ t.verbose = true
78
81
  end
data/ext/libxml/extconf.h CHANGED
@@ -1,5 +1,4 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #define HAVE_ZLIB_H 1
4
- #define HAVE_LIBXML_XMLVERSION_H 1
5
- #endif
1
+ #ifndef EXTCONF_H
2
+ #define EXTCONF_H
3
+ #define HAVE_RB_IO_BUFWRITE 1
4
+ #endif
@@ -1,118 +1,57 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rbconfig'
4
-
5
- require 'mkmf'
6
-
7
- #if defined?(CFLAGS)
8
- # if CFLAGS.index(CONFIG['CCDLFLAGS'])
9
- # $CFLAGS = CFLAGS + ' ' + CONFIG['CCDLFLAGS']
10
- # else
11
- # $CFLAGS = CFLAGS
12
- # end
13
- #else
14
- # $CFLAGS = CONFIG['CFLAGS']
15
- #end
16
- #$LDFLAGS = CONFIG['LDFLAGS']
17
- #$LDFLAGS = "-L/usr/local/lib"
18
- #$LIBPATH.push(Config::CONFIG['libdir'])
19
- $LDFLAGS = "-Lc:/mingw/local/lib"
20
-
21
- def crash(str)
22
- printf(" extconf failure: %s\n", str)
23
- exit 1
24
- end
25
-
26
- dir_config('iconv')
27
- dir_config('zlib')
28
-
29
- have_library('socket','socket')
30
- have_library('nsl','gethostbyname')
31
-
32
- unless have_library('m', 'atan')
33
- # try again for gcc 4.0
34
- saveflags = $CFLAGS
35
- $CFLAGS += ' -fno-builtin'
36
- unless have_library('m', 'atan')
37
- crash('need libm')
38
- end
39
- $CFLAGS = saveflags
40
- end
41
-
42
- unless have_library('z', 'inflate') or
43
- have_library('zlib', 'inflate') or
44
- have_library('zlib1', 'inflate') or
45
- have_library('libz', 'inflate')
46
- crash('need zlib')
47
- else
48
- $defs.push('-DHAVE_ZLIB_H')
49
- end
50
-
51
- unless have_library('iconv','iconv_open') or
52
- have_library('iconv','libiconv_open') or
53
- have_library('libiconv', 'libiconv_open') or
54
- have_library('libiconv', 'iconv_open') or
55
- have_library('c','iconv_open') or
56
- have_library('recode','iconv_open') or
57
- have_library('iconv')
58
- crash(<<EOL)
59
- need libiconv.
60
-
61
- Install the libiconv or try passing one of the following options
62
- to extconf.rb:
63
-
64
- --with-iconv-dir=/path/to/iconv
65
- --with-iconv-lib=/path/to/iconv/lib
66
- --with-iconv-include=/path/to/iconv/include
67
- EOL
68
- end
69
-
70
- if (xc = with_config('xml2-config')) or RUBY_PLATFORM.match(/darwin/i) then
71
- xc = 'xml2-config' if xc == true or xc.nil?
72
- cflags = `#{xc} --cflags`.chomp
73
- if $? != 0
74
- cflags = nil
75
- else
76
- libs = `#{xc} --libs`.chomp
77
- if $? != 0
78
- libs = nil
79
- else
80
- $CFLAGS += ' ' + cflags
81
- $libs = libs + " " + $libs
82
- end
83
- end
84
- else
85
- dir_config('xml2')
86
- end
87
-
88
- unless (have_library('xml2', 'xmlParseDoc') or
89
- have_library('libxml2', 'xmlParseDoc') or
90
- find_library('xml2', 'xmlParseDoc', '/opt/lib', '/usr/local/lib', '/usr/lib')) and
91
- (have_header('libxml/xmlversion.h') or
92
- find_header('libxml/xmlversion.h',
93
- '/opt/include/libxml2',
94
- '/usr/local/include/libxml2',
95
- '/usr/include/libxml2'))
96
- crash(<<EOL)
97
- need libxml2.
98
-
99
- Install the library or try one of the following options to extconf.rb:
100
-
101
- --with-xml2-config=/path/to/xml2-config
102
- --with-xml2-dir=/path/to/libxml2
103
- --with-xml2-lib=/path/to/libxml2/lib
104
- --with-xml2-include=/path/to/libxml2/include
105
- EOL
106
- end
107
-
108
- have_func('rb_io_bufwrite', 'ruby/io.h')
109
-
110
- # For FreeBSD add /usr/local/include
111
- $INCFLAGS << " -I/usr/local/include"
112
-
113
- $CFLAGS << ' ' << $INCFLAGS
114
-
115
- #$INSTALLFILES = [["libxml.rb", "$(RUBYLIBDIR)", "../xml"]]
116
-
117
- create_header()
118
- create_makefile('libxml_ruby')
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mkmf'
4
+
5
+ def crash(str)
6
+ printf(" extconf failure: %s\n", str)
7
+ exit 1
8
+ end
9
+
10
+ xc = with_config('xml2-config')
11
+ if xc
12
+ cflags = `#{xc} --cflags`.chomp
13
+ if $? != 0
14
+ cflags = nil
15
+ else
16
+ libs = `#{xc} --libs`.chomp
17
+ if $? != 0
18
+ libs = nil
19
+ else
20
+ $CFLAGS += ' ' + cflags
21
+ $libs = libs + " " + $libs
22
+ end
23
+ end
24
+ else
25
+ dir_config('xml2')
26
+ end
27
+
28
+ unless find_header('libxml/xmlversion.h',
29
+ '/opt/include/libxml2',
30
+ '/opt/local/include/libxml2',
31
+ '/usr/local/include/libxml2',
32
+ '/usr/include/libxml2') &&
33
+ find_library('xml2', 'xmlParseDoc',
34
+ '/opt/lib',
35
+ '/opt/local/lib',
36
+ '/usr/local/lib',
37
+ '/usr/lib')
38
+ crash(<<EOL)
39
+ need libxml2.
40
+
41
+ Install the library or try one of the following options to extconf.rb:
42
+
43
+ --with-xml2-config=/path/to/xml2-config
44
+ --with-xml2-dir=/path/to/libxml2
45
+ --with-xml2-lib=/path/to/libxml2/lib
46
+ --with-xml2-include=/path/to/libxml2/include
47
+ EOL
48
+ end
49
+
50
+ have_func('rb_io_bufwrite', 'ruby/io.h')
51
+
52
+ # For FreeBSD add /usr/local/include
53
+ $INCFLAGS << " -I/usr/local/include"
54
+ $CFLAGS << ' ' << $INCFLAGS
55
+
56
+ create_header()
57
+ create_makefile('libxml_ruby')
data/ext/libxml/libxml.c CHANGED
@@ -39,6 +39,10 @@ void Init_libxml_ruby(void)
39
39
  * Refer to the README file to get started and the LICENSE file for
40
40
  * copyright and distribution information.
41
41
  */
42
+
43
+ // Seutp for threading. http://xmlsoft.org/threads.html
44
+ xmlInitParser();
45
+
42
46
  mLibXML = rb_define_module("LibXML");
43
47
 
44
48
  rxml_init_memory();