diff options
Diffstat (limited to 'template')
-rw-r--r-- | template/Doxyfile.tmpl | 363 | ||||
-rw-r--r-- | template/GNUmakefile.in | 18 | ||||
-rw-r--r-- | template/Makefile.in | 253 | ||||
-rw-r--r-- | template/builtin_binary.inc.tmpl | 10 | ||||
-rw-r--r-- | template/configure-ext.mk.tmpl | 2 | ||||
-rw-r--r-- | template/encdb.h.tmpl | 36 | ||||
-rw-r--r-- | template/extinit.c.tmpl | 2 | ||||
-rw-r--r-- | template/exts.mk.tmpl | 20 | ||||
-rw-r--r-- | template/fake.rb.in | 39 | ||||
-rw-r--r-- | template/id.c.tmpl | 2 | ||||
-rw-r--r-- | template/id.h.tmpl | 19 | ||||
-rw-r--r-- | template/known_errors.inc.tmpl | 8 | ||||
-rw-r--r-- | template/prelude.c.tmpl | 144 | ||||
-rw-r--r-- | template/ruby.pc.in | 2 | ||||
-rw-r--r-- | template/transdb.h.tmpl | 39 | ||||
-rwxr-xr-x | template/unicode_properties.rdoc.tmpl | 59 |
16 files changed, 585 insertions, 431 deletions
diff --git a/template/Doxyfile.tmpl b/template/Doxyfile.tmpl index ed96cb409a..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 @@ -273,6 +295,8 @@ ALIASES += "alias{1}=Just another name of @ref \1" ALIASES += "old{1}=Old name of @ref \1.^^@deprecated Use @ref \1 instead.^^@ingroup deprecated_macros" ALIASES += "shyouhei=\@shyouhei" ALIASES += "ko1=\@ko1" +ALIASES += "matz=\@matz" +ALIASES += "shugo=\@shugo" # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -352,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 @@ -463,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 @@ -476,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 #--------------------------------------------------------------------------- @@ -557,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 @@ -577,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. @@ -588,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 @@ -847,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 @@ -862,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 = @@ -891,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. @@ -965,7 +1050,7 @@ EXCLUDE_PATTERNS += encdb.h EXCLUDE_PATTERNS += extconf.h EXCLUDE_PATTERNS += insns.def EXCLUDE_PATTERNS += lib -EXCLUDE_PATTERNS += rb_mjit_header.h +EXCLUDE_PATTERNS += rb_rjit_header.h EXCLUDE_PATTERNS += spec EXCLUDE_PATTERNS += test EXCLUDE_PATTERNS += tmp @@ -976,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 = @@ -1024,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. @@ -1065,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 #--------------------------------------------------------------------------- @@ -1162,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 = @@ -1244,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 = @@ -1259,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 @@ -1289,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 @@ -1447,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 @@ -1564,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. @@ -1595,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 @@ -1615,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. @@ -1939,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. @@ -1962,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 @@ -2135,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. @@ -2216,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 = @@ -2247,10 +2359,6 @@ PREDEFINED += DEPRECATED(_)=_ PREDEFINED += DEPRECATED_BY(__,_)=_ PREDEFINED += ENUM_OVER_INT=1 PREDEFINED += ERRORFUNC(__,_)=_ -PREDEFINED += MJIT_FUNC_EXPORTED= -PREDEFINED += MJIT_STATIC=extern -PREDEFINED += MJIT_SYMBOL_EXPORT_BEGIN= -PREDEFINED += MJIT_SYMBOL_EXPORT_END= PREDEFINED += NOINLINE(_)=_ PREDEFINED += NORETURN(_)=_ PREDEFINED += PACKED_STRUCT_UNALIGNED(_)=_ @@ -2350,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. @@ -2368,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. @@ -2385,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 @@ -2430,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. @@ -2555,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). @@ -2592,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 @@ -2605,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 = @@ -2646,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 @@ -2670,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. @@ -2683,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 e2f2d1aebd..22ff1078dc 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) @@ -12,6 +16,16 @@ ifeq ($(HAVE_BASERUBY),yes) override REVISION_FORCE := PHONY endif -include $(srcdir)/defs/universal.mk +override order_only := | + +# Needs the dependency when any Unicode tables data files exist. +override UNICODE_TABLES_DEPENDENTS = \ + $(if $(or \ + $(filter yes,$(ALWAYS_UPDATE_UNICODE)), \ + $(wildcard \ + $(if $(filter .,$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)),,\ + $(UNICODE_TABLES_DATA_FILES)))),\ + force,none) + -include uncommon.mk include $(srcdir)/defs/gmake.mk diff --git a/template/Makefile.in b/template/Makefile.in index 666cbc3481..22148e7fea 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -27,7 +27,9 @@ CC_WRAPPER = @XCC_WRAPPER@ CC = @CC@ CPP = @CPP@ LD = @LD@ -YACC = bison +RUSTC = @RUSTC@ +CARGO = @CARGO@ +YACC = $(BASERUBY) $(tooldir)/lrama/exe/lrama PURIFY = AUTOCONF = autoconf CONFIGURE = @CONFIGURE@ @@ -47,6 +49,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ datarootdir = @datarootdir@ datadir = @datadir@ +target_os = @target_os@ arch = @arch@ sitearch = @sitearch@ sitedir = @sitedir@ @@ -62,6 +65,7 @@ rubyarchhdrdir = @rubyarchhdrdir@ ruby_version = @ruby_version@ RUBY_VERSION_NAME = @RUBY_VERSION_NAME@ UNIVERSAL_ARCHNAMES = @UNIVERSAL_ARCHNAMES@ +BUILTIN_BINARY = @X_BUILTIN_BINARY@ TESTUI = console TESTS = @@ -86,26 +90,20 @@ optflags = @optflags@ debugflags = @debugflags@ warnflags = @warnflags@ @strict_warnflags@ cppflags = @cppflags@ -XCFLAGS = @XCFLAGS@ $(INCFLAGS) +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) USE_RUBYGEMS = @USE_RUBYGEMS@ USE_RUBYGEMS_ = $(USE_RUBYGEMS:yes=) CPPFLAGS = @CPPFLAGS@ $(USE_RUBYGEMS_:no=-DDISABLE_RUBYGEMS=1) -MJIT_SUPPORT = @MJIT_SUPPORT@ -MJIT_HEADER_FLAGS = @MJIT_HEADER_FLAGS@ -MJIT_HEADER_SUFFIX = -MJIT_HEADER_ARCH = -MJIT_HEADER_INSTALL_DIR = @MJIT_HEADER_INSTALL_DIR@ -MJIT_CC = @MJIT_CC@ -MJIT_CFLAGS = @MJIT_CFLAGS@ -MJIT_OPTFLAGS = @MJIT_OPTFLAGS@ -MJIT_DEBUGFLAGS = @MJIT_DEBUGFLAGS@ -MJIT_LDSHARED = @MJIT_LDSHARED@ -MJIT_DLDFLAGS = $(XDLDFLAGS) -MJIT_HEADER = rb_mjit_header.h -MJIT_MIN_HEADER_NAME = rb_mjit_min_header-$(RUBY_PROGRAM_VERSION).h -MJIT_MIN_HEADER = $(MJIT_HEADER_BUILD_DIR)/$(MJIT_MIN_HEADER_NAME) -MJIT_HEADER_BUILD_DIR = $(EXTOUT)/include/$(arch) -MJIT_TABS=@MJIT_TABS@ +RJIT_SUPPORT = @RJIT_SUPPORT@ +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 +CARGO_BUILD_ARGS=@CARGO_BUILD_ARGS@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ EXE_LDFLAGS = $(LDFLAGS) EXTLDFLAGS = @EXTLDFLAGS@ @@ -130,6 +128,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@ @@ -147,8 +148,7 @@ RUNRUBY = @RUNRUBY@ $(RUN_OPTS) # RUNRUBY_DEBUGGER:: debugging option for runruby.rb RUNRUBY_DEBUGGER = --debugger='gdb -x run.gdb --quiet --args' XRUBY = @XRUBY@ -BTESTRUBY = @BTESTRUBY@\ - $(MINIRUBYOPT) +BTESTRUBY = @BTESTRUBY@ -r./$(arch)-fake INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -156,10 +156,15 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ XRUBY_LIBDIR = @XRUBY_LIBDIR@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@ -BOOTSTRAPRUBY = @BOOTSTRAPRUBY@ + +yes_baseruby = $(HAVE_BASERUBY:no=) +no_baseruby = $(HAVE_BASERUBY:yes=) +BOOTSTRAPRUBY = $(yes_baseruby:yes=$(BASERUBY)) $(no_baseruby:no=$(MINIRUBY)) +BOOTSTRAPRUBY_OPT = $(yes_baseruby:yes=-r./$(arch)-fake) +BOOTSTRAPRUBY_FAKE = $(yes_baseruby:yes=$(arch)-fake.rb) COROUTINE_H = @X_COROUTINE_H@ -COROUTINE_OBJ = $(COROUTINE_H:.h=.@OBJEXT@) +COROUTINE_OBJ = $(COROUTINE_H:.h=.$(OBJEXT)) COROUTINE_SRC = @X_COROUTINE_SRC@ #### End of system configuration section. #### @@ -168,7 +173,6 @@ MAJOR= @MAJOR@ MINOR= @MINOR@ TEENY= @TEENY@ -# here for MJIT_MIN_HEADER_NAME, not in common.mk RUBY_PROGRAM_VERSION = $(MAJOR).$(MINOR).$(TEENY) LIBRUBY_A = @LIBRUBY_A@ @@ -193,7 +197,8 @@ DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \ parse.$(OBJEXT) \ string.$(OBJEXT) \ symbol.$(OBJEXT) \ - vm.$(OBJEXT) + vm.$(OBJEXT) \ + $(YJIT_OBJ) THREAD_MODEL = @THREAD_MODEL@ @@ -208,10 +213,12 @@ MAKEDIRS = @MKDIR_P@ CP = cp MV = mv RM = rm -f +RM1 = $(RM) RMDIR = @RMDIR@ RMDIRS = @RMDIRS@ RMALL = @RMALL@ LN_S = @LN_S@ +TOUCH = touch NM = @NM@ AR = @AR@ ARFLAGS = @ARFLAGS@$(empty) @@ -245,7 +252,7 @@ MINIPRELUDE_C = miniprelude.c GOLF_PRELUDE_C= golf_prelude.c RBCONFIG = .rbconfig.time -MAINSRC = $(MAINOBJ:.@OBJEXT@=.c) +MAINSRC = $(MAINOBJ:.$(OBJEXT)=.c) SRC_FILE = $< OS_SRC_FILE = $< @@ -262,9 +269,15 @@ ACTIONS_ENDGROUP = @$(NULLCMD) DESTDIR = @DESTDIR@ +cleanlibs = @cleanlibs@ + configure_args = @configure_args@ #### End of variables +ABI_VERSION_HDR = $(hdrdir)/ruby/internal/abi.h + +CAT_DEPEND = sed -e 's/{\$$([^(){}]*)[^{}]*}//g' -e /AUTOGENERATED/q + .SUFFIXES: .inc .h .c .y .i .$(ASMEXT) .$(DTRACE_EXT) all: @@ -272,23 +285,31 @@ all: # Prevent GNU make v3 from overflowing arg limit on SysV. .NOEXPORT: +# On GNU make and BSD make, clean up the target when the recipe +# fails. Prevents half-built targets corrupting future runs. +.DELETE_ON_ERROR: + 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@ + PRE_LIBRUBY_UPDATE = [ -n "$(LIBRUBY_SO_UPDATE)" ] || $(gnumake:yes=exec) $(RM) $(LIBRUBY_EXTS) # 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) @@ -298,7 +319,7 @@ $(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): @@ -317,7 +338,6 @@ $(LIBRUBY_$(LIBRUBY_WITH_EXT)): $(LIBRUBY_SO_UPDATE) PKG_CONFIG = @PKG_CONFIG@ ruby_pc = @ruby_pc@ -ruby.pc: $(ruby_pc) $(ruby_pc): config.status Makefile $(Q)./config.status --file=-:$(srcdir)/template/ruby.pc.in | \ sed -e 's/\$$(\([A-Za-z_][A-Za-z0-9_]*\))/$${\1}/g' \ @@ -331,10 +351,6 @@ pre-install-local:: pkgconfig-data ruby-runner.h: template/ruby-runner.h.in config.status @./config.status --file=$@:$(srcdir)/template/$(@F).in -$(RBCONFIG): $(PREP) - -rbconfig.rb: $(RBCONFIG) - install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \ $(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE) pkgconfig-data $(ECHO) installing cross-compiling stuff @@ -354,7 +370,7 @@ install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/confi Makefile: $(srcdir)/template/Makefile.in $(srcdir)/enc/Makefile.in -$(MKFILES): config.status $(srcdir)/version.h +$(MKFILES): config.status $(srcdir)/version.h $(ABI_VERSION_HDR) @[ -f $@ ] && mv $@ $@.old MAKE=$(MAKE) $(SHELL) ./config.status $@ @cmp $@ $@.old > /dev/null 2>&1 && echo $@ unchanged && exit 0; \ @@ -372,13 +388,14 @@ uncommon.mk: $(srcdir)/common.mk .PHONY: reconfig reconfig-args = $(srcdir)/$(CONFIGURE) $(yes_silence:yes=--silent) $(configure_args) config.status-args = ./config.status $(yes_silence:yes=--silent) --recheck -reconfig-exec-0 = test -t 1 && { : $${CONFIGURE_TTY=yes}; export CONFIGURE_TTY; }; exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3 3>&- 4>&-` -reconfig-exec-1 = set -x; "$$@" +reconfig-exec-0 = test -t 1 && { : $${CONFIGURE_TTY=yes}; export CONFIGURE_TTY; }; exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | grep -F -v '(cached)' 1>&3 3>&- 4>&-` +reconfig-exec-1 = set -x; exec "$$@" +reconfig-exec-yes = $(reconfig-exec-1) reconfig config.status: $(srcdir)/$(CONFIGURE) $(srcdir)/enc/Makefile.in \ - $(srcdir)/include/ruby/version.h + $(hdrdir)/ruby/version.h $(ABI_VERSION_HDR) @PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \ - set $(SHELL) $($@-args); $(reconfig-exec-$(V)) + set $(SHELL) $($@-args); $(reconfig-exec-$(silence:no=$(V))) $(srcdir)/$(CONFIGURE): $(srcdir)/configure.ac $(CHDIR) $(srcdir) && exec $(AUTOCONF) -o $(@F) @@ -392,7 +409,6 @@ all-incs: probes.h # * with gperf v.s. without gperf # * committers may have various versions of gperf # * ./configure v.s. ../ruby/configure -# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime. # * svn checkout generate a file with mtime as current time # * ext4 and XFS has a mtime with fractional part lex.c: defs/keywords @@ -426,11 +442,11 @@ $(srcdir)/enc/jis/props.h: enc/jis/props.kwd $(CP) $@ $(?:.kwd=.h.blt); \ fi -.c.@OBJEXT@: +.c.$(OBJEXT): @$(ECHO) compiling $< $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $< -.$(ASMEXT).@OBJEXT@: +.$(ASMEXT).$(OBJEXT): @$(ECHO) assembling $< $(Q) $(CC) $(ASFLAGS) -DSYMBOL_PREFIX=$(SYMBOL_PREFIX) -o $@ -c $< @@ -465,20 +481,8 @@ probes.$(OBJEXT): $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp) $(Q) $(RM) $@ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS) -main: mjit-headers -yes-mjit-headers: $(MJIT_MIN_HEADER) -clean-local:: - $(Q)$(RM) \ - $(MJIT_HEADER) $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h \ - $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h \ - $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_min_header-*.h \ - $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time mjit_config.h \ - || $(NULLCMD) - $(Q)$(RM) -r mjit_build_dir.* - -$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD) - # DTrace static library hacks described here: -# http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html +# https://marc.info/?l=opensolaris-dtrace-discuss&m=114761203110734&w=4 ruby-glommed.$(OBJEXT): @$(ECHO) generating a glommed object with DTrace probes for static library $(Q) $(LD) -r -o $@ $(OBJS) @@ -489,7 +493,8 @@ clean-local:: enc/encinit.c enc/encinit.$(OBJEXT) $(pkgconfig_DATA) \ ruby-runner.$(OBJEXT) ruby-runner.h \ || $(NULLCMD) - -$(Q)$(RMALL) exe/ *.dSYM + $(Q)find . ! -type d \( -name '*.bc' -o -name '*.[is]' \) -exec rm -f {} + || true + distclean-local:: $(Q)$(RM) \ @@ -508,12 +513,16 @@ ext/clean.mk ext/distclean.mk ext/realclean.mk:: ext/clean:: ext/clean.sub ext/distclean:: ext/distclean.sub ext/realclean:: ext/realclean.sub -gems/clean:: gems/clean.sub -gems/distclean:: gems/distclean.sub -gems/realclean:: gems/realclean.sub +.bundle/clean:: .bundle/clean.sub +.bundle/distclean:: .bundle/distclean.sub +.bundle/realclean:: .bundle/realclean.sub + +ext/clean.sub:: ext/clean.mk +ext/distclean.sub:: ext/distclean.mk +ext/realclean.sub:: ext/realclean.mk ext/clean.sub ext/distclean.sub ext/realclean.sub \ -gems/clean.sub gems/distclean.sub gems/realclean.sub:: +.bundle/clean.sub .bundle/distclean.sub .bundle/realclean.sub:: $(Q) set dummy `echo "${EXTS}" | tr , ' '`; shift; \ test "$$#" = 0 && set .; \ set dummy `\ @@ -529,13 +538,16 @@ gems/clean.sub gems/distclean.sub gems/realclean.sub:: fi; \ done || true -ext/distclean ext/realclean gems/distclean gems/realclean:: +ext/distclean ext/realclean .bundle/distclean .bundle/realclean:: $(Q) set dummy `echo "${EXTS}" | tr , ' '`; shift; \ test "$$#" = 0 && set .; \ cd $(@D) 2>/dev/null && \ 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 + clean-enc distclean-enc realclean-enc: @test -f "$(ENC_MK)" || exit 0; \ echo $(@:-enc=ing) encodings; \ @@ -567,29 +579,21 @@ update-benchmark-driver: --branch $(BENCHMARK_DRIVER_GIT_REF) \ $(BENCHMARK_DRIVER_GIT_URL) benchmark-driver $(GIT_OPTS) -update-doclie: - $(Q) $(tooldir)/git-refresh -C $(srcdir)/coverage $(Q1:0=-q) \ - --branch $(DOCLIE_GIT_REF) \ - $(DOCLIE_GIT_URL) doclie $(GIT_OPTS) - -update-simplecov-html: - $(Q) $(tooldir)/git-refresh -C $(srcdir)/coverage $(Q1:0=-q) \ - --branch $(SIMPLECOV_HTML_GIT_REF) \ - $(SIMPLECOV_HTML_GIT_URL) simplecov-html $(GIT_OPTS) - -update-simplecov: - $(Q) $(tooldir)/git-refresh -C $(srcdir)/coverage $(Q1:0=-q) \ - --branch $(SIMPLECOV_GIT_REF) \ - $(SIMPLECOV_GIT_URL) simplecov $(GIT_OPTS) - -update-coverage: update-simplecov update-simplecov-html update-doclie - 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 \ - vmtc.inc vm.inc mjit_compile.inc +INSNS = optinsn.inc optunifs.inc insns.inc insns_info.inc \ + vmtc.inc vm.inc $(INSNS): $(srcdir)/insns.def vm_opts.h \ $(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def \ @@ -623,18 +627,11 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \ $(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/_mjit_compile_insn.erb \ - $(tooldir)/ruby_vm/views/_mjit_compile_insn_body.erb \ - $(tooldir)/ruby_vm/views/_mjit_compile_ivar.erb \ - $(tooldir)/ruby_vm/views/_mjit_compile_pc_and_sp.erb \ - $(tooldir)/ruby_vm/views/_mjit_compile_send.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/insns.inc.erb \ $(tooldir)/ruby_vm/views/insns_info.inc.erb \ - $(tooldir)/ruby_vm/views/mjit_compile.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 \ @@ -642,8 +639,6 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \ $(ECHO) generating $@ $(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@ -verconf.h: $(RBCONFIG) - loadpath: verconf.h @$(CPP) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/loadpath.c | \ sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \ @@ -653,44 +648,42 @@ un-runnable: $(ECHO) cannot make runnable, configure with --enable-load-relative. $(Q) exit 1 -mjit_config.h: - $(ECHO) making $@ - @{ \ - . $(tooldir)/mjit_archflag.sh; \ - parse_arch_flags "$(UNIVERSAL_ARCHNAMES)" $(ARCH_FLAG); \ - test "$(Q)" = @ || set -x; \ - echo '#ifndef RUBY_MJIT_CONFIG_H'; \ - echo '#define RUBY_MJIT_CONFIG_H 1'; \ - echo; \ - sep=; \ - echo '#ifdef LOAD_RELATIVE'; \ - quote MJIT_HEADER_INSTALL_DIR "/$(MJIT_HEADER_INSTALL_DIR)"; \ - echo '#else'; \ - quote MJIT_HEADER_INSTALL_DIR "$(rubyarchhdrdir)"; \ - echo '#endif'; \ - quote MJIT_MIN_HEADER_NAME "$(MJIT_MIN_HEADER_NAME)"; \ - sep=,; \ - quote "MJIT_CC_COMMON " $(MJIT_CC); \ - quote "MJIT_CFLAGS MJIT_ARCHFLAG" $(MJIT_CFLAGS); \ - quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \ - quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \ - quote "MJIT_LDSHARED " $(MJIT_LDSHARED); \ - quote "MJIT_DLDFLAGS MJIT_ARCHFLAG" $(MJIT_DLDFLAGS); \ - quote "MJIT_LIBS " $(LIBRUBYARG_SHARED); \ - quote 'PRELOADENV "@PRELOADENV@"'; \ - indent=$${archs:+' '}; \ - define_arch_flags; \ - echo; \ - echo '#endif /* RUBY_MJIT_CONFIG_H */'; \ - } > $@ - -yes-test-almost yes-test-all programs: mjit_build_dir.$(SOEXT) -mjit_build_dir.$(SOEXT): $(MJIT_MIN_HEADER) $(srcdir)/ruby-runner.c ruby-runner.h - $(ECHO) making $@ - $(Q) $(DLDSHARED) $(MJIT_DLDFLAGS) $(ARCH_FLAG) $(CFLAGS) $(INCFLAGS) $(CPPFLAGS) \ - -DMAKE_MJIT_BUILD_DIR=1 -DMJIT_MIN_HEADER='"$(MJIT_MIN_HEADER)"' \ - $(OUTFLAG)$@ $(srcdir)/ruby-runner.c - -# yes-test-basic: leaked-globals -leaked-globals: $(COMMONOBJS) prog $(tooldir)/leaked-globals PHONY - $(Q) $(XRUBY) $(tooldir)/leaked-globals NM=$(NM) 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: diff --git a/template/builtin_binary.inc.tmpl b/template/builtin_binary.inc.tmpl index 787ced5f3d..2c2f071705 100644 --- a/template/builtin_binary.inc.tmpl +++ b/template/builtin_binary.inc.tmpl @@ -10,19 +10,19 @@ static const unsigned char <%= feature %>_bin[] = { % iseq \ % . to_binary \ % . each_byte \ -% . map(&:ord) \ -% . map{ '0x%02x' % _1 } \ % . each_slice(12) {|a| - <%= a.join(', ') %>, + <%= a.map{ '0x%02x,' % _1 }.join(' ') %> % } }; % } +#define BUILTIN_BIN(feature) \ + { #feature, feature ## _bin, sizeof(feature ## _bin), } static const struct builtin_binary builtin_binary[] = { % ary.each{|feature, | - { <%= feature.dump %>, <%= feature %>_bin, sizeof(<%= feature %>_bin), }, + BUILTIN_BIN(<%= feature %>), % } - { NULL, },<%# dummy entry %> + { NULL, },/* sentinel */ }; #define BUILTIN_BINARY_SIZE <%= ary.size %> diff --git a/template/configure-ext.mk.tmpl b/template/configure-ext.mk.tmpl index 8ba6b963e3..bc192a37ce 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)'" 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 924abeb2fb..ac6b280188 100644 --- a/template/exts.mk.tmpl +++ b/template/exts.mk.tmpl @@ -19,18 +19,17 @@ opt = OptionParser.new do |o| o.on('--configure-exts=FILE') {|v| confexts = v} o.order!(ARGV) end -confexts &&= File.read(confexts).scan(/^exts: (.*\.mk)/).flatten rescue nil +confexts &&= File.read(confexts).scan(/^(?:ext|gem)s: (.*\.mk)/).flatten rescue nil confexts ||= [] macros["old_extensions"] = [] contpat = /(?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*/ Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e| - gem = /\Agems(?=\/)/ =~ e + gem = e.start_with?(".bundle/gems/") s = File.read(e) - s.scan(/^(extensions|SUBMAKEOPTS|EXT[A-Z]+|MFLAGS|NOTE_[A-Z]+)[ \t]*=[ \t]*(#{contpat})$/o) do |n, v| + 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? - next if gem and n != "extensions" n = "old_extensions" if n == "extensions" and !confexts.include?(e) v = v.split m = macros[n] ||= [] @@ -70,6 +69,13 @@ Dir.glob("{ext,.bundle/gems}/*/exts.mk") do |e| end end deps.uniq! + +# 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 @@ -133,7 +139,7 @@ distclean: % end libencs: - $(Q)$(MAKE)<%=mflags%> -f enc.mk V=$(V) $@ + $(Q)$(MAKE)<%=mflags%> -f enc.mk V=$(V) MINIRUBY="$(MINIRUBY)" $@ ext/extinit.<%=objext%>: $(Q)$(MAKE)<%=mflags%> V=$(V) EXTINITS="$(EXTINITS)" $@ @@ -155,8 +161,8 @@ ext/extinit.<%=objext%>: % end $(Q)<%= submake %><%=mflags%> V=$(V) $(@F) % if /^(dist|real)clean$/ =~ tgt - $(Q)$(RM) $(@D)/exts.mk - $(Q)$(RMDIRS) $(@D) + $(Q)$(RM) <%=t[%r[\A(?:\.[^/]+/)?(?:[^/]+/){2}]]%>exts.mk + -$(Q)$(RMDIRS) $(@D) % end % end % end diff --git a/template/fake.rb.in b/template/fake.rb.in index 25053d3dbf..5e52d95594 100644 --- a/template/fake.rb.in +++ b/template/fake.rb.in @@ -1,3 +1,5 @@ +# frozen_string_literal: true +# shareable_constant_value: literal <% arg = {} while /\A(\w+)=(.*)/ =~ ARGV[0] @@ -7,16 +9,23 @@ while /\A(\w+)=(.*)/ =~ ARGV[0] end if inc = arg['i'] src = inc == '-' ? STDIN.read : File.read(inc) - def src.value(name) - eval(self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#')) - 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, v| - version[n] = src.value(v) + src.gsub!(/^#.*\n/, '') +else + src = "" +end +def src.value(name) + unless val = self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1] + return end - arg['RUBY_DESCRIPTION_WITH_JIT'] = src.value('description_with_jit') + eval(val.gsub(/#/, '\\#').gsub(/((?:\G|[^\\])(?:\\\\)*)\n/, '\1')) +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| + 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']%>" _\ =begin @@ -32,12 +41,20 @@ class Object CROSS_COMPILING = RUBY_PLATFORM constants.grep(/^RUBY_/) {|n| remove_const n} % arg['versions'].each {|n, v| - <%=n%> = <%if n=='RUBY_DESCRIPTION' %>RubyVM.const_defined?(:JIT) && RubyVM::JIT.enabled? ? - <%=arg['RUBY_DESCRIPTION_WITH_JIT'].inspect%> : - <%end%><%=v.inspect%> + <%=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%> % } 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 4f30875c04..5b9e879730 100644 --- a/template/id.c.tmpl +++ b/template/id.c.tmpl @@ -12,7 +12,7 @@ **********************************************************************/ <% defs = File.join(File.dirname(File.dirname(erb.filename)), "defs/id.def") -ids = eval(File.read(defs), binding, defs) +ids = eval(File.read(defs), nil, defs) ops = ids[:token_op].uniq {|id, op, token| token && op} %> % ops.each do |_id, _op, token| diff --git a/template/id.h.tmpl b/template/id.h.tmpl index 687cbbbe40..4f7053885f 100644 --- a/template/id.h.tmpl +++ b/template/id.h.tmpl @@ -11,10 +11,8 @@ **********************************************************************/ <% -op_id_offset = 128 - defs = File.join(File.dirname(File.dirname(erb.filename)), "defs/id.def") -ids = eval(File.read(defs), binding, defs) +ids = eval(File.read(defs), nil, defs) types = ids.keys.grep(/^[A-Z]/) %> #ifndef RUBY_ID_H @@ -49,11 +47,9 @@ enum ruby_id_types { #define symIFUNC ID2SYM(idIFUNC) #define symCFUNC ID2SYM(idCFUNC) -% index = op_id_offset -% ids[:token_op].each do |_id, _op, token| +% ids[:token_op].each do |_id, _op, token, index| % next unless token #define RUBY_TOKEN_<%=token%> <%=index%> -% index += 1 % end #define RUBY_TOKEN(t) RUBY_TOKEN_##t @@ -66,29 +62,38 @@ enum ruby_method_ids { % ids[:token_op].uniq {|_, op| op}.each do |id, op, token| id<%=id%> = <%=token ? "RUBY_TOKEN(#{token})" : "'#{op}'"%>, % end - tPRESERVED_ID_BEGIN = <%=index-1%>, + tPRESERVED_ID_BEGIN = <%=ids[:last_token]%>, % ids[:preserved].each do |token| 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/prelude.c.tmpl b/template/prelude.c.tmpl index a36e572a41..e17a75da79 100644 --- a/template/prelude.c.tmpl +++ b/template/prelude.c.tmpl @@ -20,7 +20,6 @@ class Prelude def initialize(output, preludes, vpath) @output = output - @have_sublib = false @vpath = vpath @prelude_count = 0 @builtin_count = 0 @@ -44,11 +43,14 @@ 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 - comment = ($1 || '' if line.sub!(/(?:^|\s+)\#(?:$|[#\s](.*))/, '')) + comment = ($1 || '' if line.sub!(/(?:^|\s+)\#(?!\{)(?:$|(?:[#\s]|(?=\W))(.*))/, '')) if !line.empty? or start_line line << "\n" start_line ||= lineno @@ -64,12 +66,15 @@ class Prelude end path = translate("#{path}.rb", true) rescue nil if path - @have_sublib = true - "TMP_RUBY_PREFIX.require(#{path[0]})" + # This library will be loaded before this, + # the order cannot be preserved + comment = "#{orig} #{comment}".rstrip + "" else orig end end + comment.force_encoding(enc) if enc and comment lines << [line, comment] end result << (start_line || 1) @@ -85,6 +90,7 @@ 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/ruby.h" @@ -131,59 +137,43 @@ static const struct { COMPILER_WARNING_POP -% if @have_sublib -#define PRELUDE_COUNT <%=preludes.size%> - -struct prelude_env { - volatile VALUE prefix_path; -#if PRELUDE_COUNT > 0 - char loaded[PRELUDE_COUNT]; -#endif -}; - -static VALUE -prelude_prefix_path(VALUE self) -{ - struct prelude_env *ptr = DATA_PTR(self); - return ptr->prefix_path; -} - -% end % 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) +static VALUE +prelude_ast_value(VALUE name, VALUE code, int line) { - rb_ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line); - if (!ast->body.root) { - rb_ast_dispose(ast); - rb_exc_raise(rb_errinfo()); + rb_ast_t *ast; + VALUE ast_value = rb_parser_compile_string_path(rb_parser_new(), name, code, line); + ast = rb_ruby_ast_data_get(ast_value); + if (!ast || !ast->body.root) { + if (ast) rb_ast_dispose(ast); + rb_exc_raise(rb_errinfo()); } - return ast; + return ast_value; } % end % if @builtin_count > 0 -#define PRELUDE_AST(n, name_str, start_line) \ +#define PRELUDE_VAST(n, name_str, start_line) \ (((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) + prelude_ast_value((name_str) = PRELUDE_NAME(n), PRELUDE_CODE(n), start_line) : Qnil) -rb_ast_t * -rb_builtin_ast(const char *feature_name, VALUE *name_str) +VALUE +rb_builtin_ast_value(const char *feature_name, VALUE *name_str) { const size_t prefix_len = rb_strlen_lit("<internal:"); size_t namelen = strlen(feature_name); - rb_ast_t *ast = 0; + VALUE ast_value = Qnil; % @preludes.each_value do |i, prelude, lines, sub, start_line| -% if sub and sub != true - if ((ast = PRELUDE_AST(<%=i%><%=%>, *name_str, <%=start_line%>)) != 0) return ast; +% if sub + if (!NIL_P(ast_value = PRELUDE_VAST(<%=i%><%=%>, *name_str, <%=start_line%>))) return ast_value; % end % end - return ast; + return ast_value; } % end @@ -196,82 +186,38 @@ 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; */ + TRUE, /* unsigned int inline_const_cache; */ + TRUE, /* unsigned int peephole_optimization; */ + FALSE,/* unsigned int tailcall_optimization; */ + TRUE, /* unsigned int specialized_instruction; */ + TRUE, /* unsigned int operands_unification; */ + TRUE, /* unsigned int instructions_unification; */ + TRUE, /* unsigned int frozen_string_literal; */ + FALSE, /* unsigned 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, INT2FIX(line), - NULL, 0, ISEQ_TYPE_TOP, &optimization)); + rb_ast_t *ast; + VALUE ast_value = prelude_ast_value(name, code, line); + ast = rb_ruby_ast_data_get(ast_value); + rb_iseq_eval(rb_iseq_new_with_opt(ast_value, name, name, Qnil, line, + NULL, 0, ISEQ_TYPE_TOP, &optimization, + Qnil)); rb_ast_dispose(ast); } COMPILER_WARNING_POP % end -% if @have_sublib -static VALUE -prelude_require(VALUE self, VALUE nth) -{ - struct prelude_env *ptr = DATA_PTR(self); - VALUE code, name; - int n = FIX2INT(nth); - int start_line; - - if (n > PRELUDE_COUNT) return Qfalse; - if (ptr->loaded[n]) return Qfalse; - ptr->loaded[n] = 1; - switch (n) { -% @preludes.each_value do |i, prelude, lines, sub, start_line| -% if sub == true - case <%=i%><%=%>: - code = PRELUDE_CODE(<%=i%><%=%>); - name = PRELUDE_NAME(<%=i%><%=%>); - start_line = <%=start_line%>; - break; -% end -% end - default: - return Qfalse; - } - prelude_eval(code, name, start_line); - return Qtrue; -} - -% end %end % init_name = @output && @output[/\w+(?=_prelude.c\b)/] || 'prelude' void Init_<%=init_name%><%=%>(void) { %unless @prelude_count.zero? -% if @have_sublib - struct prelude_env memo; - ID name = rb_intern("TMP_RUBY_PREFIX"); - VALUE prelude = Data_Wrap_Struct(rb_cData, 0, 0, &memo); - - memo.prefix_path = rb_const_remove(rb_cObject, name); - rb_const_set(rb_cObject, name, prelude); - rb_define_singleton_method(prelude, "to_s", prelude_prefix_path, 0); -% end -% if @have_sublib - memset(memo.loaded, 0, sizeof(memo.loaded)); - rb_define_singleton_method(prelude, "require", prelude_require, 1); -% end % preludes.each do |i, prelude, lines, sub, start_line| % next if sub - prelude_eval(PRELUDE_CODE(<%=i%><%=%>), PRELUDE_NAME(<%=i%><%=%>), <%=start_line%>); -% end -% if @have_sublib - rb_gc_force_recycle(prelude); + prelude_eval(PRELUDE_CODE(<%=i%><%=%>), PRELUDE_NAME(<%=i%><%=%>), <%=start_line%><%=%>); % end #if 0 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/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_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 |