summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
Diffstat (limited to 'template')
-rw-r--r--template/Doxyfile.tmpl359
-rw-r--r--template/GNUmakefile.in15
-rw-r--r--template/Makefile.in210
-rw-r--r--template/builtin_binary.rbbin.tmpl (renamed from template/builtin_binary.inc.tmpl)17
-rw-r--r--template/configure-ext.mk.tmpl6
-rw-r--r--template/encdb.h.tmpl36
-rw-r--r--template/extinit.c.tmpl2
-rw-r--r--template/exts.mk.tmpl58
-rw-r--r--template/fake.rb.in33
-rw-r--r--template/id.c.tmpl3
-rw-r--r--template/id.h.tmpl17
-rw-r--r--template/known_errors.inc.tmpl8
-rw-r--r--template/limits.c.tmpl19
-rw-r--r--template/prelude.c.tmpl95
-rw-r--r--template/ruby-runner.h.in2
-rw-r--r--template/ruby.pc.in2
-rw-r--r--template/sizes.c.tmpl21
-rw-r--r--template/transdb.h.tmpl39
-rw-r--r--template/unicode_norm_gen.tmpl37
-rwxr-xr-xtemplate/unicode_properties.rdoc.tmpl59
20 files changed, 671 insertions, 367 deletions
diff --git a/template/Doxyfile.tmpl b/template/Doxyfile.tmpl
index 87fe5b8f48..cea28d04c7 100644
--- a/template/Doxyfile.tmpl
+++ b/template/Doxyfile.tmpl
@@ -1,4 +1,4 @@
-# Doxyfile 1.9.3
+# Doxyfile 1.9.7
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -12,6 +12,16 @@
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
+#
+# Note:
+#
+# Use doxygen to compare the used configuration file with the template
+# configuration file:
+# doxygen -x [configFile]
+# Use doxygen to compare the used configuration file with the template
+# configuration file without replacing the environment variables or CMake type
+# replacement variables:
+# doxygen -x_noenv [configFile]
<%
srcdir = miniruby = nil
@@ -77,16 +87,28 @@ PROJECT_LOGO =
OUTPUT_DIRECTORY = doc/capi
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
+# sub-directories (in 2 levels) under the output directory of each output format
+# and will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
+# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to
+# control the number of sub-directories.
# The default value is: NO.
CREATE_SUBDIRS = YES
+# Controls the number of sub-directories that will be created when
+# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every
+# level increment doubles the number of directories, resulting in 4096
+# directories at level 8 which is the default and also the maximum value. The
+# sub-directories are organized in 2 levels, the first level always has a fixed
+# number of 16 directories.
+# Minimum value: 0, maximum value: 8, default value: 8.
+# This tag requires that the tag CREATE_SUBDIRS is set to YES.
+
+CREATE_SUBDIRS_LEVEL = 8
+
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
# characters to appear in the names of generated files. If set to NO, non-ASCII
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
@@ -98,14 +120,14 @@ ALLOW_UNICODE_NAMES = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian,
+# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English
+# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek,
+# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with
+# English messages), Korean, Korean-en (Korean with English messages), Latvian,
+# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese,
+# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish,
+# Swedish, Turkish, Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
@@ -354,6 +376,17 @@ MARKDOWN_SUPPORT = YES
TOC_INCLUDE_HEADINGS = 5
+# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to
+# generate identifiers for the Markdown headings. Note: Every identifier is
+# unique.
+# Possible values are: DOXYGEN Use a fixed 'autotoc_md' string followed by a
+# sequence number starting at 0. and GITHUB Use the lower case version of title
+# with any whitespace replaced by '-' and punctations characters removed..
+# The default value is: DOXYGEN.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+MARKDOWN_ID_STYLE = GITHUB
+
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
@@ -465,7 +498,7 @@ TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
-# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
+# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use
# during processing. When set to 0 doxygen will based this on the number of
# cores available in the system. You can set it explicitly to a value larger
# than 0 to get more control over the balance between CPU load and processing
@@ -478,6 +511,14 @@ LOOKUP_CACHE_SIZE = 0
NUM_PROC_THREADS = 1
+# If the TIMESTAMP tag is set different from NO then each generated page will
+# contain the date or date and time when the page was generated. Setting this to
+# NO can help when comparing the output of multiple runs.
+# Possible values are: YES, NO, DATETIME and DATE.
+# The default value is: NO.
+
+TIMESTAMP = NO
+
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -559,7 +600,8 @@ HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
+# will also hide undocumented C++ concepts if enabled. This option has no effect
+# if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
@@ -579,7 +621,7 @@ HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = YES
# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
+# @internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
@@ -590,14 +632,15 @@ INTERNAL_DOCS = NO
# filesystem is case sensitive (i.e. it supports files in the same directory
# whose names only differ in casing), the option must be set to YES to properly
# deal with such files in case they appear in the input. For filesystems that
-# are not case sensitive the option should be be set to NO to properly deal with
+# are not case sensitive the option should be set to NO to properly deal with
# output files written for symbols that only differ in casing, such as for two
# classes, one named CLASS and the other named Class, and to also support
# references to files without having to specify the exact matching casing. On
# Windows (including Cygwin) and MacOS, users should typically set this option
# to NO, whereas on Linux or other Unix flavors it should typically be set to
# YES.
-# The default value is: system dependent.
+# Possible values are: SYSTEM, NO and YES.
+# The default value is: SYSTEM.
CASE_SENSE_NAMES = NO
@@ -849,11 +892,26 @@ WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = NO
+# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about
+# undocumented enumeration values. If set to NO, doxygen will accept
+# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: NO.
+
+WARN_IF_UNDOC_ENUM_VAL = NO
+
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
# at the end of the doxygen process doxygen will return with a non-zero status.
-# Possible values are: NO, YES and FAIL_ON_WARNINGS.
+# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves
+# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not
+# write the warning messages in between other messages but write them at the end
+# of a run, in case a WARN_LOGFILE is defined the warning messages will be
+# besides being in the defined file also be shown at the end of a run, unless
+# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case
+# the behavior will remain as with the setting FAIL_ON_WARNINGS.
+# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT.
# The default value is: NO.
WARN_AS_ERROR = NO
@@ -864,13 +922,27 @@ WARN_AS_ERROR = NO
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
+# See also: WARN_LINE_FORMAT
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
+# In the $text part of the WARN_FORMAT command it is possible that a reference
+# to a more specific place is given. To make it easier to jump to this place
+# (outside of doxygen) the user can define a custom "cut" / "paste" string.
+# Example:
+# WARN_LINE_FORMAT = "'vi $file +$line'"
+# See also: WARN_FORMAT
+# The default value is: at line $line of file $file.
+
+WARN_LINE_FORMAT = "at line $line of file $file"
+
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
-# error (stderr).
+# error (stderr). In case the file specified cannot be opened for writing the
+# warning and error messages are written to standard error. When as file - is
+# specified the warning and error messages are written to standard output
+# (stdout).
WARN_LOGFILE =
@@ -893,10 +965,21 @@ INPUT += .
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see:
# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
+# See also: INPUT_FILE_ENCODING
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify
+# character encoding on a per file pattern basis. Doxygen will compare the file
+# name with each pattern and apply the encoding instead of the default
+# INPUT_ENCODING) if there is a match. The character encodings are a list of the
+# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding
+# "INPUT_ENCODING" for further information on supported encodings.
+
+INPUT_FILE_ENCODING =
+
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories.
@@ -978,10 +1061,7 @@ EXCLUDE_PATTERNS += yarvtest
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
+# ANamespace::AClass, ANamespace::*Test
EXCLUDE_SYMBOLS =
@@ -1026,6 +1106,11 @@ IMAGE_PATH = <%=srcdir%>/doc/images
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
#
+# Note that doxygen will use the data processed and written to standard output
+# for further processing, therefore nothing else, like debug statements or used
+# commands (so in case of a Windows batch file always use @echo OFF), should be
+# written to standard output.
+#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
@@ -1067,6 +1152,15 @@ FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE =
+# The Fortran standard specifies that for fixed formatted Fortran code all
+# characters from position 72 are to be considered as comment. A common
+# extension is to allow longer lines before the automatic comment starts. The
+# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can
+# be processed before the automatic comment starts.
+# Minimum value: 7, maximum value: 10000, default value: 72.
+
+FORTRAN_COMMENT_AFTER = 72
+
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
@@ -1164,10 +1258,11 @@ VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = YES
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
+# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
+# that should be ignored while generating the index headers. The IGNORE_PREFIX
+# tag works for classes, function and member names. The entity will be placed in
+# the alphabetical list under the first letter of the entity name that remains
+# after removing the prefix.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
@@ -1246,7 +1341,12 @@ HTML_STYLESHEET =
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra style sheet files is of importance (e.g. the last
# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
+# list).
+# Note: Since the styling of scrollbars can currently not be overruled in
+# Webkit/Chromium, the styling will be left out of the default doxygen.css if
+# one or more extra stylesheets have been specified. So if scrollbar
+# customization is desired it has to be added explicitly. For an example see the
+# documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
@@ -1261,6 +1361,19 @@ HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
+# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
+# should be rendered with a dark or light theme.
+# Possible values are: LIGHT always generate light mode output, DARK always
+# generate dark mode output, AUTO_LIGHT automatically set the mode according to
+# the user preference, use light mode if no preference is set (the default),
+# AUTO_DARK automatically set the mode according to the user preference, use
+# dark mode if no preference is set and TOGGLE allow to user to switch between
+# light and dark mode via a button.
+# The default value is: AUTO_LIGHT.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE = AUTO_LIGHT
+
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
# this color. Hue is specified as an angle on a color-wheel, see
@@ -1291,15 +1404,6 @@ HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = NO
-
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via JavaScript. If disabled, the navigation index will
@@ -1449,6 +1553,16 @@ BINARY_TOC = NO
TOC_EXPAND = NO
+# The SITEMAP_URL tag is used to specify the full URL of the place where the
+# generated documentation will be placed on the server by the user during the
+# deployment of the documentation. The generated sitemap is called sitemap.xml
+# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL
+# is specified no sitemap is generated. For information about the sitemap
+# protocol see https://www.sitemaps.org
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SITEMAP_URL =
+
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
@@ -1566,7 +1680,7 @@ GENERATE_TREEVIEW = NO
# area (value NO) or if it should extend to the full height of the window (value
# YES). Setting this to YES gives a layout similar to
# https://docs.readthedocs.io with more room for contents, but less room for the
-# project logo, title, and description. If either GENERATOR_TREEVIEW or
+# project logo, title, and description. If either GENERATE_TREEVIEW or
# DISABLE_INDEX is set to NO, this option has no effect.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1597,6 +1711,13 @@ TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
+# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email
+# addresses.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+OBFUSCATE_EMAILS = YES
+
# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
@@ -1617,17 +1738,6 @@ HTML_FORMULA_FORMAT = png
FORMULA_FONTSIZE = 10
-# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
# to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details.
@@ -1941,9 +2051,16 @@ PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help.
+# The LATEX_BATCHMODE tag ignals the behavior of LaTeX in case of an error.
+# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch
+# mode nothing is printed on the terminal, errors are scrolled as if <return> is
+# hit at every error; missing files that TeX tries to input or request from
+# keyboard input (\read on a not open input stream) cause the job to abort,
+# NON_STOP In nonstop mode the diagnostic message will appear on the terminal,
+# but there is no possibility of user interaction just like in batch mode,
+# SCROLL In scroll mode, TeX will stop only for missing files to input or if
+# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at
+# each error, asking for user intervention.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1964,14 +2081,6 @@ LATEX_HIDE_INDICES = NO
LATEX_BIB_STYLE = plain
-# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_TIMESTAMP = NO
-
# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
# path from which the emoji images will be read. If a relative path is entered,
# it will be relative to the LATEX_OUTPUT directory. If left blank the
@@ -2137,7 +2246,7 @@ DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures
# the structure of the code including all documentation. Note that this feature
# is still experimental and incomplete at the moment.
# The default value is: NO.
@@ -2218,7 +2327,8 @@ SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
-# preprocessor.
+# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of
+# RECURSIVE has no effect here.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
@@ -2249,10 +2359,6 @@ PREDEFINED += DEPRECATED(_)=_
PREDEFINED += DEPRECATED_BY(__,_)=_
PREDEFINED += ENUM_OVER_INT=1
PREDEFINED += ERRORFUNC(__,_)=_
-PREDEFINED += RJIT_FUNC_EXPORTED=
-PREDEFINED += RJIT_STATIC=extern
-PREDEFINED += RJIT_SYMBOL_EXPORT_BEGIN=
-PREDEFINED += RJIT_SYMBOL_EXPORT_END=
PREDEFINED += NOINLINE(_)=_
PREDEFINED += NORETURN(_)=_
PREDEFINED += PACKED_STRUCT_UNALIGNED(_)=_
@@ -2352,16 +2458,9 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to diagram generator tools
#---------------------------------------------------------------------------
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH =
-
# If set to YES the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
@@ -2370,7 +2469,7 @@ HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
@@ -2387,37 +2486,51 @@ HAVE_DOT = <%= have_dot %>
DOT_NUM_THREADS = 0
-# When you want a differently looking font in the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
+# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of
+# subgraphs. When you want a differently looking font in the dot files that
+# doxygen generates you can specify fontname, fontcolor and fontsize attributes.
+# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node,
+# Edge and Graph Attributes specification</a> You need to make sure dot is able
+# to find the font, which can be done by putting it in a standard location or by
+# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font. Default graphviz fontsize is 14.
+# The default value is: fontname=Helvetica,fontsize=10.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTNAME = FreeSans
+DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10"
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
+# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can
+# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a
+# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about
+# arrows shapes.</a>
+# The default value is: labelfontname=Helvetica,labelfontsize=10.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTSIZE = 10
+DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10"
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
+# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes
+# around nodes set 'shape=plain' or 'shape=plaintext' <a
+# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a>
+# The default value is: shape=box,height=0.2,width=0.4.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4"
+
+# You can set the path where dot can find font specified with fontname in
+# DOT_COMMON_ATTR and others dot attributes.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
-# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a
-# graph for each documented class showing the direct and indirect inheritance
-# relations. In case HAVE_DOT is set as well dot will be used to draw the graph,
-# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set
-# to TEXT the direct and indirect inheritance relations will be shown as texts /
-# links.
-# Possible values are: NO, YES, TEXT and GRAPH.
+# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will
+# generate a graph for each documented class showing the direct and indirect
+# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and
+# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case
+# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the
+# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used.
+# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance
+# relations will be shown as texts / links.
+# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN.
# The default value is: YES.
CLASS_GRAPH = NO
@@ -2432,7 +2545,8 @@ CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
+# groups, showing the direct groups dependencies. See also the chapter Grouping
+# in the manual.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
@@ -2557,7 +2671,7 @@ DIR_GRAPH_MAX_DEPTH = 1
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. For an explanation of the image formats see the section
# output formats in the documentation of the dot tool (Graphviz (see:
-# http://www.graphviz.org/)).
+# https://www.graphviz.org/)).
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
@@ -2594,11 +2708,12 @@ DOT_PATH =
DOTFILE_DIRS =
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
-MSCFILE_DIRS =
+DIA_PATH =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
@@ -2607,10 +2722,10 @@ MSCFILE_DIRS =
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
+# path where java can find the plantuml.jar file or to the filename of jar file
+# to be used. If left blank, it is assumed PlantUML is not used or called during
+# a preprocessing step. Doxygen will generate a warning when it encounters a
+# \startuml command in this case and will not generate output for the diagram.
PLANTUML_JAR_PATH =
@@ -2648,18 +2763,6 @@ DOT_GRAPH_MAX_NODES = 128
MAX_DOT_GRAPH_DEPTH = 0
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT = NO
-
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
@@ -2672,6 +2775,8 @@ DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
+# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal
+# graphical representation for inheritance and collaboration diagrams is used.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
@@ -2685,3 +2790,19 @@ GENERATE_LEGEND = YES
# The default value is: YES.
DOT_CLEANUP = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will
+# use a built-in version of mscgen tool to produce the charts. Alternatively,
+# the MSCGEN_TOOL tag can also specify the name an external tool. For instance,
+# specifying prog as the value, doxygen will call the tool as prog -T
+# <outfile_format> -o <outputfile> <inputfile>. The external tool should support
+# output file formats "png", "eps", "svg", and "ismap".
+
+MSCGEN_TOOL =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
diff --git a/template/GNUmakefile.in b/template/GNUmakefile.in
index 0c7f4e9dd0..452e7cdeef 100644
--- a/template/GNUmakefile.in
+++ b/template/GNUmakefile.in
@@ -1,10 +1,14 @@
gnumake = yes
+ifneq ($(filter notintermediate,$(.FEATURES)),)
+DOT_WAIT = .WAIT
+endif
+
ifeq ($(filter Makefile,$(MAKEFILE_LIST)),)
include Makefile
+endif
GNUmakefile: $(srcdir)/template/GNUmakefile.in
-endif
override silence := $(if $(findstring s,$(firstword $(MFLAGS))),yes,no)
@@ -14,10 +18,6 @@ endif
override order_only := |
-ifneq ($(filter notintermediate,$(.FEATURES)),)
-DOT_WAIT = .WAIT
-endif
-
# Needs the dependency when any Unicode tables data files exist.
override UNICODE_TABLES_DEPENDENTS = \
$(if $(or \
@@ -27,7 +27,8 @@ override UNICODE_TABLES_DEPENDENTS = \
$(UNICODE_TABLES_DATA_FILES)))),\
force,none)
+# extract NMake-style include list
+$(eval common_mk_includes := $(shell sed -n 's/^!include *//p' $(srcdir)/common.mk))
+
-include uncommon.mk
include $(srcdir)/defs/gmake.mk
-
-GNUmakefile: $(srcdir)/template/GNUmakefile.in
diff --git a/template/Makefile.in b/template/Makefile.in
index 7b7fbd4c9e..0b7b50e3aa 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -29,7 +29,7 @@ CPP = @CPP@
LD = @LD@
RUSTC = @RUSTC@
CARGO = @CARGO@
-YACC = bison
+LRAMA = $(BASERUBY) $(tooldir)/lrama/exe/lrama
PURIFY =
AUTOCONF = autoconf
CONFIGURE = @CONFIGURE@
@@ -65,6 +65,10 @@ rubyarchhdrdir = @rubyarchhdrdir@
ruby_version = @ruby_version@
RUBY_VERSION_NAME = @RUBY_VERSION_NAME@
UNIVERSAL_ARCHNAMES = @UNIVERSAL_ARCHNAMES@
+BUILTIN_BINARY = @X_BUILTIN_BINARY@
+
+BUILTIN_GC = default
+modular_gc_dir = @modular_gc_dir@
TESTUI = console
TESTS =
@@ -73,7 +77,8 @@ DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
EXTOUT = @EXTOUT@
TIMESTAMPDIR = $(EXTOUT)/.timestamp
-arch_hdrdir = $(EXTOUT)/include/$(arch)
+ext_hdrdir = $(EXTOUT)/include
+arch_hdrdir = $(ext_hdrdir)/$(arch)
VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/missing
empty =
@@ -88,26 +93,32 @@ cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
warnflags = @warnflags@ @strict_warnflags@
+hardenflags = @hardenflags@
cppflags = @cppflags@
+incflags = @incflags@
RUBY_DEVEL = @RUBY_DEVEL@ # "yes" or empty
_RUBY_DEVEL_enabled = $(RUBY_DEVEL:no=)
-XCFLAGS = @XCFLAGS@ $(INCFLAGS) $(_RUBY_DEVEL_enabled:yes=-DRUBY_DEVEL=1)
+XCFLAGS = @XCFLAGS@ $(INCFLAGS) $(_RUBY_DEVEL_enabled:yes=-DRUBY_DEVEL=1) -Dmodular_gc_dir="$(modular_gc_dir)"
USE_RUBYGEMS = @USE_RUBYGEMS@
USE_RUBYGEMS_ = $(USE_RUBYGEMS:yes=)
CPPFLAGS = @CPPFLAGS@ $(USE_RUBYGEMS_:no=-DDISABLE_RUBYGEMS=1)
-RJIT_SUPPORT = @RJIT_SUPPORT@
-RJIT_CC = @RJIT_CC@
-RJIT_CFLAGS = @RJIT_CFLAGS@
-RJIT_OPTFLAGS = @RJIT_OPTFLAGS@
-RJIT_DEBUGFLAGS = @RJIT_DEBUGFLAGS@
-RJIT_LDSHARED = @RJIT_LDSHARED@
-RJIT_DLDFLAGS = $(XDLDFLAGS)
+TOP_BUILD_DIR=@abs_top_builddir@
+JIT_OBJ=@JIT_OBJ@
YJIT_SUPPORT=@YJIT_SUPPORT@
YJIT_LIBS=@YJIT_LIBS@
YJIT_OBJ=@YJIT_OBJ@
-YJIT_LIBOBJ = $(YJIT_LIBS:.a=.@OBJEXT@)
-CARGO_TARGET_DIR=@abs_top_builddir@/yjit/target
+ZJIT_SUPPORT=@ZJIT_SUPPORT@
+ZJIT_LIBS=@ZJIT_LIBS@
+ZJIT_OBJ=@ZJIT_OBJ@
+JIT_CARGO_SUPPORT=@JIT_CARGO_SUPPORT@
+CARGO_TARGET_DIR=@abs_top_builddir@/target
CARGO_BUILD_ARGS=@CARGO_BUILD_ARGS@
+ZJIT_TEST_FEATURES=@ZJIT_TEST_FEATURES@
+JIT_RUST_FLAGS=@JIT_RUST_FLAGS@
+RUSTC_FLAGS=@RUSTC_FLAGS@
+RLIB_DIR=@RLIB_DIR@
+RUST_LIB=@RUST_LIB@
+RUST_LIBOBJ = $(RUST_LIB:.a=.@OBJEXT@)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
EXE_LDFLAGS = $(LDFLAGS)
EXTLDFLAGS = @EXTLDFLAGS@
@@ -132,6 +143,9 @@ BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
POSTLINK = @POSTLINK@
+LIBPATHENV = @LIBPATHENV@
+PRELOADENV = @PRELOADENV@
+
RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_API_VERSION=@RUBY_API_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
@@ -199,7 +213,8 @@ DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
string.$(OBJEXT) \
symbol.$(OBJEXT) \
vm.$(OBJEXT) \
- $(YJIT_OBJ)
+ $(YJIT_OBJ) \
+ $(ZJIT_OBJ)
THREAD_MODEL = @THREAD_MODEL@
@@ -225,7 +240,6 @@ AR = @AR@
ARFLAGS = @ARFLAGS@$(empty)
RANLIB = @RANLIB@
AS = @AS@
-ASFLAGS = @ASFLAGS@ $(ARCH_FLAG) $(INCFLAGS)
IFCHANGE = $(SHELL) $(tooldir)/ifchange
OBJDUMP = @OBJDUMP@
OBJCOPY = @OBJCOPY@
@@ -250,7 +264,6 @@ INSTALLED_LIST= .installed.list
NEWLINE_C = enc/trans/newline.c
MINIPRELUDE_C = miniprelude.c
-GOLF_PRELUDE_C= golf_prelude.c
RBCONFIG = .rbconfig.time
MAINSRC = $(MAINOBJ:.$(OBJEXT)=.c)
@@ -270,6 +283,8 @@ ACTIONS_ENDGROUP = @$(NULLCMD)
DESTDIR = @DESTDIR@
+cleanlibs = @cleanlibs@
+
configure_args = @configure_args@
#### End of variables
@@ -277,6 +292,8 @@ ABI_VERSION_HDR = $(hdrdir)/ruby/internal/abi.h
CAT_DEPEND = sed -e 's/{\$$([^(){}]*)[^{}]*}//g' -e /AUTOGENERATED/q
+HASH_SIGN = \#
+
.SUFFIXES: .inc .h .c .y .i .$(ASMEXT) .$(DTRACE_EXT)
all:
@@ -291,13 +308,13 @@ all:
miniruby$(EXEEXT):
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(MAINLIBS) $(OUTFLAG)$@
$(Q) $(POSTLINK)
$(PROGRAM):
@$(RM) $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(EXTLIBS) $(OUTFLAG)$@
$(Q) $(POSTLINK)
$(PROGRAM): @XRUBY_LIBPATHENV_WRAPPER@
@@ -307,8 +324,6 @@ PRE_LIBRUBY_UPDATE = [ -n "$(LIBRUBY_SO_UPDATE)" ] || $(gnumake:yes=exec) $(RM)
# We must `rm' the library each time this rule is invoked because "updating" a
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
# supported.
-#
-# In YJIT builds, merge libyjit.a with libruby_static.a
$(LIBRUBY_A):
@$(RM) $@
@-[ -z "$(EXTSTATIC)" ] || $(PRE_LIBRUBY_UPDATE)
@@ -318,14 +333,15 @@ $(LIBRUBY_A):
verify-static-library: $(LIBRUBY_A)
$(ECHO) verifying static-library $@
- @$(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
+ @$(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(OUTFLAG)conftest$(EXEEXT)
@$(RMALL) conftest$(EXEEXT) conftest.c conftest.dSYM
$(LIBRUBY_SO):
@-[ -n "$(EXTSTATIC)" ] || $(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
$(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
- -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)InitVM_*' \
+ -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
-L '$(SYMBOL_PREFIX)*_threadptr_*' -L '$(SYMBOL_PREFIX)*_ec_*' $@
$(Q) $(POSTLINK)
@-$(MINIRUBY) -e 'so, *aliases = ARGV; aliases.uniq!; aliases.delete(File.basename(so)); \
@@ -338,13 +354,46 @@ $(LIBRUBY_$(LIBRUBY_WITH_EXT)): $(LIBRUBY_SO_UPDATE)
PKG_CONFIG = @PKG_CONFIG@
ruby_pc = @ruby_pc@
$(ruby_pc): config.status Makefile
- $(Q)./config.status --file=-:$(srcdir)/template/ruby.pc.in | \
+ $(Q) \
+ pkg="$(@libdirname@)/pkgconfig" prefix="$(prefix)"; \
+ if [ "$(LIBRUBY_RELATIVE)" = yes ]; then \
+ case "$$pkg" in "$$prefix"/?*) \
+ pkg="$${pkg#$$prefix/}"; \
+ prefix='$${pcfiledir}'`echo "/$${pkg}" | sed -e 's|/[^/][^/]*|/..|g'`; \
+ esac; \
+ fi; \
+ ./config.status --file=-:$(srcdir)/template/ruby.pc.in | \
sed -e 's/\$$(\([A-Za-z_][A-Za-z0-9_]*\))/$${\1}/g' \
- -e 's|^prefix=.*|prefix=$(prefix)|' \
+ -e "s|^prefix=.*|prefix=$$prefix|" \
> ruby.tmp.pc
$(Q)pkg_config=${PKG_CONFIG} && PKG_CONFIG_PATH=. $${pkg_config:-:} --print-errors ruby.tmp
$(Q)$(MV) -f ruby.tmp.pc $(ruby_pc)
+test-pc: install-data
+ set -ex; \
+ [ -z "$${pkg_config=$(PKG_CONFIG)}" ] && exit; \
+ export PKG_CONFIG_PATH=$(DESTDIR)/$(libdir)/pkgconfig$${PKG_CONFIG_PATH:+:$$PKG_CONFIG_PATH}; \
+ $${pkg_config} --exists $(ruby_pc:.pc=); \
+ path=`$${pkg_config} --variable=prefix $(ruby_pc:.pc=)`; \
+ if [ "$(LIBRUBY_RELATIVE)" = yes ]; then \
+ test "$$path" -ef "$(DESTDIR)$(prefix)"; \
+ else \
+ test "$$path" = "$(prefix)"; \
+ fi
+
+install-data: pkgconfig-data pre-install-data do-install-data post-install-data
+pre-install-data:: install-prereq
+do-install-data: $(PREP) pre-install-data
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=data
+post-install-data::
+ @$(NULLCMD)
+
+modular-gc-precheck:
+ $(Q) if test -z $(modular_gc_dir); then \
+ echo "You must configure with --with-modular-gc to use modular GC"; \
+ exit 1; \
+ fi
+
pre-install-local:: pkgconfig-data
ruby-runner.h: template/ruby-runner.h.in config.status
@@ -357,7 +406,7 @@ install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/confi
$(Q) sed '/^\$$:\.unshift/q' $(arch)-fake.rb > fake.rb
$(Q) $(BASERUBY) -p \
-e '~/^\s*CONFIG\["LDFLAGS"\]/ and' \
- -e '$$_[/(?=\s*"$$)/] = %q[ #{(CONFIG["LIBPATHFLAG"]%File.dirname(__FILE__)).strip}]' \
+ -e '$$_[/(?=\s*"$$)/] = %q[ #{CONFIG["LIBPATHFLAG"]%File.dirname(__FILE__)}]' \
rbconfig.rb > fake-rbconfig.rb
$(INSTALL_SCRIPT) fake.rb $(XRUBY_RUBYLIBDIR)/$(arch)/fake.rb
$(INSTALL_SCRIPT) fake-rbconfig.rb $(XRUBY_RUBYLIBDIR)/$(arch)/rbconfig.rb
@@ -381,8 +430,8 @@ $(MKFILES): config.status $(srcdir)/version.h $(ABI_VERSION_HDR)
$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
{ echo "$@ updated, restart."; exit 1; }
-uncommon.mk: $(srcdir)/common.mk
- sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
+uncommon.mk: $(srcdir)/tool/prereq.status
+ sed -f $(srcdir)/tool/prereq.status $(srcdir)/common.mk $(common_mk_includes) > $@
.PHONY: reconfig
reconfig-args = $(srcdir)/$(CONFIGURE) $(yes_silence:yes=--silent) $(configure_args)
@@ -417,7 +466,7 @@ lex.c: defs/keywords
$(CP) $(srcdir)/lex.c.blt $@; \
else \
[ $(Q) ] && echo generating $@ || set -x; \
- gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? \
+ gperf -C -L ANSI-C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? \
| sed -f $(tooldir)/gperf.sed \
> $@.tmp && \
$(MV) $@.tmp $@ && \
@@ -425,7 +474,7 @@ lex.c: defs/keywords
$(CP) $@ $(srcdir)/lex.c.blt; \
fi
-JIS_PROPS_OPTIONS = -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property
+JIS_PROPS_OPTIONS = -L ANSI-C -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property
$(srcdir)/enc/jis/props.h: enc/jis/props.kwd
$(MAKEDIRS) $(@D)
@@ -441,13 +490,19 @@ $(srcdir)/enc/jis/props.h: enc/jis/props.kwd
$(CP) $@ $(?:.kwd=.h.blt); \
fi
+gc_impl.$(OBJEXT): gc/$(BUILTIN_GC).c probes.h
+ @$(ECHO) compiling $(srcdir)/gc/$(BUILTIN_GC).c
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(srcdir)/gc/$(BUILTIN_GC).c
+
.c.$(OBJEXT):
@$(ECHO) compiling $<
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
+PREFIXED_SYMBOL = name
+_PREFIXED_SYMBOL = TOKEN_PASTE($(SYMBOL_PREFIX),name)
.$(ASMEXT).$(OBJEXT):
@$(ECHO) assembling $<
- $(Q) $(CC) $(ASFLAGS) -DSYMBOL_PREFIX=$(SYMBOL_PREFIX) -o $@ -c $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ "-DPREFIXED_SYMBOL(name)=$($(SYMBOL_PREFIX)PREFIXED_SYMBOL)" -c $<
.c.$(ASMEXT):
@$(ECHO) translating $<
@@ -459,7 +514,7 @@ $(srcdir)/enc/jis/props.h: enc/jis/props.kwd
.d.h:
@$(ECHO) translating probes $<
- $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $<
+ $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) $(CPPFLAGS) -s $<
$(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/RUBY_PROBES_H/' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
$(Q) $(RM) $@.tmp
@@ -477,8 +532,9 @@ probes.stamp: $(DTRACE_REBUILD_OBJS)
probes.$(OBJEXT): $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp)
@$(ECHO) processing probes in object files
- $(Q) $(RM) $@
- $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
+ @# n.b. the dtrace script looks at the $CFLAGS environment variable to decide
+ @# how to assemble probes.o; so we need to actually _export_ $(CFLAGS)
+ $(Q) CC="$(CC)" CFLAGS="$(CFLAGS) $(XCFLAGS) $(CPPFLAGS)" $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
# DTrace static library hacks described here:
# https://marc.info/?l=opensolaris-dtrace-discuss&m=114761203110734&w=4
@@ -492,8 +548,8 @@ clean-local::
enc/encinit.c enc/encinit.$(OBJEXT) $(pkgconfig_DATA) \
ruby-runner.$(OBJEXT) ruby-runner.h \
|| $(NULLCMD)
- $(Q)find . \( -name '*.bc' -o -name '*.[is]' \) -delete
- -$(Q)$(RMALL) exe/ *.dSYM
+ $(Q)find . ! -type d \( -name '*.bc' -o -name '*.[is]' \) -exec rm -f {} + || true
+
distclean-local::
$(Q)$(RM) \
@@ -516,9 +572,9 @@ ext/realclean:: ext/realclean.sub
.bundle/distclean:: .bundle/distclean.sub
.bundle/realclean:: .bundle/realclean.sub
-ext/clean.sub .bundle/clean.sub:: ext/clean.mk
-ext/distclean.sub .bundle/distclean.sub:: ext/distclean.mk
-ext/realclean.sub .bundle/realclean.sub:: ext/realclean.mk
+.bundle/clean.sub:: ext/clean.mk
+.bundle/distclean.sub:: ext/distclean.mk
+.bundle/realclean.sub:: ext/realclean.mk
ext/clean.sub ext/distclean.sub ext/realclean.sub \
.bundle/clean.sub .bundle/distclean.sub .bundle/realclean.sub::
@@ -544,6 +600,15 @@ ext/distclean ext/realclean .bundle/distclean .bundle/realclean::
find "$$@" -type d -empty -exec $(RMDIRS) {} + 2> /dev/null || true
$(Q) $(RMDIRS) $(@D) 2> /dev/null || true
+.bundle/realclean::
+ @$(RMALL) $(tooldir)/bunlder/*.lock $(srcdir)/.bundle
+
+gc/clean gc/distclean gc/realclean::
+ - $(CHDIR) gc 2> /dev/null && for gc in */; do ($(CHDIR) $$gc && exec $(MAKE) TARGET_SO_DIR=./ $(@F)); done || $(NULLCMD)
+
+gc/distclean gc/realclean::
+ - $(CHDIR) gc 2> /dev/null && for gc in */; do $(RMDIR) $$gc; done || $(NULLCMD)
+
clean-enc distclean-enc realclean-enc:
@test -f "$(ENC_MK)" || exit 0; \
echo $(@:-enc=ing) encodings; \
@@ -576,10 +641,19 @@ update-benchmark-driver:
$(BENCHMARK_DRIVER_GIT_URL) benchmark-driver $(GIT_OPTS)
update-known-errors:
- errno --list | cut -d' ' -f1 | sort -u - $(srcdir)/defs/known_errors.def | \
+ errno --list | \
+ $(BASERUBY) -nl -e 'BEGIN {errs = {}}' \
+ -e '/^(E[A-Z_0-9]+)(?: +(?:\d+ +)?(.+))?/ =~ $$_ && errs[$$1] ||= $$2' \
+ -e 'END {' \
+ -e 'errs.delete("ELAST")' \
+ -e 'errs = errs.sort' \
+ -e 'errs << ["ELAST", "Largest errno"]' \
+ -e 'errs.each {|e,d| puts sprintf("%-15s %s", e, d).strip}' \
+ -e '}' \
+ $(srcdir)/defs/known_errors.def - | \
$(IFCHANGE) $(srcdir)/defs/known_errors.def -
-INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
+INSNS = optinsn.inc optunifs.inc insns.inc insns_info.inc \
vmtc.inc vm.inc
$(INSNS): $(srcdir)/insns.def vm_opts.h \
@@ -594,13 +668,14 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(tooldir)/ruby_vm/loaders/opt_operand_def.rb \
$(tooldir)/ruby_vm/loaders/vm_opts_h.rb \
$(tooldir)/ruby_vm/models/attribute.rb \
- $(tooldir)/ruby_vm/models/bare_instructions.rb \
+ $(tooldir)/ruby_vm/models/bare_instruction.rb \
$(tooldir)/ruby_vm/models/c_expr.rb \
$(tooldir)/ruby_vm/models/instructions.rb \
- $(tooldir)/ruby_vm/models/instructions_unifications.rb \
- $(tooldir)/ruby_vm/models/operands_unifications.rb \
- $(tooldir)/ruby_vm/models/trace_instructions.rb \
+ $(tooldir)/ruby_vm/models/instructions_unification.rb \
+ $(tooldir)/ruby_vm/models/operands_unification.rb \
+ $(tooldir)/ruby_vm/models/trace_instruction.rb \
$(tooldir)/ruby_vm/models/typemap.rb \
+ $(tooldir)/ruby_vm/models/zjit_instruction.rb \
$(tooldir)/ruby_vm/scripts/converter.rb \
$(tooldir)/ruby_vm/scripts/insns2vm.rb \
$(tooldir)/ruby_vm/views/_attributes.erb \
@@ -608,18 +683,18 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(tooldir)/ruby_vm/views/_comptime_insn_stack_increase.erb \
$(tooldir)/ruby_vm/views/_copyright.erb \
$(tooldir)/ruby_vm/views/_insn_entry.erb \
+ $(tooldir)/ruby_vm/views/_insn_leaf_info.erb \
$(tooldir)/ruby_vm/views/_insn_len_info.erb \
$(tooldir)/ruby_vm/views/_insn_name_info.erb \
$(tooldir)/ruby_vm/views/_insn_operand_info.erb \
- $(tooldir)/ruby_vm/views/_insn_sp_pc_dependency.erb \
$(tooldir)/ruby_vm/views/_insn_type_chars.erb \
$(tooldir)/ruby_vm/views/_leaf_helpers.erb \
$(tooldir)/ruby_vm/views/_notice.erb \
$(tooldir)/ruby_vm/views/_sp_inc_helpers.erb \
$(tooldir)/ruby_vm/views/_trace_instruction.erb \
+ $(tooldir)/ruby_vm/views/_zjit_instruction.erb \
$(tooldir)/ruby_vm/views/insns.inc.erb \
$(tooldir)/ruby_vm/views/insns_info.inc.erb \
- $(tooldir)/ruby_vm/views/opt_sc.inc.erb \
$(tooldir)/ruby_vm/views/optinsn.inc.erb \
$(tooldir)/ruby_vm/views/optunifs.inc.erb \
$(tooldir)/ruby_vm/views/vm.inc.erb \
@@ -636,6 +711,45 @@ un-runnable:
$(ECHO) cannot make runnable, configure with --enable-load-relative.
$(Q) exit 1
-# yes-test-basic: leaked-globals
-leaked-globals: $(COMMONOBJS) prog $(tooldir)/leaked-globals PHONY
- $(Q) $(XRUBY) $(tooldir)/leaked-globals NM="$(NM) -Pgp" SYMBOL_PREFIX=$(SYMBOL_PREFIX) PLATFORM=$(hdrdir)/ruby/$(PLATFORM_DIR).h $(srcdir)/configure.ac $(COMMONOBJS)
+LIBRUBY_FOR_LEAKED_GLOBALS = $(enable_shared:no=)
+yes-test-basic: $(DOT_WAIT) test-leaked-globals
+leaked-globals: test-leaked-globals
+yes-test-leaked-globals-precheck: $(COMMONOBJS) prog $(tooldir)/leaked-globals
+test-leaked-globals: yes-test-leaked-globals
+yes-test-leaked-globals: yes-test-leaked-globals-precheck
+ $(ACTIONS_GROUP)
+ $(Q) $(XRUBY) $(tooldir)/leaked-globals \
+ SOEXT=$(SOEXT) NM="$(NM) -Pgp" SYMBOL_PREFIX=$(SYMBOL_PREFIX) \
+ SYMBOLS_IN_EMPTYLIB="@XSYMBOLS_IN_EMPTYLIB@" \
+ EXTSTATIC="$(EXTSTATIC)" \
+ PLATFORM=$(hdrdir)/ruby/$(PLATFORM_DIR).h $(srcdir)/configure.ac \
+ $(COMMONOBJS) $(LIBRUBY_FOR_LEAKED_GLOBALS:yes=$(LIBRUBY_SO))
+ $(ACTIONS_ENDGROUP)
+
+test-syntax-suggest-precheck: $(TEST_RUNNABLE)-test-syntax-suggest-precheck
+no-test-syntax-suggest-precheck:
+yes-test-syntax-suggest-precheck: main
+
+test-syntax-suggest-prepare: $(TEST_RUNNABLE)-test-syntax-suggest-prepare
+no-test-syntax-suggest-prepare: no-test-syntax-suggest-precheck
+yes-test-syntax-suggest-prepare: yes-test-syntax-suggest-precheck
+ $(ACTIONS_GROUP)
+ $(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
+ --install-dir .bundle --conservative "rspec:~> 3"
+ $(ACTIONS_ENDGROUP)
+
+RSPECOPTS =
+SYNTAX_SUGGEST_SPECS =
+PREPARE_SYNTAX_SUGGEST = $(TEST_RUNNABLE)-test-syntax-suggest-prepare
+test-syntax-suggest: $(TEST_RUNNABLE)-test-syntax-suggest
+yes-test-syntax-suggest: $(PREPARE_SYNTAX_SUGGEST)
+ $(ACTIONS_GROUP)
+ $(XRUBY) -C $(srcdir) -Ispec/syntax_suggest:spec/lib .bundle/bin/rspec \
+ --require rspec/expectations \
+ --require spec_helper --require formatter_overrides --require spec_coverage \
+ $(RSPECOPTS) spec/syntax_suggest/$(SYNTAX_SUGGEST_SPECS)
+ $(ACTIONS_ENDGROUP)
+no-test-syntax-suggest:
+
+yesterday:
+ $(GIT_IN_SRC) reset --hard `TZ=UTC-9 $(GIT_LOG_FORMAT)%H -1 --before=00:00`
diff --git a/template/builtin_binary.inc.tmpl b/template/builtin_binary.rbbin.tmpl
index 2c2f071705..df835bbbf9 100644
--- a/template/builtin_binary.inc.tmpl
+++ b/template/builtin_binary.rbbin.tmpl
@@ -1,23 +1,28 @@
// -*- c -*-
// DO NOT MODIFY THIS FILE DIRECTLY.
// auto-generated file by tool/generic_erb.rb
-// with template/builtin_binary.inc.tmpl
+// with template/builtin_binary.rbbin.tmpl
% unless ARGV.include?('--cross=yes')
% ary = RubyVM.enum_for(:each_builtin).to_a
% ary.each{|feature, iseq|
+% bin = iseq.to_binary
-static const unsigned char <%= feature %>_bin[] = {
-% iseq \
-% . to_binary \
+static const union {
+ unsigned char binary[<%= bin.bytesize %>];
+ uint32_t align_as_ibf_header;
+} <%= feature %>_builtin = {
+ .binary = {
+% bin \
% . each_byte \
% . each_slice(12) {|a|
- <%= a.map{ '0x%02x,' % _1 }.join(' ') %>
+ <%= a.map{ '0x%02x,' % _1 }.join(' ') %>
% }
+ }
};
% }
#define BUILTIN_BIN(feature) \
- { #feature, feature ## _bin, sizeof(feature ## _bin), }
+ { #feature, feature ## _builtin.binary, sizeof(feature ## _builtin.binary), }
static const struct builtin_binary builtin_binary[] = {
% ary.each{|feature, |
BUILTIN_BIN(<%= feature %>),
diff --git a/template/configure-ext.mk.tmpl b/template/configure-ext.mk.tmpl
index 8ba6b963e3..cabdb652fd 100644
--- a/template/configure-ext.mk.tmpl
+++ b/template/configure-ext.mk.tmpl
@@ -23,7 +23,7 @@ exts = {}
end
%>
MINIRUBY = <%=miniruby%>
-SCRIPT_ARGS = <%=script_args.gsub("#", "\\#")%>
+SCRIPT_ARGS = <%=script_args.gsub("#", "\\#").gsub(/\A|[\s"']\K--jobserver-auth=[^\s'"]*/, "")%>
EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
--make-flags="MINIRUBY='$(MINIRUBY)'"
@@ -33,7 +33,9 @@ gems:
% exts.each do |t, (o, dirs)|
% dirs.each do |d|
-% next if Dir.glob("#{srcdir}/#{d}/**/extconf.rb").empty?
+% extconf = Dir.glob("#{srcdir}/#{d}/**/extconf.rb")
+% next if extconf.empty?
+% next if extconf.any?{|f| f.include?(".bundle/gems") && f.include?("test") }
<%=t%>: <%=d%>/exts.mk
<%=d%>/exts.mk: FORCE
$(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make='$(MAKE)' \
diff --git a/template/encdb.h.tmpl b/template/encdb.h.tmpl
index 8e658f7985..fe6af95747 100644
--- a/template/encdb.h.tmpl
+++ b/template/encdb.h.tmpl
@@ -33,35 +33,27 @@ encdirs << 'enc' if encdirs.empty?
files = {}
encdirs.each do |encdir|
next unless File.directory?(encdir)
- Dir.open(encdir) {|d| d.grep(/.+\.[ch]\z/)}.sort_by {|e|
+ Dir.glob("*.[ch]", base: encdir).sort_by {|e|
e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
}.each do |fn|
next if files[fn]
files[fn] = true
- open(File.join(encdir,fn)) do |f|
+ File.open(File.join(encdir, fn)) do |f|
name = nil
- skip_ifndef_ruby = false
- encoding_def = false
f.each_line do |line|
- case line
- when /^#ifndef RUBY/
- skip_ifndef_ruby = true
- when /^#endif/
- skip_ifndef_ruby = false
- end
- next if skip_ifndef_ruby
- encoding_def = true if /^OnigEncodingDefine/ =~ line
- if encoding_def && /"(.*?)"/ =~ line
- encoding_def = false
- if name
- lines << %[ENC_SET_BASE("#$1", "#{name}");]
- else
- name = $1
+ if (/^#ifndef RUBY/ =~ line)..(/^#endif/ =~ line)
+ elsif /^OnigEncodingDefine/.match?(line)
+ if (n = f.gets("\n\};")[/"(.*?)"/, 1]) # swallow the initializer block
+ if name
+ lines << %[ENC_SET_BASE("#{n}", "#{name}");]
+ else
+ name = n
+ end
+ check_duplication(defs, n, fn, f.lineno)
+ next if BUILTIN_ENCODINGS[name]
+ encodings << n
+ count += 1
end
- check_duplication(defs, $1, fn, f.lineno)
- next if BUILTIN_ENCODINGS[name]
- encodings << $1
- count += 1
else
case line
when /^\s*rb_enc_register\(\s*"([^"]+)"/
diff --git a/template/extinit.c.tmpl b/template/extinit.c.tmpl
index 7a9c910633..e0b076b03c 100644
--- a/template/extinit.c.tmpl
+++ b/template/extinit.c.tmpl
@@ -1,5 +1,5 @@
%# -*- C -*-
-% extinits = ARGV.map {|n| [n[%r[[^/.]+(?=\.[^/]*)?\z]], n]}
+% extinits = ARGV.map {|n| [n.tr('/', '_'), n]}
#include "ruby/ruby.h"
#define init(func, name) { \
diff --git a/template/exts.mk.tmpl b/template/exts.mk.tmpl
index 29c29df37c..e482808f54 100644
--- a/template/exts.mk.tmpl
+++ b/template/exts.mk.tmpl
@@ -22,14 +22,19 @@ end
confexts &&= File.read(confexts).scan(/^(?:ext|gem)s: (.*\.mk)/).flatten rescue nil
confexts ||= []
macros["old_extensions"] = []
+distclean = []
contpat = /(?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*/
Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
gem = e.start_with?(".bundle/gems/")
+ dir = File.dirname(e)
s = File.read(e)
s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|MESSAGE_(?:BEGIN|END)|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v|
v.gsub!(/\\\n[ \t]*/, ' ')
- next if v.empty?
+ if v.empty?
+ distclean << dir if n == "extensions"
+ next
+ end
n = "old_extensions" if n == "extensions" and !confexts.include?(e)
v = v.split
m = macros[n] ||= []
@@ -69,6 +74,17 @@ Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e|
end
end
deps.uniq!
+macros["cleandirs"] = distclean.map {|d| "#{d}/."}
+deps.map! {|d|
+ /\A(?:dist|real)?clean(?=:)/ =~ d ? d + " $(cleandirs:/.=/#{$&})" : d
+}
+
+# NOTE: Only if extensions are configured as static and dynamic heterogeneously
+# (e.g. --with-static-linked-ext=foo or ext/Setup can mix static and dynamic
+# extensions), EXTOBJS may contain both extinit.o and dmyext.o. In such case,
+# prefer extinit.o, which does actual Init_${ext} function calls for statically
+# linked extensions, and drop dmyext.o, which does nothing but just to make the
+# linker happy.
if objs = macros["EXTOBJS"] and objs.any? {|e|e.start_with?("ext/extinit.")}
objs.delete_if {|e|e.start_with?("dmyext.")}
end
@@ -93,14 +109,15 @@ def self.column
@erbout[/^.*\z/].scan(/\t|([^\t]+)/) {|s,| w += (s ? s.size : 8 - w % 8)}
w
end
-targets = %w[all static install install-so install-rb clean distclean realclean]
objext = RbConfig::CONFIG["OBJEXT"]
+sep = RbConfig::CONFIG['BUILD_FILE_SEPARATOR']
+sep = nil if sep and sep.empty?
if gnumake
submake = "$(MAKE) -C $(@D)"
else
- submake = "cd $(@D) && "
- exec = RbConfig::CONFIG["exec"] and !exec.empty? and submake << exec << " "
- submake << "$(MAKE)"
+ submake = ["cd", (sep ? "$(@D:/=#{sep})" : "$(@D)"), "&&"]
+ exec = RbConfig::CONFIG["exec"] and !exec.empty? and submake << exec
+ submake = (submake << "$(MAKE)").join(" ")
mflags = " $(MFLAGS)"
end
-%>
@@ -138,24 +155,27 @@ ext/extinit.<%=objext%>:
% exts = (macros["extensions"] + macros["old_extensions"])
% exts.map! {|e|e.chomp("/.")}.sort
-% targets.each do |tgt|
+% %w[all static install install-so install-rb].each do |tgt|
% exts.each do |d|
-% t = "#{d}/#{tgt}"
-% if /^(dist|real)?clean$/ =~ tgt
-% deps = exts.select {|e|e.start_with?("#{d}/")}.map {|e|"#{e}/#{tgt}"}
-% pd = ' ' + deps.join(' ') unless deps.empty?
-% else
-% pext = File.dirname(d)
-% pd = " #{pext}/#{tgt}" if exts.include?(pext)
-% end
-<%=t%>:<%=pd%>
-% if /^(dist|real)clean$/ =~ tgt
+% pext = File.dirname(d)
+<%=d%>/<%=tgt%>:<% if exts.include?(pext) %> <%=pext%>/<%=tgt%><% end %>
+ $(Q)<%= submake %><%=mflags%> V=$(V) $(@F)
+% end
+% end
+% distclean = exts | distclean
+% %w[clean distclean realclean].each do |tgt|
+% distclean.each do |d|
+% deps = exts.select {|e|e.start_with?("#{d}/")}.map {|e|"#{e}/#{tgt}"}
+<%=d%>/<%=tgt%>:<% unless deps.empty? %> <%=deps.join(' ')%><% end %>
+% unless tgt == "clean"
$(ECHO) $(@F)ing $(@D)
% end
+% if exts.include?(d)
$(Q)<%= submake %><%=mflags%> V=$(V) $(@F)
-% if /^(dist|real)clean$/ =~ tgt
- $(Q)$(RM) <%=t[%r[\A(?:\.[^/]+/)?(?:[^/]+/){2}]]%>exts.mk
- $(Q)$(RMDIRS) $(@D)
+% end
+% unless tgt == "clean"
+ $(Q)$(RM) <%=d[%r[\A(?:\.[^/]+/)?(?:[^/]+/)?[^/]+]]%>/exts.mk
+ -$(Q)$(RMDIRS) $(@D)
% end
% end
% end
diff --git a/template/fake.rb.in b/template/fake.rb.in
index c7b11eff76..fed640aee7 100644
--- a/template/fake.rb.in
+++ b/template/fake.rb.in
@@ -9,6 +9,8 @@ while /\A(\w+)=(.*)/ =~ ARGV[0]
end
if inc = arg['i']
src = inc == '-' ? STDIN.read : File.read(inc)
+ src.tr!("\r", " ")
+ src.gsub!(/^#.*\n/, '')
else
src = ""
end
@@ -20,12 +22,11 @@ def src.value(name)
end
arg['versions'] = version = {}
File.read(File.join(arg['srcdir'], 'version.c')).
- scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|(STR))\(([^()]*)\)/m) do |n, s, v|
+ scan(/rb_define_(?:global_)?const\((mRuby, *)?"(?(1)|RUBY_)(\w+)",[^;]*?\bMK(?:INT|(STR))\(([^()]*)\)/m) do |_, n, s, v|
version[n] = arg[v] || src.value(v) || (s ? v : 0)
end
-arg['RUBY_DESCRIPTION_WITH_RJIT'] = src.value('description_with_rjit') || 'description_with_rjit'
-arg['RUBY_DESCRIPTION_WITH_YJIT'] = src.value('description_with_yjit') || 'description_with_yjit'
-%>baseruby="<%=arg['BASERUBY']%>"
+-%>
+baseruby="<%=arg['BASERUBY']%>"
_\
=begin
_=
@@ -38,19 +39,27 @@ exec $ruby "$r" "$@"
class Object
remove_const :CROSS_COMPILING if defined?(CROSS_COMPILING)
CROSS_COMPILING = RUBY_PLATFORM
+ options = remove_const(:RUBY_DESCRIPTION)[/( \+[^\[\]\+]+)*(?= \[\S+\]\z)/]
constants.grep(/^RUBY_/) {|n| remove_const n}
% arg['versions'].each {|n, v|
- <%=n%> = <%if n=='RUBY_DESCRIPTION' %>case
- when RubyVM.const_defined?(:RJIT) && RubyVM::RJIT.enabled?
- <%=arg['RUBY_DESCRIPTION_WITH_RJIT'].inspect%>
- when RubyVM.const_defined?(:YJIT) && RubyVM::YJIT.enabled?
- <%=arg['RUBY_DESCRIPTION_WITH_YJIT'].inspect%>
- else
- <%=v.inspect%>
- end<%else%><%=v.inspect%><%end%>
+ RUBY_<%=n%> = <%if n=='DESCRIPTION'
+ v1, v2 = v.split(/(?= \[\S+\]\z)/)
+ %><%=v1.dump.chomp('"')%>#{options}<%=
+ v2.dump[1..-1]%>.freeze<%
+ else%><%=v.inspect%><%end%>
+% }
+end
+v=$VERBOSE;$VERBOSE=nil;module Ruby; end;$VERBOSE=v
+module Ruby
+ constants.each {|n| remove_const n}
+% arg['versions'].each {|n, v|
+ <%=n%> = ::RUBY_<%=n%>
% }
end
builddir = File.dirname(File.expand_path(__FILE__))
+libpathenv = libpathenv = "<%=arg['LIBPATHENV']%>"
+preloadenv = preloadenv = "<%=arg['PRELOADENV']%>"
+libruby_so = libruby_so = "<%=arg['LIBRUBY_SO']%>"
srcdir = "<%=arg['srcdir']%>"
top_srcdir = File.realpath(srcdir, builddir)
fake = File.join(top_srcdir, "tool/fake.rb")
diff --git a/template/id.c.tmpl b/template/id.c.tmpl
index 5b9e879730..5aa8e47ce7 100644
--- a/template/id.c.tmpl
+++ b/template/id.c.tmpl
@@ -22,7 +22,8 @@ ops = ids[:token_op].uniq {|id, op, token| token && op}
static const struct {
unsigned short token;
- const char name[3], term;
+ RBIMPL_ATTR_NONSTRING() const char name[3];
+ const char term;
} op_tbl[] = {
% ops.each do |_id, op, token|
% next unless token
diff --git a/template/id.h.tmpl b/template/id.h.tmpl
index 9c588305eb..eb37e15073 100644
--- a/template/id.h.tmpl
+++ b/template/id.h.tmpl
@@ -1,5 +1,5 @@
%# -*- c -*-
-/* DO NOT EDIT THIS FILE DIRECTLY */
+/* DO NOT EDIT THIS FILE DIRECTLY: source is at template/id.h.tmpl */
/**********************************************************************
id.h -
@@ -19,15 +19,14 @@ types = ids.keys.grep(/^[A-Z]/)
#define RUBY_ID_H
enum ruby_id_types {
- RUBY_ID_STATIC_SYM = 0x01,
RUBY_ID_LOCAL = 0x00,
+ RUBY_ID_STATIC_SYM = 0x01,
RUBY_ID_INSTANCE = (0x01<<1),
RUBY_ID_GLOBAL = (0x03<<1),
RUBY_ID_ATTRSET = (0x04<<1),
RUBY_ID_CONST = (0x05<<1),
RUBY_ID_CLASS = (0x06<<1),
- RUBY_ID_JUNK = (0x07<<1),
- RUBY_ID_INTERNAL = RUBY_ID_JUNK,
+ RUBY_ID_INTERNAL = (0x07<<1),
RUBY_ID_SCOPE_SHIFT = 4,
RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1)
};
@@ -41,7 +40,6 @@ enum ruby_id_types {
#define ID_ATTRSET RUBY_ID_ATTRSET
#define ID_CONST RUBY_ID_CONST
#define ID_CLASS RUBY_ID_CLASS
-#define ID_JUNK RUBY_ID_JUNK
#define ID_INTERNAL RUBY_ID_INTERNAL
#define symIFUNC ID2SYM(idIFUNC)
@@ -67,24 +65,33 @@ enum ruby_method_ids {
id<%=token%>,
% end
tPRESERVED_ID_END,
+
% prev = 'tPRESERVED_ID_END'
% types.each do |type|
% tokens = ids[type]
+ /* <%= type %> tokens {{{ */
tTOKEN_<%=type%>_BEGIN = <%=prev%>-1,
% tokens.each do |token|
t<%=token%>,
% end
% prev = "tTOKEN_#{type}_END"
<%=prev%>,
+ /* <%= type %> tokens }}} */
+
% end
tNEXT_ID = <%=prev%>,
+
% types.each do |type|
% tokens = ids[type]
+ /* <%= type %> IDs {{{ */
#define DEFINE_<%=type%>ID_FROM_TOKEN(n) id##n = TOKEN2<%=type%>ID(t##n)
% tokens or next
% tokens.each do |token|
DEFINE_<%=type%>ID_FROM_TOKEN(<%=token%>),
% end
+#undef DEFINE_<%=type%>ID_FROM_TOKEN
+ /* <%= type %> IDs }}} */
+
% end
tLAST_OP_ID = tPRESERVED_ID_END-1,
idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
diff --git a/template/known_errors.inc.tmpl b/template/known_errors.inc.tmpl
index c3aee77477..4d453395ca 100644
--- a/template/known_errors.inc.tmpl
+++ b/template/known_errors.inc.tmpl
@@ -4,8 +4,12 @@
* template/known_errors.inc.tmpl and defs/known_errors.def.
*/
-% error_names = ARGF.read.split(/\s+/)
-% error_names.each do |name|
+% error_names = ARGF.readlines.map {|line| [$1, $2] if /\A([A-Z]\S+)(?:\s+(\S.*))?/ =~ line}.compact
+% error_names.each do |name, doc|
+#if 0
+ /* <% if doc %>"<%= doc %>"<% else %>\<%= name %><% end %> error */
+ rb_define_const(rb_mErrno, "<%=name%>", e<%=name%>);
+#endif
#ifdef <%=name%>
defined_error("<%=name%>", <%=name%>)
#else
diff --git a/template/limits.c.tmpl b/template/limits.c.tmpl
index de35354829..f7867ded9a 100644
--- a/template/limits.c.tmpl
+++ b/template/limits.c.tmpl
@@ -51,11 +51,26 @@
# include <float.h>
#endif
+/*
+ * Document-const: LIMITS
+ *
+ * A Hash with the bounds of numeric types available to the \C compiler
+ * used to build Ruby. To access this constant, first run
+ * <code>require 'rbconfig/sizeof'</code>.
+ *
+ * require 'rbconfig/sizeof'
+ * RUBY_PLATFORM # => "x64-mingw-ucrt"
+ * RbConfig::LIMITS.fetch_values('FIXNUM_MAX', 'LONG_MAX')
+ * # => [1073741823, 2147483647]
+ *
+ */
+
void
Init_limits(void)
{
VALUE h = rb_hash_new();
- rb_define_const(rb_define_module("RbConfig"), "LIMITS", h);
+ VALUE mRbConfig = rb_define_module("RbConfig");
+ rb_define_const(mRbConfig, "LIMITS", h);
#ifdef HAVE_LONG_LONG
#ifndef ULLONG_MAX
@@ -67,7 +82,7 @@ Init_limits(void)
#define MAX2NUM(name) ULONG2NUM(name ## _MAX)
#define MIN2NUM(name) LONG2NUM(name ## _MIN)
#endif
-#define DEFINE(k, v) rb_hash_aset(h, rb_str_new_cstr(#k), v)
+#define DEFINE(k, v) rb_hash_aset(h, rb_usascii_str_new_lit(#k), v)
% limits.each do |type|
#ifdef <%= type %>_MAX
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index ebf9bc0693..04f65ec5e3 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -21,16 +21,11 @@ class Prelude
def initialize(output, preludes, vpath)
@output = output
@vpath = vpath
- @prelude_count = 0
@builtin_count = 0
@preludes = {}
@mains = preludes.map do |filename|
- if prelude = filename.end_with?("golf_prelude.rb")
- @prelude_count += 1
- else
- @builtin_count += 1
- end
- translate(filename, (filename unless prelude))[0]
+ @builtin_count += 1
+ translate(filename, filename)[0]
end
@preludes.delete_if {|_, (_, _, lines, sub)| sub && lines.empty?}
end
@@ -43,7 +38,10 @@ class Prelude
lineno = 0
result = [@preludes.size, @vpath.strip(filename), lines, sub]
@vpath.foreach(filename) do |line|
- line.force_encoding("ASCII-8BIT") if line.respond_to?(:force_encoding)
+ if line.respond_to?(:force_encoding)
+ enc = line.encoding
+ line.force_encoding("ASCII-8BIT")
+ end
line.rstrip!
lineno += 1
@preludes[filename] ||= result
@@ -55,7 +53,7 @@ class Prelude
if line.size > LINE_LIMIT
raise "#{filename}:#{lines.size+1}: too long line"
end
- line.sub!(/require(_relative)?\s*\(?\s*(["'])(.*?)(?:\.rb)?\2\)?/) do
+ line.sub!(/require(_relative)?\s*\(?\s*([\"\'])(.*?)(?:\.rb)?\2\)?/) do
orig, rel, path = $&, $2, $3
if rel
path = File.join(File.dirname(filename), path)
@@ -71,6 +69,7 @@ class Prelude
orig
end
end
+ comment.force_encoding(enc) if enc and comment
lines << [line, comment]
end
result << (start_line || 1)
@@ -86,8 +85,10 @@ Prelude.new(output, ARGV, vpath).instance_eval do
*/
%unless @preludes.empty?
#include "internal.h"
+#include "internal/ruby_parser.h"
#include "internal/warnings.h"
#include "iseq.h"
+#include "ruby/internal/attr/nonstring.h"
#include "ruby/ruby.h"
#include "vm_core.h"
@@ -107,12 +108,12 @@ static const struct {
% size += line.size
% next
% end
- char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=n%> */
+ RBIMPL_ATTR_NONSTRING() char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=n%> */
% size = line.size
% beg = n
% }
% if size > 0
- char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=lines.size+1%> */
+ RBIMPL_ATTR_NONSTRING() char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=lines.size+1%> */
% end
} prelude_code<%=i%><%=%> = {
% size = 0
@@ -132,90 +133,38 @@ static const struct {
COMPILER_WARNING_POP
-% unless preludes.empty?
#define PRELUDE_NAME(n) rb_usascii_str_new_static(prelude_name##n, sizeof(prelude_name##n)-1)
#define PRELUDE_CODE(n) rb_utf8_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n))
-static rb_ast_t *
-prelude_ast(VALUE name, VALUE code, int line)
-{
- rb_ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
- if (!ast || !ast->body.root) {
- if (ast) rb_ast_dispose(ast);
- rb_exc_raise(rb_errinfo());
- }
- return ast;
-}
-
% end
% if @builtin_count > 0
-#define PRELUDE_AST(n, name_str, start_line) \
+#define PRELUDE_MATCH(n) \
(((sizeof(prelude_name<%='##'%><%=%>n) - prefix_len - 2) == namelen) && \
- (strncmp(prelude_name<%='##'%><%=%>n + prefix_len, feature_name, namelen) == 0) ? \
- prelude_ast((name_str) = PRELUDE_NAME(n), PRELUDE_CODE(n), start_line) : 0)
+ (strncmp(prelude_name<%='##'%><%=%>n + prefix_len, feature_name, namelen) == 0))
-rb_ast_t *
-rb_builtin_ast(const char *feature_name, VALUE *name_str)
+VALUE
+rb_builtin_find(const char *feature_name, VALUE *name_str, int *start_line)
{
const size_t prefix_len = rb_strlen_lit("<internal:");
size_t namelen = strlen(feature_name);
- rb_ast_t *ast = 0;
+
+#define PRELUDE_FOUND(n, l) \
+ (*name_str = PRELUDE_NAME(n), *start_line = (l), PRELUDE_CODE(n))
% @preludes.each_value do |i, prelude, lines, sub, start_line|
% if sub
- if ((ast = PRELUDE_AST(<%=i%><%=%>, *name_str, <%=start_line%>)) != 0) return ast;
+ if (PRELUDE_MATCH(<%=i%>)) return PRELUDE_FOUND(<%=i%>, <%=start_line%>);
% end
% end
- return ast;
-}
+#undef PRELUDE_FOUND
-% end
-% if @prelude_count > 0
-COMPILER_WARNING_PUSH
-#if GCC_VERSION_SINCE(4, 2, 0)
-COMPILER_WARNING_ERROR(-Wmissing-field-initializers)
-#endif
-static void
-prelude_eval(VALUE code, VALUE name, int line)
-{
- static const rb_compile_option_t optimization = {
- TRUE, /* int inline_const_cache; */
- TRUE, /* int peephole_optimization; */
- FALSE,/* int tailcall_optimization; */
- TRUE, /* int specialized_instruction; */
- TRUE, /* int operands_unification; */
- TRUE, /* int instructions_unification; */
- TRUE, /* int stack_caching; */
- TRUE, /* int frozen_string_literal; */
- FALSE, /* int debug_frozen_string_literal; */
- FALSE, /* unsigned int coverage_enabled; */
- 0, /* int debug_level; */
- };
-
- rb_ast_t *ast = prelude_ast(name, code, line);
- rb_iseq_eval(rb_iseq_new_with_opt(&ast->body, name, name, Qnil, line,
- NULL, 0, ISEQ_TYPE_TOP, &optimization));
- rb_ast_dispose(ast);
+ return Qnil;
}
-COMPILER_WARNING_POP
-% end
%end
% init_name = @output && @output[/\w+(?=_prelude.c\b)/] || 'prelude'
void
Init_<%=init_name%><%=%>(void)
{
-%unless @prelude_count.zero?
-% preludes.each do |i, prelude, lines, sub, start_line|
-% next if sub
- prelude_eval(PRELUDE_CODE(<%=i%><%=%>), PRELUDE_NAME(<%=i%><%=%>), <%=start_line%><%=%>);
-% end
-
-#if 0
-% preludes.length.times {|i|
- printf("%.*s", (int)sizeof(prelude_code<%=i%><%=%>), prelude_code<%=i%><%=%>.L0);
-% }
-#endif
-%end
}
<%end -%>
diff --git a/template/ruby-runner.h.in b/template/ruby-runner.h.in
index fdfe88dcb9..b94086c565 100644
--- a/template/ruby-runner.h.in
+++ b/template/ruby-runner.h.in
@@ -1,9 +1,7 @@
#define ABS_SRCDIR "@abs_srcdir@"
#define BUILDDIR "@abs_top_builddir@"
#define LIBPATHENV "@LIBPATHENV@"
-#define PRELOADENV "@PRELOADENV@"
#define PATH_SEPARATOR "@PATH_SEPARATOR@"
#define PATH_SEP '@PATH_SEPARATOR@'
#define EXTOUT "@EXTOUT@"
#define ARCH "@arch@"
-#define SOEXT "@SOEXT@"
diff --git a/template/ruby.pc.in b/template/ruby.pc.in
index c4848805a3..6901ec2320 100644
--- a/template/ruby.pc.in
+++ b/template/ruby.pc.in
@@ -52,7 +52,7 @@ DLDFLAGS=@DLDFLAGS@
Name: Ruby
Description: Object Oriented Script Language
-Version: ${ruby_version}
+Version: ${RUBY_PROGRAM_VERSION}
URL: https://www.ruby-lang.org
Cflags: -I${rubyarchhdrdir} -I${rubyhdrdir}
Libs: ${DLDFLAGS} ${LIBRUBYARG_SHARED} ${LIBS}
diff --git a/template/sizes.c.tmpl b/template/sizes.c.tmpl
index 31060f5fea..abc3b5c908 100644
--- a/template/sizes.c.tmpl
+++ b/template/sizes.c.tmpl
@@ -25,15 +25,30 @@ conditions = {
#endif
% end
+
+/*
+ * Document-const: SIZEOF
+ *
+ * A Hash with the byte size of \C types available to the compiler
+ * used to build Ruby. To access this constant, first run
+ * <code>require 'rbconfig/sizeof'</code>.
+ *
+ * require 'rbconfig/sizeof'
+ * RUBY_PLATFORM # => "x64-mingw-ucrt"
+ * RbConfig::SIZEOF.fetch_values('long', 'void*') # => [4, 8]
+ *
+ */
+
extern void Init_limits(void);
void
Init_sizeof(void)
{
VALUE s = rb_hash_new();
- rb_define_const(rb_define_module("RbConfig"), "SIZEOF", s);
+ VALUE mRbConfig = rb_define_module("RbConfig");
+ rb_define_const(mRbConfig, "SIZEOF", s);
-#define DEFINE(type, size) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size))
-#define DEFINE_SIZE(type) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(sizeof(type)))
+#define DEFINE(type, size) rb_hash_aset(s, rb_usascii_str_new_lit(#type), INT2FIX(SIZEOF_##size))
+#define DEFINE_SIZE(type) rb_hash_aset(s, rb_usascii_str_new_lit(#type), INT2FIX(sizeof(type)))
% types.each do |type|
% if sizes[type]
diff --git a/template/transdb.h.tmpl b/template/transdb.h.tmpl
index 990a8639d0..22b5960cd8 100644
--- a/template/transdb.h.tmpl
+++ b/template/transdb.h.tmpl
@@ -1,4 +1,4 @@
-<%
+<% #-*- mode: ruby -*-
#
# static const rb_transcoder
# rb_from_US_ASCII = {
@@ -22,39 +22,34 @@ transdirs = transdirs.sort_by {|td|
files = {}
names_t = []
-converter_list = []
transdirs.each do |transdir|
names = Dir.entries(transdir)
- names_t += names.map {|n| /(?!\A)\.trans\z/ =~ n ? $` : nil }.compact
- names_c = names.map {|n| /(?!\A)\.c\z/ =~ n ? $` : nil }.compact
- (names_t & names_c).map {|n|
- "#{n}.c"
- }.sort_by {|e|
+ names_t += names.map {|n| n[/.+(?=\.trans\z)/]}.compact
+ names_c = names.map {|n| n[/.+(?=\.c\z)/]}.compact
+ (names_t & names_c).sort_by {|e|
e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten
}.each do |fn|
next if files[fn]
files[fn] = true
- path = File.join(transdir,fn)
- open(path) do |f|
- transcoder_def = false
+ path = File.join(transdir, "#{fn}.c")
+ File.open(path) do |f|
f.each_line do |line|
- transcoder_def = true if /^static const rb_transcoder/ =~ line
- if transcoder_def && /"(.*?)"\s*,\s*"(.*?)"/ =~ line
- transcoder_def = false
- from_to = "%s to %s" % [$1, $2]
- if converters[from_to]
- raise ArgumentError, '%s:%d: transcode "%s" is already registered at %s:%d' %
- [path, f.lineno, from_to, *converters[from_to].values_at(3, 4)]
- else
- converters[from_to] = [$1, $2, fn[0..-3], path, f.lineno]
- converter_list << from_to
+ if (/^static const rb_transcoder/ =~ line)
+ if (/"(.*?)"\s*,\s*"(.*?)"/ =~ f.gets("\n\};")) # swallow the initializer block
+ from_to = [$1.freeze, $2.freeze].freeze
+ if converters[from_to]
+ raise ArgumentError,
+ '%s:%d: transcode "%s to %s" is already registered at %s:%d' %
+ [path, f.lineno, *from_to, *converters[from_to].values_at(3, 4)]
+ else
+ converters[from_to] = [fn, path, f.lineno]
+ end
end
end
end
end
end
end
-converter_list.each do |from_to|
- from, to, fn = *converters[from_to]
+converters.each do |(from, to), (fn)|
%>rb_declare_transcoder("<%=from%>", "<%=to%>", "<%=fn%>");
% end
diff --git a/template/unicode_norm_gen.tmpl b/template/unicode_norm_gen.tmpl
index a16712fbac..773a727cec 100644
--- a/template/unicode_norm_gen.tmpl
+++ b/template/unicode_norm_gen.tmpl
@@ -22,23 +22,6 @@ class Integer
end
end
-module Enumerable
- unless method_defined?(:each_slice)
- def each_slice(n)
- ary = []
- each do |i|
- ary << i
- if ary.size >= n
- yield ary
- ary = []
- end
- end
- yield ary unless ary.empty?
- self
- end
- end
-end
-
class Array
def to_UTF8() collect {|c| c.to_UTF8}.join('') end
@@ -112,6 +95,17 @@ accent_array = combining_class.keys + composition_table.keys.collect {|key| key.
composition_starters = composition_table.keys.collect {|key| key.first}
+# Special treatment for Unicode 16.0.0
+# Add characters that can be decomposed (even indirectly) so that
+# the first character in the decomposition is a an accent to accents.
+# We do this here up to two levels deep.
+# In the future, there may be even deeper levels.
+starter_accents = composition_starters & accent_array
+decomposition_table.each do |k, v|
+ accent_array << k if starter_accents.include? v.first
+ accent_array << k if starter_accents.include? decomposition_table[v.first]&.first
+end
+
hangul_no_trailing = []
0xAC00.step(0xD7A3, 28) {|c| hangul_no_trailing << c}
@@ -155,6 +149,9 @@ end
# frozen_string_literal: true
%# >
+Encoding::UNICODE_VERSION == <%= unicode_version.dump %><%=%> or
+ raise "Unicode version mismatch: <%= unicode_version %> expected but #{Encoding::UNICODE_VERSION}"
+
# automatically generated by template/unicode_norm_gen.tmpl
module UnicodeNormalize # :nodoc:
@@ -202,19 +199,19 @@ module UnicodeNormalize # :nodoc:
DECOMPOSITION_TABLE = {
% decomposition_table.each do |key, value|
- "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>"<%=%>,
+ "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>",
% end
}.freeze
KOMPATIBLE_TABLE = {
% kompatible_table.each do |key, value|
- "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>"<%=%>,
+ "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>",
% end
}.freeze
COMPOSITION_TABLE = {
% composition_table.each do |key, value|
- "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>"<%=%>,
+ "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>",
% end
}.freeze
end
diff --git a/template/unicode_properties.rdoc.tmpl b/template/unicode_properties.rdoc.tmpl
new file mode 100755
index 0000000000..7bbedc780c
--- /dev/null
+++ b/template/unicode_properties.rdoc.tmpl
@@ -0,0 +1,59 @@
+== \Regexps Based on Unicode Properties
+
+The properties shown here are those currently supported in Ruby.
+Older versions may not support all of these.
+<%
+# Generate a documentation file for the unicode properties.
+#
+# Usage:
+#
+# Get PropertyAliases.txt, PropertyValueAliases.txt from unicode.org
+# (http://unicode.org/Public/UNIDATA/) and run
+# ```
+# ruby tool/generic_erb.rb template/unicode_properties.rdoc.tmpl data_dir name2ctype.h
+# ```
+
+data_dir = ARGV.shift&.tap { |d| Dir.exist?(d) } ||
+ abort("Usage: #{$0} data_directory [name2ctype.h]")
+
+# Map group names, given as last argument to #make_const in enc-unicode.rb,
+# to sections in the doc. The order in this hash controls the order in the doc.
+map = {
+ /\[\[:/ => 'POSIX brackets',
+ '-' => 'Special',
+ /.+ Category/ => 'Major and General Categories',
+ 'Binary Property' => 'Prop List',
+ /Derived Property/ => 'Derived Core Properties',
+ 'Script' => 'Scripts',
+ 'Block' => 'Blocks',
+ 'Emoji' => 'Emoji',
+ /Grapheme/ => 'Graphemes',
+ /Derived Age/ => 'Derived Ages',
+}
+
+# aliases in the form { short => long }, e.g. { 'Hex' => 'Hex_Digit', 'L' => 'Letter' }
+aliases = (
+ File.binread(File.join(data_dir, 'PropertyAliases.txt')).scan(/^(\w+)\s*; (\w+)/) +
+ File.binread(File.join(data_dir, 'PropertyValueAliases.txt')).scan(/^(?:gc|sc)\s*; (\w+)\s*; (\w+)/)
+).to_h
+
+props_by_section = {}
+ARGF.each_line do |line|
+ next unless /'(?<prop>[^']+)': (?<name>.+) \*/ =~ line
+ next if prop == 'NEWLINE' # ignore custom internal prop
+
+ section = map.find { |k, v| k === name }&.last || warn("no doc section for #{name}")
+
+ # normalize prop names - the header file uses a mix of short and long names
+ long_prop_name = aliases[prop] || prop
+ (props_by_section[section] ||= []) << long_prop_name
+end
+
+map.each_value do |section| -%>
+
+=== <%=section%>
+
+% props_by_section[section].sort.each do |prop|
+- <%= [prop, aliases.key(prop)].compact.uniq.map { |v| "<tt>\\p{#{v}}</tt>" }.join(', ') %>
+% end
+% end