rmultimarkdown 4.7.1.1 → 6.2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +2 -2
  3. data/README.md +7 -9
  4. data/Rakefile +33 -18
  5. data/ext/Makefile +261 -0
  6. data/ext/extconf.rb +23 -3
  7. data/ext/mmd/aho-corasick.c +596 -0
  8. data/ext/mmd/aho-corasick.h +120 -0
  9. data/ext/mmd/beamer.c +344 -0
  10. data/ext/mmd/beamer.h +72 -0
  11. data/ext/mmd/char.c +156 -0
  12. data/ext/mmd/char.h +111 -0
  13. data/ext/mmd/char_lookup.c +212 -0
  14. data/ext/mmd/critic_markup.c +330 -0
  15. data/ext/mmd/critic_markup.h +94 -0
  16. data/ext/mmd/d_string.c +402 -0
  17. data/ext/mmd/epub.c +563 -0
  18. data/ext/mmd/epub.h +69 -0
  19. data/ext/mmd/fodt.c +2288 -0
  20. data/ext/mmd/fodt.h +81 -0
  21. data/ext/mmd/html.c +2460 -0
  22. data/ext/mmd/html.h +81 -0
  23. data/ext/mmd/i18n.h +170 -0
  24. data/ext/mmd/include/d_string.h +182 -0
  25. data/ext/mmd/include/libMultiMarkdown.h +548 -0
  26. data/ext/mmd/include/token.h +233 -0
  27. data/ext/mmd/latex.c +2435 -0
  28. data/ext/mmd/latex.h +83 -0
  29. data/ext/mmd/lexer.c +3001 -0
  30. data/ext/mmd/lexer.h +75 -0
  31. data/ext/mmd/memoir.c +138 -0
  32. data/ext/mmd/memoir.h +67 -0
  33. data/ext/mmd/miniz.c +7557 -0
  34. data/ext/mmd/miniz.h +1328 -0
  35. data/ext/mmd/mmd.c +2798 -0
  36. data/ext/mmd/mmd.h +120 -0
  37. data/ext/mmd/object_pool.c +141 -0
  38. data/ext/mmd/object_pool.h +101 -0
  39. data/ext/mmd/opendocument-content.c +2071 -0
  40. data/ext/mmd/opendocument-content.h +135 -0
  41. data/ext/mmd/opendocument.c +981 -0
  42. data/ext/mmd/opendocument.h +118 -0
  43. data/ext/mmd/parser.c +1760 -0
  44. data/ext/mmd/parser.h +39 -0
  45. data/{MultiMarkdown-4 → ext/mmd}/rng.c +90 -49
  46. data/ext/mmd/scanners.c +77512 -0
  47. data/ext/mmd/scanners.h +101 -0
  48. data/ext/mmd/stack.c +142 -0
  49. data/ext/mmd/stack.h +113 -0
  50. data/ext/mmd/textbundle.c +455 -0
  51. data/ext/mmd/textbundle.h +115 -0
  52. data/ext/mmd/token.c +773 -0
  53. data/ext/mmd/token_pairs.c +263 -0
  54. data/ext/mmd/token_pairs.h +123 -0
  55. data/ext/mmd/transclude.c +549 -0
  56. data/ext/mmd/transclude.h +87 -0
  57. data/ext/mmd/uthash.h +1074 -0
  58. data/ext/mmd/uuid.c +154 -0
  59. data/ext/mmd/uuid.h +77 -0
  60. data/ext/mmd/version.h +111 -0
  61. data/ext/mmd/writer.c +2652 -0
  62. data/ext/mmd/writer.h +260 -0
  63. data/ext/mmd/zip.c +210 -0
  64. data/ext/mmd/zip.h +120 -0
  65. data/ext/{multi_markdown.c → ruby_multi_markdown.c} +87 -18
  66. data/lib/multi_markdown.bundle +0 -0
  67. data/lib/multi_markdown.rb +5 -8
  68. data/lib/multi_markdown/version.rb +1 -1
  69. data/rmultimarkdown.gemspec +2 -2
  70. data/test/{extensions_test.rb.rb → extensions_test.rb} +10 -54
  71. data/test/multi_markdown_test.rb +13 -0
  72. metadata +67 -47
  73. data/MultiMarkdown-4/GLibFacade.c +0 -310
  74. data/MultiMarkdown-4/GLibFacade.h +0 -100
  75. data/MultiMarkdown-4/beamer.c +0 -182
  76. data/MultiMarkdown-4/beamer.h +0 -11
  77. data/MultiMarkdown-4/critic.c +0 -111
  78. data/MultiMarkdown-4/critic.h +0 -15
  79. data/MultiMarkdown-4/glib.h +0 -11
  80. data/MultiMarkdown-4/html.c +0 -1117
  81. data/MultiMarkdown-4/html.h +0 -14
  82. data/MultiMarkdown-4/latex.c +0 -1217
  83. data/MultiMarkdown-4/latex.h +0 -16
  84. data/MultiMarkdown-4/libMultiMarkdown.h +0 -177
  85. data/MultiMarkdown-4/lyx.c +0 -2265
  86. data/MultiMarkdown-4/lyx.h +0 -37
  87. data/MultiMarkdown-4/lyxbeamer.c +0 -265
  88. data/MultiMarkdown-4/lyxbeamer.h +0 -11
  89. data/MultiMarkdown-4/memoir.c +0 -80
  90. data/MultiMarkdown-4/memoir.h +0 -10
  91. data/MultiMarkdown-4/multimarkdown.c +0 -518
  92. data/MultiMarkdown-4/odf.c +0 -1222
  93. data/MultiMarkdown-4/odf.h +0 -18
  94. data/MultiMarkdown-4/opml.c +0 -189
  95. data/MultiMarkdown-4/opml.h +0 -15
  96. data/MultiMarkdown-4/parse_utilities.c +0 -884
  97. data/MultiMarkdown-4/parser.c +0 -16656
  98. data/MultiMarkdown-4/parser.h +0 -188
  99. data/MultiMarkdown-4/rtf.c +0 -665
  100. data/MultiMarkdown-4/rtf.h +0 -17
  101. data/MultiMarkdown-4/strtok.c +0 -56
  102. data/MultiMarkdown-4/strtok.h +0 -9
  103. data/MultiMarkdown-4/text.c +0 -53
  104. data/MultiMarkdown-4/text.h +0 -11
  105. data/MultiMarkdown-4/toc.c +0 -142
  106. data/MultiMarkdown-4/toc.h +0 -15
  107. data/MultiMarkdown-4/transclude.c +0 -307
  108. data/MultiMarkdown-4/transclude.h +0 -28
  109. data/MultiMarkdown-4/writer.c +0 -731
  110. data/MultiMarkdown-4/writer.h +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1b19590bcff9ad60da3dde0a2a6a3545674dfd6
4
- data.tar.gz: 943d6865fc1717b107f944d6c75348be8e889eb7
3
+ metadata.gz: 4f0aaf2e4578f029b57651048a9fe007addc2b7e
4
+ data.tar.gz: 533529a83e637367139cd68245606400262d0296
5
5
  SHA512:
6
- metadata.gz: 0117f11e8a4a5bae57dcb8c892e36fdefd1df3dc14172bf6ca4bbc1dd171ec9528fb18cd9cf433d6b0fc2622266f2b87849f0e807f54a5e821a2e325730caae1
7
- data.tar.gz: 87ece7d7735e5a48ac052e3e0cb509c1ac57a9159fef06be215c4eff4f0f0a3412f136ac769797034146e82fe99c154d6d1740cb15e9dc80ca02346d16369047
6
+ metadata.gz: 615409a10996e6a2720369e7b301cc07e24832b974944d73e899639c5cfb7c212aff6bcfd49247b1cf3625269e13f212e2142acd4f0c8d4a6f92e27c978a2e18
7
+ data.tar.gz: b0a4b8f9e386eb5d9c0fe6581e27a5a1642c54a38462cb0ebc3dacb358ac7fab7892dca4330d7627c50b333458072844a3272e6464a5568b1f3ce2e6ca31470c
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- MultiMarkdown-4 in C
1
+ MultiMarkdown-6 in C
2
2
  Copyright (c) 2010-2013 Fletcher T. Penney
3
3
  Ruby Markdown Extension (rpeg-markdown) used as template for this gem
4
4
  Copyright (c) 2008 Ryan Tomayko
@@ -7,7 +7,7 @@ Copyright (c) 2009 Oliver ? (https://github.com/djungelvral)
7
7
  Micro-optparse (included in bin/rmultimarkdown)
8
8
  Copyright (c) 2011 Florian Pilz
9
9
 
10
- Both multi_markdown and MultiMarkdown-4 are released under both the GPL
10
+ Both multi_markdown and MultiMarkdown-6 are released under both the GPL
11
11
  and MIT licenses. You may pick the license that best fits your needs.
12
12
 
13
13
  Micro-optparse is released under the MIT license.
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- Ruby MultiMarkdown 4
1
+ Ruby MultiMarkdown 6
2
2
  ====================
3
3
 
4
4
  [![Build Status](https://travis-ci.org/tillsc/multi_markdown.png?branch=master)](https://travis-ci.org/tillsc/multi_markdown)
5
5
 
6
6
  An extension library around
7
- [Fletcher Penney's MultiMarkdown](http://github.com/fletcher/MultiMarkdown-4/)
7
+ [Fletcher Penney's MultiMarkdown](http://github.com/fletcher/MultiMarkdown-6/)
8
8
  library in C. It is based upon the ruby
9
9
  [rpeg-markdown](https://github.com/rtomayko/rpeg-markdown/) and
10
10
  [rpeg-multimarkdown](https://github.com/djungelvral/rpeg-multimarkdown) libraries by
@@ -32,7 +32,7 @@ Synopsis
32
32
  >> doc.metadata("Title")
33
33
  #=> "Some document"
34
34
 
35
- See [MultiMarkdown documentation](http://fletcher.github.io/MultiMarkdown-4/)
35
+ See [MultiMarkdown documentation](http://fletcher.github.io/MultiMarkdown-6/)
36
36
  and `MultiMarkdown`'s [RDoc](http://rubydoc.info/gems/multimarkdown) for further Details.
37
37
 
38
38
  Installation / Hacking
@@ -54,22 +54,20 @@ Hacking:
54
54
  $ git clone --recursive git://github.com/tillsc/multi_markdown.git
55
55
  $ cd multi_markdown
56
56
  $ bundle install
57
+ $ bundle exec rake MultiMarkdown-6:init
57
58
  $ bundle exec rake test
58
59
 
59
- Changes
60
+ Versioning
60
61
  -------
61
62
 
62
- **Beware**: The versioning scheme isn't based upon
63
+ **Beware**: The versioning scheme isn't based upon
63
64
  [Semantic Versioning](http://semver.org)! The first three version numbers are
64
65
  inherited from the underlying C library. Only the last number is used to indicate
65
66
  changes in the Ruby wrapper itself.
66
67
 
67
- * [Version 4.5.0.1](http://github.com/tillsc/multi_markdown/tree/v4.5.0.1):
68
- First Version based upon [rpeg-markdown](https://github.com/rtomayko/rpeg-markdown/)
69
- and [rpeg-multimarkdown](https://github.com/djungelvral/rpeg-multimarkdown).
70
68
 
71
69
  COPYING
72
70
  -------
73
71
 
74
- MultiMarkdown-4, multi_markdown are both licensed under the GPL and the MIT License.
72
+ MultiMarkdown-6, multi_markdown are both licensed under the GPL and the MIT License.
75
73
  See [LICENSE](LICENCSE) for more information.
data/Rakefile CHANGED
@@ -1,47 +1,66 @@
1
1
  require 'rake/clean'
2
2
  require 'rdoc/task'
3
3
  require 'bundler'
4
+ require 'fileutils'
4
5
 
5
6
  Bundler::GemHelper.install_tasks
6
7
 
7
8
  task :default => "test:unit"
8
9
 
10
+ task :release => ["MultiMarkdown-6:init", "test:unit"]
11
+
9
12
  # ***** Build
10
13
 
11
14
  DLEXT = RbConfig::CONFIG['DLEXT']
15
+ MMD_DIR = File.expand_path("../ext/mmd", __FILE__)
12
16
 
13
17
  # For Mac OS X -- prevents prevent additional ._* files being added to tarball
14
18
  ENV['COPYFILE_DISABLE'] = 'true'
15
19
 
16
- namespace "MultiMarkdown-4" do
20
+ namespace "MultiMarkdown-6" do
17
21
 
18
22
  desc "Initialize the submodule"
19
- task "init" => "generate_parser"
23
+ task "init" do
24
+ FileUtils.rm_rf(MMD_DIR)
25
+ chdir('MultiMarkdown-6') do
26
+ sh 'make' # creates build/version.h
27
+
28
+ # Copy all c and h files to MMD_DIR which will be released in the gem
29
+ ['Sources/libMultiMarkdown', 'build'].each do |dir|
30
+ chdir(dir) do
31
+ Dir.glob('{.,include}/*.{h,c}').each do |s|
32
+ next if s =~ /template/
33
+ dest = "#{MMD_DIR}/#{File.dirname(s)}"
34
+ FileUtils.mkdir_p(dest)
35
+ FileUtils.cp(s, dest)
36
+ end
37
+ end
38
+ end
39
+
40
+ # We have to disable the ObjectPool. see include/token.h
41
+ token_h_file = "#{MMD_DIR}/include/token.h"
42
+ IO.write(token_h_file, (File.open(token_h_file) { |f|
43
+ f.read.gsub(/#define kUseObjectPool/, "#define kUseObjectPoolDisabled")
44
+ }))
20
45
 
21
- desc "Generate needed parser files"
22
- task "generate_parser" do
23
- chdir('MultiMarkdown-4') do
24
- sh 'make parser.c'
25
46
  end
26
47
  end
27
48
 
28
49
  end
29
50
 
30
-
31
- file 'ext/Makefile' => ["MultiMarkdown-4:init"] + FileList['ext/{extconf.rb,*.c,*.h,*.rb}', 'MultiMarkdown-4/*.{c,h}'] do
51
+ file 'ext/Makefile' => FileList['ext/**/{extconf.rb,*.c,*.h,*.rb}'] do
32
52
  chdir('ext') do
33
53
  ruby 'extconf.rb'
34
54
  end
35
55
  end
36
56
  CLEAN.include 'ext/Makefile'
37
57
 
38
- file "ext/multi_markdown.#{DLEXT}" => FileList['ext/Makefile', 'ext/*.{c,h,rb}', 'MultiMarkdown-4/*.{c,h}'] do |f|
58
+ file "ext/multi_markdown.#{DLEXT}" => FileList['ext/Makefile', 'ext/**/*.{c,h,rb}'] do |f|
39
59
  chdir('ext') do
40
60
  sh 'make'
41
61
  end
42
62
  end
43
- CLEAN.include 'ext/*.{o,bundle,so}'
44
- CLEAN.include 'MultiMarkdown-4/*.o'
63
+ CLEAN.include 'ext/**/*.{o,bundle,so}'
45
64
 
46
65
  file "lib/multi_markdown.#{DLEXT}" => "ext/multi_markdown.#{DLEXT}" do |f|
47
66
  cp f.prerequisites, "lib/", :preserve => true
@@ -60,7 +79,7 @@ namespace :test do
60
79
 
61
80
  desc 'Run unit tests'
62
81
  task :unit => :build do |t|
63
- FileList['test/*.rb'].each do |f|
82
+ FileList['test/*_test.rb'].each do |f|
64
83
  ruby f
65
84
  end
66
85
  end
@@ -68,12 +87,8 @@ namespace :test do
68
87
  desc "Run conformance tests"
69
88
  task :conformance => :build do |t|
70
89
  script = "#{pwd}/bin/rmultimarkdown"
71
- chdir("MultiMarkdown-4/MarkdownTest") do
72
- sh "./MarkdownTest.pl --script='#{script}' --flags='-c' --tidy"
73
- sh "./MarkdownTest.pl --script='#{script}' --testdir='MultiMarkdownTests'"
74
- sh "./MarkdownTest.pl --script='#{script}' --testdir='MultiMarkdownTests' --flags='-t latex' --ext='.tex'"
75
- sh "./MarkdownTest.pl --script='#{script}' --testdir='BeamerTests' --flags='-t latex' --ext='.tex'"
76
- sh "./MarkdownTest.pl --script='#{script}' --testdir='MemoirTests' --flags='-t latex' --ext='.tex'"
90
+ chdir("MultiMarkdown-6/tests") do
91
+ sh "./MarkdownTest.pl --script='#{script}' --testdir='MMD6Tests'"
77
92
  end
78
93
  end
79
94
 
data/ext/Makefile ADDED
@@ -0,0 +1,261 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ Q1 = $(V:1=)
7
+ Q = $(Q1:0=@)
8
+ ECHO1 = $(V:1=@:)
9
+ ECHO = $(ECHO1:0=@echo)
10
+ NULLCMD = :
11
+
12
+ #### Start of system configuration section. ####
13
+
14
+ srcdir = .
15
+ topdir = /opt/rubies/ruby-2.3.1/include/ruby-2.3.0
16
+ hdrdir = $(topdir)
17
+ arch_hdrdir = /opt/rubies/ruby-2.3.1/include/ruby-2.3.0/x86_64-darwin14
18
+ PATH_SEPARATOR = :
19
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
+ prefix = $(DESTDIR)/opt/rubies/ruby-2.3.1
21
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
+ rubyarchprefix = $(rubylibprefix)/$(arch)
23
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
24
+ exec_prefix = $(prefix)
25
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
26
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
27
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
28
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
29
+ sitehdrdir = $(rubyhdrdir)/site_ruby
30
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
32
+ vendorlibdir = $(vendordir)/$(ruby_version)
33
+ vendordir = $(rubylibprefix)/vendor_ruby
34
+ sitearchdir = $(sitelibdir)/$(sitearch)
35
+ sitelibdir = $(sitedir)/$(ruby_version)
36
+ sitedir = $(rubylibprefix)/site_ruby
37
+ rubyarchdir = $(rubylibdir)/$(arch)
38
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
39
+ sitearchincludedir = $(includedir)/$(sitearch)
40
+ archincludedir = $(includedir)/$(arch)
41
+ sitearchlibdir = $(libdir)/$(sitearch)
42
+ archlibdir = $(libdir)/$(arch)
43
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
44
+ mandir = $(datarootdir)/man
45
+ localedir = $(datarootdir)/locale
46
+ libdir = $(exec_prefix)/lib
47
+ psdir = $(docdir)
48
+ pdfdir = $(docdir)
49
+ dvidir = $(docdir)
50
+ htmldir = $(docdir)
51
+ infodir = $(datarootdir)/info
52
+ docdir = $(datarootdir)/doc/$(PACKAGE)
53
+ oldincludedir = $(DESTDIR)/usr/include
54
+ includedir = $(SDKROOT)$(prefix)/include
55
+ localstatedir = $(prefix)/var
56
+ sharedstatedir = $(prefix)/com
57
+ sysconfdir = $(prefix)/etc
58
+ datadir = $(datarootdir)
59
+ datarootdir = $(prefix)/share
60
+ libexecdir = $(exec_prefix)/libexec
61
+ sbindir = $(exec_prefix)/sbin
62
+ bindir = $(exec_prefix)/bin
63
+ archdir = $(rubyarchdir)
64
+
65
+
66
+ CC = clang
67
+ CXX = clang++
68
+ LIBRUBY = $(LIBRUBY_A)
69
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
70
+ LIBRUBYARG_SHARED =
71
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
72
+ empty =
73
+ OUTFLAG = -o $(empty)
74
+ COUTFLAG = -o $(empty)
75
+
76
+ RUBY_EXTCONF_H = extconf.h
77
+ cflags = $(optflags) $(debugflags) $(warnflags)
78
+ cxxflags = $(optflags) $(debugflags) $(warnflags)
79
+ optflags = -O3 -fno-fast-math
80
+ debugflags = -ggdb3
81
+ warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens
82
+ CCDLFLAGS = -fno-common
83
+ CFLAGS = $(CCDLFLAGS) -O3 -Wno-error=shorten-64-to-32 -pipe -fbracket-depth=512 -DNDEBUG=1 $(ARCH_FLAG)
84
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
85
+ DEFS =
86
+ CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -I/Users/tillsc/github/tillsc/multi_markdown/ext/mmd -I/Users/tillsc/github/tillsc/multi_markdown/ext/mmd/include -I/usr/include -I/opt/rubies/ruby-2.3.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
87
+ CXXFLAGS = $(CCDLFLAGS) $(cxxflags) -fbracket-depth=512 -DNDEBUG=1 $(ARCH_FLAG)
88
+ ldflags = -L. -L/opt/rubies/ruby-2.3.1/lib -fstack-protector -L/usr/local/lib
89
+ dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
90
+ ARCH_FLAG =
91
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
92
+ LDSHARED = $(CC) -dynamic -bundle
93
+ LDSHAREDXX = $(CXX) -dynamic -bundle
94
+ AR = ar
95
+ EXEEXT =
96
+
97
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
98
+ RUBY_SO_NAME = ruby
99
+ RUBYW_INSTALL_NAME =
100
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
101
+ RUBYW_BASE_NAME = rubyw
102
+ RUBY_BASE_NAME = ruby
103
+
104
+ arch = x86_64-darwin14
105
+ sitearch = $(arch)
106
+ ruby_version = 2.3.0
107
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
108
+ RUBY = $(ruby)
109
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
110
+
111
+ RM = rm -f
112
+ RM_RF = $(RUBY) -run -e rm -- -rf
113
+ RMDIRS = rmdir -p
114
+ MAKEDIRS = /usr/local/bin/gmkdir -p
115
+ INSTALL = /usr/local/bin/ginstall -c
116
+ INSTALL_PROG = $(INSTALL) -m 0755
117
+ INSTALL_DATA = $(INSTALL) -m 644
118
+ COPY = cp
119
+ TOUCH = exit >
120
+
121
+ #### End of system configuration section. ####
122
+
123
+ preload =
124
+
125
+ libpath = . $(libdir) /opt/rubies/ruby-2.3.1/lib
126
+ LIBPATH = -L. -L$(libdir) -L/opt/rubies/ruby-2.3.1/lib
127
+ DEFFILE =
128
+
129
+ CLEANFILES = mkmf.log
130
+ DISTCLEANFILES =
131
+ DISTCLEANDIRS =
132
+
133
+ extout =
134
+ extout_prefix =
135
+ target_prefix =
136
+ LOCAL_LIBS =
137
+ LIBS = -lpthread -lgmp -ldl -lobjc
138
+ ORIG_SRCS = ruby_multi_markdown.c
139
+ SRCS = $(ORIG_SRCS) aho-corasick.c beamer.c char.c char_lookup.c critic_markup.c d_string.c epub.c fodt.c html.c latex.c lexer.c memoir.c miniz.c mmd.c object_pool.c opendocument-content.c opendocument.c parser.c rng.c scanners.c stack.c textbundle.c token.c token_pairs.c transclude.c uuid.c writer.c zip.c ruby_multi_markdown.c
140
+ OBJS = mmd/aho-corasick.o mmd/beamer.o mmd/char.o mmd/char_lookup.o mmd/critic_markup.o mmd/d_string.o mmd/epub.o mmd/fodt.o mmd/html.o mmd/latex.o mmd/lexer.o mmd/memoir.o mmd/miniz.o mmd/mmd.o mmd/object_pool.o mmd/opendocument-content.o mmd/opendocument.o mmd/parser.o mmd/rng.o mmd/scanners.o mmd/stack.o mmd/textbundle.o mmd/token.o mmd/token_pairs.o mmd/transclude.o mmd/uuid.o mmd/writer.o mmd/zip.o ruby_multi_markdown.o
141
+ HDRS = $(srcdir)/extconf.h
142
+ TARGET = multi_markdown
143
+ TARGET_NAME = multi_markdown
144
+ TARGET_ENTRY = Init_$(TARGET_NAME)
145
+ DLLIB = $(TARGET).bundle
146
+ EXTSTATIC =
147
+ STATIC_LIB =
148
+
149
+ TIMESTAMP_DIR = .
150
+ BINDIR = $(bindir)
151
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
152
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
153
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
154
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
155
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
156
+
157
+ TARGET_SO = $(DLLIB)
158
+ CLEANLIBS = $(TARGET).bundle
159
+ CLEANOBJS = *.o *.bak
160
+
161
+ all: $(DLLIB)
162
+ static: $(STATIC_LIB) install-rb
163
+ .PHONY: all install static install-so install-rb
164
+ .PHONY: clean clean-so clean-static clean-rb
165
+
166
+ clean-static::
167
+ clean-rb-default::
168
+ clean-rb::
169
+ clean-so::
170
+ clean: clean-so clean-static clean-rb-default clean-rb
171
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
172
+
173
+ distclean-rb-default::
174
+ distclean-rb::
175
+ distclean-so::
176
+ distclean-static::
177
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
178
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
179
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
180
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
181
+
182
+ realclean: distclean
183
+ install: install-so install-rb
184
+
185
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.time
186
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
187
+ clean-static::
188
+ -$(Q)$(RM) $(STATIC_LIB)
189
+ install-rb: pre-install-rb install-rb-default
190
+ install-rb-default: pre-install-rb-default
191
+ pre-install-rb: Makefile
192
+ pre-install-rb-default: Makefile
193
+ pre-install-rb-default:
194
+ @$(NULLCMD)
195
+ $(TIMESTAMP_DIR)/.RUBYARCHDIR.time:
196
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
197
+ $(Q) $(TOUCH) $@
198
+
199
+ site-install: site-install-so site-install-rb
200
+ site-install-so: install-so
201
+ site-install-rb: install-rb
202
+
203
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
204
+
205
+ .cc.o:
206
+ $(ECHO) compiling $(<)
207
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
208
+
209
+ .cc.S:
210
+ $(ECHO) translating $(<)
211
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
212
+
213
+ .mm.o:
214
+ $(ECHO) compiling $(<)
215
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
216
+
217
+ .mm.S:
218
+ $(ECHO) translating $(<)
219
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
220
+
221
+ .cxx.o:
222
+ $(ECHO) compiling $(<)
223
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
224
+
225
+ .cxx.S:
226
+ $(ECHO) translating $(<)
227
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
228
+
229
+ .cpp.o:
230
+ $(ECHO) compiling $(<)
231
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
232
+
233
+ .cpp.S:
234
+ $(ECHO) translating $(<)
235
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
236
+
237
+ .c.o:
238
+ $(ECHO) compiling $(<)
239
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
240
+
241
+ .c.S:
242
+ $(ECHO) translating $(<)
243
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
244
+
245
+ .m.o:
246
+ $(ECHO) compiling $(<)
247
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
248
+
249
+ .m.S:
250
+ $(ECHO) translating $(<)
251
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
252
+
253
+ $(DLLIB): $(OBJS) Makefile
254
+ $(ECHO) linking shared-object $(DLLIB)
255
+ -$(Q)$(RM) $(@)
256
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
257
+ $(Q) $(POSTLINK)
258
+
259
+
260
+
261
+ $(OBJS): $(HDRS) $(ruby_headers)
data/ext/extconf.rb CHANGED
@@ -1,10 +1,30 @@
1
1
  require 'mkmf'
2
2
 
3
- dir_config('multi_markdown')
3
+ LIBDIR = RbConfig::CONFIG['libdir']
4
+ INCLUDEDIR = RbConfig::CONFIG['includedir']
4
5
 
5
- mmd_objs = %w[parse_utilities.o parser.o GLibFacade.o writer.o text.o html.o latex.o memoir.o beamer.o lyx.o lyxbeamer.o opml.o odf.o critic.o rng.o rtf.o transclude.o]
6
+ if RbConfig::CONFIG['CC'] == 'clang'
7
+ $CFLAGS="#{$CFLAGS} -fbracket-depth=512 -DNDEBUG=1"
8
+ $CXXFLAGS="#{$CXXFLAGS} -fbracket-depth=512 -DNDEBUG=1"
9
+ else
10
+ $CFLAGS="#{$CFLAGS} -std=c99 -DNDEBUG=1"
11
+ $CXXFLAGS="#{$CXXFLAGS} -std=c99 -DNDEBUG=1"
12
+ end
6
13
 
7
- $objs = mmd_objs.map { |s| "../MultiMarkdown-4/#{s}" } + ["multi_markdown.o"]
14
+ HEADER_DIRS = [
15
+ File.expand_path('../mmd', __FILE__),
16
+ File.expand_path('../mmd/include', __FILE__),
17
+ INCLUDEDIR,
18
+ '/usr/include'
19
+ ]
20
+
21
+ dir_config('multi_markdown', HEADER_DIRS, [LIBDIR])
22
+
23
+ find_header('libMultiMarkdown.h')
24
+ find_header('d_string.h')
25
+ find_header('stdio.h')
26
+
27
+ $objs = Dir.glob('**/*.c').map { |s| s.gsub(/\.c$/, ".o") }
8
28
 
9
29
  create_header
10
30
  create_makefile('multi_markdown')