trenni 3.10.0 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/bake/trenni/entities.rb +57 -0
  3. data/bake/trenni/parsers.rb +66 -0
  4. data/ext/.DS_Store +0 -0
  5. data/ext/tmp/.DS_Store +0 -0
  6. data/ext/tmp/x86_64-darwin16/lib/trenni/trenni.bundle +0 -0
  7. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/Makefile +264 -0
  8. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/escape.o +0 -0
  9. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/markup.o +0 -0
  10. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/mkmf.log +105 -0
  11. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/tag.o +0 -0
  12. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/template.o +0 -0
  13. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/trenni.bundle +0 -0
  14. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/trenni.o +0 -0
  15. data/ext/tmp/x86_64-darwin18/lib/trenni/trenni.bundle +0 -0
  16. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/Makefile +266 -0
  17. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/escape.o +0 -0
  18. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/markup.o +0 -0
  19. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/mkmf.log +109 -0
  20. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/tag.o +0 -0
  21. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/template.o +0 -0
  22. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/trenni.bundle +0 -0
  23. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/trenni.o +0 -0
  24. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/Makefile +266 -0
  25. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/escape.o +0 -0
  26. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/markup.o +0 -0
  27. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/mkmf.log +109 -0
  28. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/tag.o +0 -0
  29. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/template.o +0 -0
  30. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/trenni.bundle +0 -0
  31. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/trenni.o +0 -0
  32. data/ext/tmp/x86_64-darwin19/lib/trenni/trenni.bundle +0 -0
  33. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/Makefile +267 -0
  34. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/escape.o +0 -0
  35. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/markup.o +0 -0
  36. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/mkmf.log +109 -0
  37. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/query.o +0 -0
  38. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/tag.o +0 -0
  39. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/template.o +0 -0
  40. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/trenni.bundle +0 -0
  41. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/trenni.o +0 -0
  42. data/ext/trenni/.DS_Store +0 -0
  43. data/lib/.DS_Store +0 -0
  44. data/lib/trenni/.DS_Store +0 -0
  45. data/lib/trenni/builder.rb +14 -4
  46. data/lib/trenni/entities.rb +2082 -2084
  47. data/lib/trenni/entities.trenni +1 -3
  48. data/lib/trenni/template.rb +19 -9
  49. data/lib/trenni/version.rb +1 -1
  50. data/parsers/.DS_Store +0 -0
  51. data/spec/.DS_Store +0 -0
  52. data/spec/trenni/builder_spec.rb +1 -1
  53. data/spec/trenni/template_spec/.DS_Store +0 -0
  54. metadata +73 -58
  55. data/.editorconfig +0 -6
  56. data/.gitignore +0 -19
  57. data/.rspec +0 -5
  58. data/.travis.yml +0 -23
  59. data/Gemfile +0 -21
  60. data/README.md +0 -312
  61. data/Rakefile +0 -21
  62. data/benchmark/call_vs_yield.rb +0 -52
  63. data/benchmark/interpolation_vs_concat.rb +0 -30
  64. data/benchmark/io_vs_string.rb +0 -91
  65. data/entities.json +0 -2233
  66. data/tasks/entities.rake +0 -34
  67. data/tasks/parsers.rake +0 -44
  68. data/trenni.gemspec +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d691d52d748f9bad0d6f17c5c36a7572366f3a5810c65887e989f9d61ffabdb5
4
- data.tar.gz: d6500ff06162ffbf6ce8fda15c708647389580d0b8910cb91a83d56595070f77
3
+ metadata.gz: b8508e64521a7d867908f4a7fce4d75330abd8e0139b333705b951b3612a1f79
4
+ data.tar.gz: 2778994f2df2428a29c142a9b6caee348ba759a4edba7e761dcefc9cff7e91d2
5
5
  SHA512:
6
- metadata.gz: 6ef1b5b1125289c6defb4e8e692f6dc0309912065116c39f4a6d44e679394176a60c529a49fc7915790f5f2a3d83a33b92810f13225414650c5901ad8295df50
7
- data.tar.gz: 41bb01d2f1326d26c04a402d8ca46ccd144007d537e745888d4f7be476066e895467ea2cada4a0a1b112dfd9934069412abea98fd3c58a0150046a9e356c1f9d
6
+ metadata.gz: 76ad90f58c94775c28b693c31a4ab2a9b15f450a4a9bf27820d6977bf9edf77052033050c20067cb6e2281a860e6eccb8fd5d795772257b92184f91ff25b5b9b
7
+ data.tar.gz: 809eeb0ed1af8e48abc3fc111a0b7da691f2e669ec359c44177a74cbb46f49f0abed4d93985385bca6dc91c45cb202adb6c5fee403ff38bbedebb03efbd2594a
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Fetch the HTML5 entities from w3.org and update the local cache.
4
+ # @parameter force [Boolean] Whether to force regenerate the local cache.
5
+ def fetch_entities(force: false)
6
+ require 'json'
7
+ require 'async'
8
+ require 'async/http/internet'
9
+
10
+ internet = Async::HTTP::Internet.new
11
+ entites_json_path = self.entites_json_path
12
+
13
+ if force || !File.exist?(entites_json_path)
14
+ url = "https://www.w3.org/TR/html5/entities.json"
15
+
16
+ Sync do
17
+ File.write(entites_json_path, internet.get(url).read)
18
+ end
19
+ end
20
+
21
+ return JSON.parse(File.read(entites_json_path)).delete_if{|string, _| !string.end_with? ';'}
22
+ end
23
+
24
+ # Consume the HTML5 entites and generate parsers to escape them.
25
+ # @parameter wet [Boolean] Whether to write updated files.
26
+ def update_entities(wet: false)
27
+ require 'trenni/template'
28
+
29
+ paths = {
30
+ # 'ext/trenni/entities.rl' => 'ext/trenni/entities.trenni',
31
+ 'lib/trenni/entities.rb' => 'lib/trenni/entities.trenni',
32
+ }
33
+
34
+ entities = self.fetch_entities
35
+
36
+ paths.each do |output_path, template_path|
37
+ template_path = File.expand_path(template_path, context.root)
38
+ output_path = File.expand_path(output_path, context.root)
39
+
40
+ template = Trenni::Template.load_file(template_path)
41
+
42
+ output = template.to_string(entities)
43
+
44
+ if wet
45
+ File.write(output_path, output)
46
+ else
47
+ puts "*** #{output_path} ***"
48
+ puts output
49
+ end
50
+ end
51
+ end
52
+
53
+ private
54
+
55
+ def entites_json_path
56
+ File.expand_path("entities.json", context.root)
57
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generate the pure Ruby parsers.
4
+ def generate_fallback
5
+ Dir.chdir(fallback_directory) do
6
+ Dir.glob("*.rl").each do |parser_path|
7
+ system("ragel", "-I", parsers_directory, "-R", parser_path, "-F1")
8
+ end
9
+
10
+ # sh("ruby-beautify", "--tabs", "--overwrite", *Dir.glob("*.rb"))
11
+ end
12
+ end
13
+
14
+ # Generate the native C parsers.
15
+ def generate_native
16
+ Dir.chdir(native_directory) do
17
+ Dir.glob("*.rl").each do |parser_path|
18
+ system("ragel", "-I", parsers_directory, "-C", parser_path, "-G2")
19
+ end
20
+ end
21
+ end
22
+
23
+ # Compile the C extension.
24
+ def compile
25
+ system("rake", "compile", chdir: extensions_directory)
26
+ end
27
+
28
+ # Generate the parsers and compile them as required.
29
+ def generate
30
+ self.generate_native
31
+ self.generate_fallback
32
+ self.compile
33
+ end
34
+
35
+ # Generate a visualisation of the parsers.
36
+ def visualize_parsers
37
+ Dir.chdir(fallback_directory) do
38
+ Dir.glob("*.rl").each do |parser_path|
39
+ dot_path = parser_path + ".dot"
40
+ system("ragel", "-I", parsers_directory, "-Vp", parser_path, "-o", dot_path)
41
+
42
+ pdf_path = parser_path + ".pdf"
43
+ system("dot", "-Tpdf", "-o", pdf_path, dot_path)
44
+
45
+ system("open", pdf_path) rescue nil
46
+ end
47
+ end
48
+ end
49
+
50
+ private
51
+
52
+ def parsers_directory
53
+ File.expand_path("parsers", context.root)
54
+ end
55
+
56
+ def fallback_directory
57
+ File.expand_path("lib/trenni/fallback", context.root)
58
+ end
59
+
60
+ def extensions_directory
61
+ File.expand_path("ext", context.root)
62
+ end
63
+
64
+ def native_directory
65
+ File.expand_path("ext/trenni", context.root)
66
+ end
Binary file
Binary file
@@ -0,0 +1,264 @@
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 = ../../../../trenni
15
+ topdir = /Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0
16
+ hdrdir = $(topdir)
17
+ arch_hdrdir = /Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16
18
+ PATH_SEPARATOR = :
19
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
+ prefix = $(DESTDIR)/Users/samuel/.rvm/rubies/ruby-2.4.0
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 = $(SDKROOT)/usr/include
54
+ includedir = $(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 = gcc
67
+ CXX = g++
68
+ LIBRUBY = $(LIBRUBY_SO)
69
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
70
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
71
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
72
+ empty =
73
+ OUTFLAG = -o $(empty)
74
+ COUTFLAG = -o $(empty)
75
+ CSRCFLAG = $(empty)
76
+
77
+ RUBY_EXTCONF_H =
78
+ cflags = $(optflags) $(debugflags) $(warnflags)
79
+ cxxflags = $(optflags) $(debugflags) $(warnflags)
80
+ optflags = -O3 -fno-fast-math
81
+ debugflags = -ggdb3
82
+ warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens
83
+ CCDLFLAGS = -fno-common
84
+ CFLAGS = $(CCDLFLAGS) $(cflags) -fno-common -pipe -O3 -std=c99 $(ARCH_FLAG)
85
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
86
+ DEFS =
87
+ CPPFLAGS = -DHAVE_RB_SYM2STR -DHAVE_RB_STR_CAT_CSTR -I/opt/local/include -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
88
+ CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
89
+ ldflags = -L. -fstack-protector -L/opt/local/lib -L/opt/local/lib
90
+ dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/opt/local/lib -L/opt/local/lib
91
+ ARCH_FLAG =
92
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
93
+ LDSHARED = $(CC) -dynamic -bundle
94
+ LDSHAREDXX = $(CXX) -dynamic -bundle
95
+ AR = ar
96
+ EXEEXT =
97
+
98
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
99
+ RUBY_SO_NAME = ruby.2.4.0
100
+ RUBYW_INSTALL_NAME =
101
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
102
+ RUBYW_BASE_NAME = rubyw
103
+ RUBY_BASE_NAME = ruby
104
+
105
+ arch = x86_64-darwin16
106
+ sitearch = $(arch)
107
+ ruby_version = 2.4.0
108
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
109
+ RUBY = $(ruby)
110
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.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
111
+
112
+ RM = rm -f
113
+ RM_RF = $(RUBY) -run -e rm -- -rf
114
+ RMDIRS = rmdir -p
115
+ MAKEDIRS = /opt/local/bin/gmkdir -p
116
+ INSTALL = /opt/local/bin/ginstall -c
117
+ INSTALL_PROG = $(INSTALL) -m 0755
118
+ INSTALL_DATA = $(INSTALL) -m 644
119
+ COPY = cp
120
+ TOUCH = exit >
121
+
122
+ #### End of system configuration section. ####
123
+
124
+ preload =
125
+ libpath = . $(libdir) /opt/local/lib
126
+ LIBPATH = -L. -L$(libdir) -L/opt/local/lib
127
+ DEFFILE =
128
+
129
+ CLEANFILES = mkmf.log
130
+ DISTCLEANFILES =
131
+ DISTCLEANDIRS =
132
+
133
+ extout =
134
+ extout_prefix =
135
+ target_prefix = /trenni
136
+ LOCAL_LIBS =
137
+ LIBS = $(LIBRUBYARG_SHARED) -lpthread -lgmp -ldl -lobjc
138
+ ORIG_SRCS = escape.c markup.c tag.c template.c trenni.c
139
+ SRCS = $(ORIG_SRCS)
140
+ OBJS = escape.o markup.o tag.o template.o trenni.o
141
+ HDRS = $(srcdir)/escape.h $(srcdir)/markup.h $(srcdir)/tag.h $(srcdir)/template.h $(srcdir)/trenni.h
142
+ LOCAL_HDRS =
143
+ TARGET = trenni
144
+ TARGET_NAME = trenni
145
+ TARGET_ENTRY = Init_$(TARGET_NAME)
146
+ DLLIB = $(TARGET).bundle
147
+ EXTSTATIC =
148
+ STATIC_LIB =
149
+
150
+ TIMESTAMP_DIR = .
151
+ BINDIR = $(bindir)
152
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
153
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
154
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
155
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
156
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
157
+ TARGET_SO_DIR =
158
+ TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
159
+ CLEANLIBS = $(TARGET_SO)
160
+ CLEANOBJS = *.o *.bak
161
+
162
+ all: $(DLLIB)
163
+ static: $(STATIC_LIB) install-rb
164
+ .PHONY: all install static install-so install-rb
165
+ .PHONY: clean clean-so clean-static clean-rb
166
+
167
+ clean-static::
168
+ clean-rb-default::
169
+ clean-rb::
170
+ clean-so::
171
+ clean: clean-so clean-static clean-rb-default clean-rb
172
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
173
+
174
+ distclean-rb-default::
175
+ distclean-rb::
176
+ distclean-so::
177
+ distclean-static::
178
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
179
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
180
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
181
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
182
+
183
+ realclean: distclean
184
+ install: install-so install-rb
185
+
186
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.-.trenni.time
187
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
188
+ clean-static::
189
+ -$(Q)$(RM) $(STATIC_LIB)
190
+ install-rb: pre-install-rb do-install-rb install-rb-default
191
+ install-rb-default: pre-install-rb-default do-install-rb-default
192
+ pre-install-rb: Makefile
193
+ pre-install-rb-default: Makefile
194
+ do-install-rb:
195
+ do-install-rb-default:
196
+ pre-install-rb-default:
197
+ @$(NULLCMD)
198
+ $(TIMESTAMP_DIR)/.sitearchdir.-.trenni.time:
199
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
200
+ $(Q) $(TOUCH) $@
201
+
202
+ site-install: site-install-so site-install-rb
203
+ site-install-so: install-so
204
+ site-install-rb: install-rb
205
+
206
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
207
+
208
+ .cc.o:
209
+ $(ECHO) compiling $(<)
210
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
211
+
212
+ .cc.S:
213
+ $(ECHO) translating $(<)
214
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
215
+
216
+ .mm.o:
217
+ $(ECHO) compiling $(<)
218
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
219
+
220
+ .mm.S:
221
+ $(ECHO) translating $(<)
222
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
223
+
224
+ .cxx.o:
225
+ $(ECHO) compiling $(<)
226
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
227
+
228
+ .cxx.S:
229
+ $(ECHO) translating $(<)
230
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
231
+
232
+ .cpp.o:
233
+ $(ECHO) compiling $(<)
234
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
235
+
236
+ .cpp.S:
237
+ $(ECHO) translating $(<)
238
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
239
+
240
+ .c.o:
241
+ $(ECHO) compiling $(<)
242
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
243
+
244
+ .c.S:
245
+ $(ECHO) translating $(<)
246
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
247
+
248
+ .m.o:
249
+ $(ECHO) compiling $(<)
250
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
251
+
252
+ .m.S:
253
+ $(ECHO) translating $(<)
254
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
255
+
256
+ $(TARGET_SO): $(OBJS) Makefile
257
+ $(ECHO) linking shared-object trenni/$(DLLIB)
258
+ -$(Q)$(RM) $(@)
259
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
260
+ $(Q) $(POSTLINK)
261
+
262
+
263
+
264
+ $(OBJS): $(HDRS) $(ruby_headers)
@@ -0,0 +1,105 @@
1
+ have_func: checking for rb_sym2str()... -------------------- yes
2
+
3
+ "gcc -o conftest -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -I/opt/local/include -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -O3 -std=c99 conftest.c -L. -L/Users/samuel/.rvm/rubies/ruby-2.4.0/lib -L/opt/local/lib -L. -fstack-protector -L/opt/local/lib -L/opt/local/lib -lruby.2.4.0 -lpthread -lgmp -ldl -lobjc "
4
+ checked program was:
5
+ /* begin */
6
+ 1: #include "ruby.h"
7
+ 2:
8
+ 3: int main(int argc, char **argv)
9
+ 4: {
10
+ 5: return 0;
11
+ 6: }
12
+ /* end */
13
+
14
+ "gcc -o conftest -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -I/opt/local/include -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -O3 -std=c99 conftest.c -L. -L/Users/samuel/.rvm/rubies/ruby-2.4.0/lib -L/opt/local/lib -L. -fstack-protector -L/opt/local/lib -L/opt/local/lib -lruby.2.4.0 -lpthread -lgmp -ldl -lobjc "
15
+ checked program was:
16
+ /* begin */
17
+ 1: #include "ruby.h"
18
+ 2:
19
+ 3: /*top*/
20
+ 4: extern int t(void);
21
+ 5: int main(int argc, char **argv)
22
+ 6: {
23
+ 7: if (argc > 1000000) {
24
+ 8: printf("%p", &t);
25
+ 9: }
26
+ 10:
27
+ 11: return 0;
28
+ 12: }
29
+ 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_sym2str; return !p; }
30
+ /* end */
31
+
32
+ --------------------
33
+
34
+ have_func: checking for rb_str_cat_cstr()... -------------------- yes
35
+
36
+ "gcc -o conftest -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -I/opt/local/include -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -O3 -std=c99 conftest.c -L. -L/Users/samuel/.rvm/rubies/ruby-2.4.0/lib -L/opt/local/lib -L. -fstack-protector -L/opt/local/lib -L/opt/local/lib -lruby.2.4.0 -lpthread -lgmp -ldl -lobjc "
37
+ checked program was:
38
+ /* begin */
39
+ 1: #include "ruby.h"
40
+ 2:
41
+ 3: /*top*/
42
+ 4: extern int t(void);
43
+ 5: int main(int argc, char **argv)
44
+ 6: {
45
+ 7: if (argc > 1000000) {
46
+ 8: printf("%p", &t);
47
+ 9: }
48
+ 10:
49
+ 11: return 0;
50
+ 12: }
51
+ 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_str_cat_cstr; return !p; }
52
+ /* end */
53
+
54
+ --------------------
55
+
56
+ have_func: checking for rb_str_reserve()... -------------------- no
57
+
58
+ "gcc -o conftest -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -I/opt/local/include -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -O3 -std=c99 conftest.c -L. -L/Users/samuel/.rvm/rubies/ruby-2.4.0/lib -L/opt/local/lib -L. -fstack-protector -L/opt/local/lib -L/opt/local/lib -lruby.2.4.0 -lpthread -lgmp -ldl -lobjc "
59
+ conftest.c:13:57: error: use of undeclared identifier 'rb_str_reserve'
60
+ int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_str_reserve; return !p; }
61
+ ^
62
+ 1 error generated.
63
+ checked program was:
64
+ /* begin */
65
+ 1: #include "ruby.h"
66
+ 2:
67
+ 3: /*top*/
68
+ 4: extern int t(void);
69
+ 5: int main(int argc, char **argv)
70
+ 6: {
71
+ 7: if (argc > 1000000) {
72
+ 8: printf("%p", &t);
73
+ 9: }
74
+ 10:
75
+ 11: return 0;
76
+ 12: }
77
+ 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_str_reserve; return !p; }
78
+ /* end */
79
+
80
+ "gcc -o conftest -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -I/opt/local/include -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -O3 -std=c99 conftest.c -L. -L/Users/samuel/.rvm/rubies/ruby-2.4.0/lib -L/opt/local/lib -L. -fstack-protector -L/opt/local/lib -L/opt/local/lib -lruby.2.4.0 -lpthread -lgmp -ldl -lobjc "
81
+ Undefined symbols for architecture x86_64:
82
+ "_rb_str_reserve", referenced from:
83
+ _t in conftest-2f3728.o
84
+ ld: symbol(s) not found for architecture x86_64
85
+ clang: error: linker command failed with exit code 1 (use -v to see invocation)
86
+ checked program was:
87
+ /* begin */
88
+ 1: #include "ruby.h"
89
+ 2:
90
+ 3: /*top*/
91
+ 4: extern int t(void);
92
+ 5: int main(int argc, char **argv)
93
+ 6: {
94
+ 7: if (argc > 1000000) {
95
+ 8: printf("%p", &t);
96
+ 9: }
97
+ 10:
98
+ 11: return 0;
99
+ 12: }
100
+ 13: extern void rb_str_reserve();
101
+ 14: int t(void) { rb_str_reserve(); return 0; }
102
+ /* end */
103
+
104
+ --------------------
105
+