trenni 3.9.0 → 3.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bake/trenni/entities.rb +57 -0
- data/bake/trenni/parsers.rb +66 -0
- data/ext/tmp/x86_64-linux/lib/trenni/trenni.so +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/Makefile +263 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/escape.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/markup.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/mkmf.log +108 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/tag.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/template.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/trenni.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.4.0/trenni.so +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/Makefile +266 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/escape.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/markup.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/mkmf.log +113 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/query.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/tag.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/template.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/trenni.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.0/trenni.so +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/Makefile +266 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/escape.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/markup.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/mkmf.log +113 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/query.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/tag.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/template.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/trenni.o +0 -0
- data/ext/tmp/x86_64-linux/trenni/2.7.1/trenni.so +0 -0
- data/lib/trenni/builder.rb +79 -15
- data/lib/trenni/entities.rb +2082 -2084
- data/lib/trenni/entities.trenni +1 -3
- data/lib/trenni/template.rb +23 -22
- data/lib/trenni/version.rb +1 -1
- data/spec/trenni/builder_spec.rb +103 -60
- data/spec/trenni/template_spec/builder.trenni +2 -2
- metadata +60 -62
- data/.editorconfig +0 -6
- data/.gitignore +0 -19
- data/.rspec +0 -5
- data/.travis.yml +0 -23
- data/Gemfile +0 -21
- data/README.md +0 -312
- data/Rakefile +0 -21
- data/benchmark/call_vs_yield.rb +0 -52
- data/benchmark/interpolation_vs_concat.rb +0 -30
- data/benchmark/io_vs_string.rb +0 -91
- data/entities.json +0 -2233
- data/tasks/entities.rake +0 -34
- data/tasks/parsers.rake +0 -44
- data/trenni.gemspec +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be999b5c4a84388516c96bb85eee7ea6cb10369726363be2405cc21fdffab71
|
4
|
+
data.tar.gz: 4c4935e28be7ec79b4ab112adf4ba4e0732d20fb4bae5163ce521ba755c54151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0584a110d93c1b7f6a25304eb11d2196a8217cd7352686939164a7f1ad70b4451c16f2da5b74059796461c3d1e62adb2e7c6a4ad307e8711af50f0a38d5b2316'
|
7
|
+
data.tar.gz: 5bea1a448f9e2aa9511cbea874dcb5fdd39994fdb1ab1f51bc0b48611fa75eb408e0fd4bb88e268e15bb43d7eec34d3be1f50ace066fc55a47c16d851ecd5a89
|
@@ -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
|
@@ -0,0 +1,263 @@
|
|
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 = /home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0
|
16
|
+
hdrdir = $(topdir)
|
17
|
+
arch_hdrdir = /home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-linux
|
18
|
+
PATH_SEPARATOR = :
|
19
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
+
prefix = $(DESTDIR)/home/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 = $(DESTDIR)/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 = -Wl,-R$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
|
71
|
+
LIBRUBYARG_STATIC = -Wl,-R$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
|
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 -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized
|
83
|
+
CCDLFLAGS = -fPIC
|
84
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC -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 $(DEFS) $(cppflags)
|
88
|
+
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
89
|
+
ldflags = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
|
90
|
+
dldflags = -Wl,--compress-debug-sections=zlib
|
91
|
+
ARCH_FLAG =
|
92
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
93
|
+
LDSHARED = $(CC) -shared
|
94
|
+
LDSHAREDXX = $(CXX) -shared
|
95
|
+
AR = ar
|
96
|
+
EXEEXT =
|
97
|
+
|
98
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
99
|
+
RUBY_SO_NAME = ruby
|
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-linux
|
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 --ignore-fail-on-non-empty -p
|
115
|
+
MAKEDIRS = /usr/bin/mkdir -p
|
116
|
+
INSTALL = /usr/bin/install -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)
|
126
|
+
LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir)
|
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 -lcrypt -lm -lc
|
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)/tag.h $(srcdir)/trenni.h $(srcdir)/markup.h $(srcdir)/escape.h $(srcdir)/template.h
|
142
|
+
LOCAL_HDRS =
|
143
|
+
TARGET = trenni
|
144
|
+
TARGET_NAME = trenni
|
145
|
+
TARGET_ENTRY = Init_$(TARGET_NAME)
|
146
|
+
DLLIB = $(TARGET).so
|
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
|
+
|
261
|
+
|
262
|
+
|
263
|
+
$(OBJS): $(HDRS) $(ruby_headers)
|
Binary file
|
Binary file
|
@@ -0,0 +1,108 @@
|
|
1
|
+
have_func: checking for rb_sym2str()... -------------------- yes
|
2
|
+
|
3
|
+
"gcc -o conftest -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-linux -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -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 -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized -fPIC -O3 -std=c99 conftest.c -L. -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
|
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/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-linux -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -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 -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized -fPIC -O3 -std=c99 conftest.c -L. -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
|
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/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-linux -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -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 -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized -fPIC -O3 -std=c99 conftest.c -L. -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
|
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/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-linux -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -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 -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized -fPIC -O3 -std=c99 conftest.c -L. -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
|
59
|
+
conftest.c: In function ‘t’:
|
60
|
+
conftest.c:13:57: error: ‘rb_str_reserve’ undeclared (first use in this function)
|
61
|
+
int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_str_reserve; return !p; }
|
62
|
+
^~~~~~~~~~~~~~
|
63
|
+
conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in
|
64
|
+
conftest.c: At top level:
|
65
|
+
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
|
66
|
+
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
|
67
|
+
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
|
68
|
+
checked program was:
|
69
|
+
/* begin */
|
70
|
+
1: #include "ruby.h"
|
71
|
+
2:
|
72
|
+
3: /*top*/
|
73
|
+
4: extern int t(void);
|
74
|
+
5: int main(int argc, char **argv)
|
75
|
+
6: {
|
76
|
+
7: if (argc > 1000000) {
|
77
|
+
8: printf("%p", &t);
|
78
|
+
9: }
|
79
|
+
10:
|
80
|
+
11: return 0;
|
81
|
+
12: }
|
82
|
+
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_str_reserve; return !p; }
|
83
|
+
/* end */
|
84
|
+
|
85
|
+
"gcc -o conftest -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-linux -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/home/samuel/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I../../../../trenni -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 -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized -fPIC -O3 -std=c99 conftest.c -L. -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/samuel/.rvm/rubies/ruby-2.4.0/lib -L/home/samuel/.rvm/rubies/ruby-2.4.0/lib -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
|
86
|
+
/tmp/ccpH7HyN.o: In function `t':
|
87
|
+
/home/samuel/Documents/Programming/ioquatix/trenni/ext/tmp/x86_64-linux/trenni/2.4.0/conftest.c:14: undefined reference to `rb_str_reserve'
|
88
|
+
collect2: error: ld returned 1 exit status
|
89
|
+
checked program was:
|
90
|
+
/* begin */
|
91
|
+
1: #include "ruby.h"
|
92
|
+
2:
|
93
|
+
3: /*top*/
|
94
|
+
4: extern int t(void);
|
95
|
+
5: int main(int argc, char **argv)
|
96
|
+
6: {
|
97
|
+
7: if (argc > 1000000) {
|
98
|
+
8: printf("%p", &t);
|
99
|
+
9: }
|
100
|
+
10:
|
101
|
+
11: return 0;
|
102
|
+
12: }
|
103
|
+
13: extern void rb_str_reserve();
|
104
|
+
14: int t(void) { rb_str_reserve(); return 0; }
|
105
|
+
/* end */
|
106
|
+
|
107
|
+
--------------------
|
108
|
+
|