diff options
Diffstat (limited to 'freetype/builds')
-rw-r--r-- | freetype/builds/cmake/FindBrotliDec.cmake | 51 | ||||
-rw-r--r-- | freetype/builds/meson/extract_freetype_version.py | 107 | ||||
-rw-r--r-- | freetype/builds/meson/extract_libtool_version.py | 105 | ||||
-rw-r--r-- | freetype/builds/meson/generate_reference_docs.py | 79 | ||||
-rw-r--r-- | freetype/builds/meson/parse_modules_cfg.py | 160 | ||||
-rw-r--r-- | freetype/builds/meson/process_ftoption_h.py | 105 | ||||
-rw-r--r-- | freetype/builds/unix/ax_compare_version.m4 | 177 | ||||
-rw-r--r-- | freetype/builds/unix/ax_prog_python_version.m4 | 66 | ||||
-rw-r--r-- | freetype/builds/unix/ftconfig.h.in | 62 |
9 files changed, 912 insertions, 0 deletions
diff --git a/freetype/builds/cmake/FindBrotliDec.cmake b/freetype/builds/cmake/FindBrotliDec.cmake new file mode 100644 index 000000000..7c484c7df --- /dev/null +++ b/freetype/builds/cmake/FindBrotliDec.cmake @@ -0,0 +1,51 @@ +# FindBrotliDec.cmake +# +# Copyright (C) 2019-2020 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# Written by Werner Lemberg <wl@gnu.org> +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. +# +# +# Try to find libbrotlidec include and library directories. +# +# If found, the following variables are set. +# +# BROTLIDEC_INCLUDE_DIRS +# BROTLIDEC_LIBRARIES + +include(FindPkgConfig) +pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec) + +if (PC_BROTLIDEC_VERSION) + set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}") +endif () + + +find_path(BROTLIDEC_INCLUDE_DIRS + NAMES brotli/decode.h + HINTS ${PC_BROTLIDEC_INCLUDEDIR} + ${PC_BROTLIDEC_INCLUDE_DIRS} + PATH_SUFFIXES brotli) + +find_library(BROTLIDEC_LIBRARIES + NAMES brotlidec + HINTS ${PC_BROTLIDEC_LIBDIR} + ${PC_BROTLIDEC_LIBRARY_DIRS}) + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + brotlidec + REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES + FOUND_VAR BROTLIDEC_FOUND + VERSION_VAR BROTLIDEC_VERSION) + +mark_as_advanced( + BROTLIDEC_INCLUDE_DIRS + BROTLIDEC_LIBRARIES) diff --git a/freetype/builds/meson/extract_freetype_version.py b/freetype/builds/meson/extract_freetype_version.py new file mode 100644 index 000000000..15e87dbcc --- /dev/null +++ b/freetype/builds/meson/extract_freetype_version.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +"""Extract the FreeType version numbers from `<freetype/freetype.h>`. + +This script parses the header to extract the version number defined there. +By default, the full dotted version number is printed, but `--major`, +`--minor` or `--patch` can be used to only print one of these values +instead. +""" + +from __future__ import print_function + +import argparse +import os +import re +import sys + +# Expected input: +# +# ... +# #define FREETYPE_MAJOR 2 +# #define FREETYPE_MINOR 10 +# #define FREETYPE_PATCH 2 +# ... + +RE_MAJOR = re.compile(r"^ \#define \s+ FREETYPE_MAJOR \s+ (.*) $", re.X) +RE_MINOR = re.compile(r"^ \#define \s+ FREETYPE_MINOR \s+ (.*) $", re.X) +RE_PATCH = re.compile(r"^ \#define \s+ FREETYPE_PATCH \s+ (.*) $", re.X) + + +def parse_freetype_header(header): + major = None + minor = None + patch = None + + for line in header.splitlines(): + line = line.rstrip() + m = RE_MAJOR.match(line) + if m: + assert major == None, "FREETYPE_MAJOR appears more than once!" + major = m.group(1) + continue + + m = RE_MINOR.match(line) + if m: + assert minor == None, "FREETYPE_MINOR appears more than once!" + minor = m.group(1) + continue + + m = RE_PATCH.match(line) + if m: + assert patch == None, "FREETYPE_PATCH appears more than once!" + patch = m.group(1) + continue + + assert ( + major and minor and patch + ), "This header is missing one of FREETYPE_MAJOR, FREETYPE_MINOR or FREETYPE_PATCH!" + + return (major, minor, patch) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + group = parser.add_mutually_exclusive_group() + group.add_argument( + "--major", + action="store_true", + help="Only print the major version number.", + ) + group.add_argument( + "--minor", + action="store_true", + help="Only print the minor version number.", + ) + group.add_argument( + "--patch", + action="store_true", + help="Only print the patch version number.", + ) + + parser.add_argument( + "input", + metavar="FREETYPE_H", + help="The input freetype.h header to parse.", + ) + + args = parser.parse_args() + with open(args.input) as f: + header = f.read() + + version = parse_freetype_header(header) + + if args.major: + print(version[0]) + elif args.minor: + print(version[1]) + elif args.patch: + print(version[2]) + else: + print("%s.%s.%s" % version) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/freetype/builds/meson/extract_libtool_version.py b/freetype/builds/meson/extract_libtool_version.py new file mode 100644 index 000000000..0569481b3 --- /dev/null +++ b/freetype/builds/meson/extract_libtool_version.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +"""Extract the libtool version from `configure.raw`. + +This script parses the `configure.raw` file to extract the libtool version +number. By default, the full dotted version number is printed, but +`--major`, `--minor` or `--patch` can be used to only print one of these +values instead. +""" + +from __future__ import print_function + +import argparse +import os +import re +import sys + +# Expected input: +# +# ... +# version_info='23:2:17' +# ... + +RE_VERSION_INFO = re.compile(r"^version_info='(\d+):(\d+):(\d+)'") + + +def parse_configure_raw(header): + major = None + minor = None + patch = None + + for line in header.splitlines(): + line = line.rstrip() + m = RE_VERSION_INFO.match(line) + if m: + assert major == None, "version_info appears more than once!" + major = m.group(1) + minor = m.group(2) + patch = m.group(3) + continue + + assert ( + major and minor and patch + ), "This input file is missing a version_info definition!" + + return (major, minor, patch) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + group = parser.add_mutually_exclusive_group() + group.add_argument( + "--major", + action="store_true", + help="Only print the major version number.", + ) + group.add_argument( + "--minor", + action="store_true", + help="Only print the minor version number.", + ) + group.add_argument( + "--patch", + action="store_true", + help="Only print the patch version number.", + ) + group.add_argument( + "--soversion", + action="store_true", + help="Only print the libtool library suffix.", + ) + + parser.add_argument( + "input", + metavar="CONFIGURE_RAW", + help="The input configure.raw file to parse.", + ) + + args = parser.parse_args() + with open(args.input) as f: + raw_file = f.read() + + version = parse_configure_raw(raw_file) + + if args.major: + print(version[0]) + elif args.minor: + print(version[1]) + elif args.patch: + print(version[2]) + elif args.soversion: + # Convert libtool version_info to the library suffix. + # (current,revision, age) -> (current - age, age, revision) + print( + "%d.%s.%s" + % (int(version[0]) - int(version[2]), version[2], version[1]) + ) + else: + print("%s.%s.%s" % version) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/freetype/builds/meson/generate_reference_docs.py b/freetype/builds/meson/generate_reference_docs.py new file mode 100644 index 000000000..219017c9d --- /dev/null +++ b/freetype/builds/meson/generate_reference_docs.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +"""Generate FreeType reference documentation.""" + +from __future__ import print_function + +import argparse +import glob +import os +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "--input-dir", + required=True, + help="Top-level FreeType source directory.", + ) + + parser.add_argument( + "--version", required=True, help='FreeType version (e.g. "2.x.y").' + ) + + parser.add_argument( + "--output-dir", required=True, help="Output directory." + ) + + args = parser.parse_args() + + # Get the list of input files of interest. + include_dir = os.path.join(args.input_dir, "include") + include_config_dir = os.path.join(include_dir, "config") + include_cache_dir = os.path.join(include_dir, "cache") + + all_headers = ( + glob.glob(os.path.join(args.input_dir, "include", "freetype", "*.h")) + + glob.glob( + os.path.join( + args.input_dir, "include", "freetype", "config", "*.h" + ) + ) + + glob.glob( + os.path.join( + args.input_dir, "include", "freetype", "cache", "*.h" + ) + ) + ) + + if not os.path.exists(args.output_dir): + os.makedirs(args.output_dir) + else: + assert os.path.isdir(args.output_dir), ( + "Not a directory: " + args.output_dir + ) + + cmds = [ + sys.executable, + "-m", + "docwriter", + "--prefix=ft2", + "--title=FreeType-" + args.version, + "--site=reference", + "--output=" + args.output_dir, + ] + all_headers + + print("Running docwriter...") + subprocess.check_call(cmds) + + print("Building static site...") + subprocess.check_call( + [sys.executable, "-m", "mkdocs", "build"], cwd=args.output_dir + ) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/freetype/builds/meson/parse_modules_cfg.py b/freetype/builds/meson/parse_modules_cfg.py new file mode 100644 index 000000000..e0f760561 --- /dev/null +++ b/freetype/builds/meson/parse_modules_cfg.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python +"""Parse modules.cfg and dump its output either as ftmodule.h or a list of +base extensions. +""" + +from __future__ import print_function + +import argparse +import os +import re +import sys + +# Expected input: +# +# ... +# FONT_MODULES += <name> +# HINTING_MODULES += <name> +# RASTER_MODULES += <name> +# AUX_MODULES += <name> +# BASE_EXTENSIONS += <name> +# ... + + +def parse_modules_cfg(input_file): + + lists = { + "FONT_MODULES": [], + "HINTING_MODULES": [], + "RASTER_MODULES": [], + "AUX_MODULES": [], + "BASE_EXTENSIONS": [], + } + + for line in input_file.splitlines(): + line = line.rstrip() + # Ignore empty lines and those that start with a comment. + if not line or line[0] == "#": + continue + + items = line.split() + assert len(items) == 3 and items[1] == "+=", ( + "Unexpected input line [%s]" % line + ) + assert items[0] in lists, ( + "Unexpected configuration variable name " + items[0] + ) + + lists[items[0]].append(items[2]) + + return lists + + +def generate_ftmodule(lists): + result = "/* This is a generated file. */\n" + for driver in lists["FONT_MODULES"]: + if driver == "sfnt": # Special case for the sfnt 'driver'. + result += "FT_USE_MODULE( FT_Module_Class, sfnt_module_class )\n" + continue + + name = { + "truetype": "tt", + "type1": "t1", + "cid": "t1cid", + "type42": "t42", + "winfonts": "winfnt", + }.get(driver, driver) + result += ( + "FT_USE_MODULE( FT_Driver_ClassRec, %s_driver_class )\n" % name + ) + + for module in lists["HINTING_MODULES"]: + result += ( + "FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module + ) + + for module in lists["RASTER_MODULES"]: + name = { + "raster": "ft_raster1", + "smooth": "ft_smooth", + }.get(module) + result += ( + "FT_USE_MODULE( FT_Renderer_Class, %s_renderer_class )\n" % name + ) + + for module in lists["AUX_MODULES"]: + if module in ("psaux", "psnames", "otvalid", "gxvalid"): + result += ( + "FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module + ) + + result += "/* EOF */\n" + return result + + +def generate_main_modules(lists): + return "\n".join( + lists["FONT_MODULES"] + + lists["HINTING_MODULES"] + + lists["RASTER_MODULES"] + ) + + +def generate_aux_modules(lists): + return "\n".join(lists["AUX_MODULES"]) + + +def generate_base_extensions(lists): + return "\n".join(lists["BASE_EXTENSIONS"]) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "--format", + required=True, + choices=( + "ftmodule.h", + "main-modules", + "aux-modules", + "base-extensions-list", + ), + help="Select output format.", + ) + + parser.add_argument( + "input", + metavar="CONFIGURE_RAW", + help="The input configure.raw file to parse.", + ) + + parser.add_argument("--output", help="Output file (default is stdout).") + + args = parser.parse_args() + with open(args.input) as f: + input_data = f.read() + + lists = parse_modules_cfg(input_data) + + if args.format == "ftmodule.h": + result = generate_ftmodule(lists) + elif args.format == "main-modules": + result = generate_main_modules(lists) + elif args.format == "aux-modules": + result = generate_aux_modules(lists) + elif args.format == "base-extensions-list": + result = generate_base_extensions(lists) + else: + assert False, "Invalid output format!" + + if args.output: + with open(args.output, "w") as f: + f.write(result) + else: + print(result) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/freetype/builds/meson/process_ftoption_h.py b/freetype/builds/meson/process_ftoption_h.py new file mode 100644 index 000000000..b5f80c314 --- /dev/null +++ b/freetype/builds/meson/process_ftoption_h.py @@ -0,0 +1,105 @@ +#!/usr/bin/python +"""Toggle settings in `ftoption.h` file based on command-line arguments. + +This script takes an `ftoption.h` file as input and rewrites +`#define`/`#undef` lines in it based on `--enable=CONFIG_VARNAME` or +`--disable=CONFIG_VARNAME` arguments passed to it, where `CONFIG_VARNAME` is +configuration variable name, such as `FT_CONFIG_OPTION_USE_LZW`, that may +appear in the file. + +Note that if one of `CONFIG_VARNAME` is not found in the input file, this +script exits with an error message listing the missing variable names. +""" + +import argparse +import os +import re +import sys + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "input", metavar="FTOPTION_H", help="Path to input ftoption.h file." + ) + + parser.add_argument("--output", help="Output to file instead of stdout.") + + parser.add_argument( + "--enable", + action="append", + default=[], + help="Enable a given build option (e.g. FT_CONFIG_OPTION_USE_LZW).", + ) + + parser.add_argument( + "--disable", + action="append", + default=[], + help="Disable a given build option.", + ) + + args = parser.parse_args() + + common_options = set(args.enable) & set(args.disable) + if common_options: + parser.error( + "Options cannot be both enabled and disabled: %s" + % sorted(common_options) + ) + return 1 + + with open(args.input) as f: + input_file = f.read() + + options_seen = set() + + new_lines = [] + for line in input_file.splitlines(): + # Expected formats: + # #define <CONFIG_VAR> + # /* #define <CONFIG_VAR> */ + # #undef <CONFIG_VAR> + line = line.rstrip() + if line.startswith("/* #define ") and line.endswith(" */"): + option_name = line[11:-3].strip() + option_enabled = False + elif line.startswith("#define "): + option_name = line[8:].strip() + option_enabled = True + elif line.startswith("#undef "): + option_name = line[7:].strip() + option_enabled = False + else: + new_lines.append(line) + continue + + options_seen.add(option_name) + if option_enabled and option_name in args.disable: + line = "#undef " + option_name + elif not option_enabled and option_name in args.enable: + line = "#define " + option_name + new_lines.append(line) + + result = "\n".join(new_lines) + + # Sanity check that all command-line options were actually processed. + cmdline_options = set(args.enable) | set(args.disable) + assert cmdline_options.issubset( + options_seen + ), "Could not find options in input file: " + ", ".join( + sorted(cmdline_options - options_seen) + ) + + if args.output: + with open(args.output, "w") as f: + f.write(result) + else: + print(result) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/freetype/builds/unix/ax_compare_version.m4 b/freetype/builds/unix/ax_compare_version.m4 new file mode 100644 index 000000000..ffb4997e8 --- /dev/null +++ b/freetype/builds/unix/ax_compare_version.m4 @@ -0,0 +1,177 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 13 + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [invalid OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([invalid OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff --git a/freetype/builds/unix/ax_prog_python_version.m4 b/freetype/builds/unix/ax_prog_python_version.m4 new file mode 100644 index 000000000..dbc3dbf1d --- /dev/null +++ b/freetype/builds/unix/ax_prog_python_version.m4 @@ -0,0 +1,66 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_python_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_PYTHON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# Makes sure that python supports the version indicated. If true the shell +# commands in ACTION-IF-TRUE are executed. If not the shell commands in +# ACTION-IF-FALSE are run. Note if $PYTHON is not set (for example by +# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail. +# +# Example: +# +# AC_PATH_PROG([PYTHON],[python]) +# AX_PROG_PYTHON_VERSION([2.4.4],[ ... ],[ ... ]) +# +# This will check to make sure that the python you have supports at least +# version 2.4.4. +# +# NOTE: This macro uses the $PYTHON variable to perform the check. +# AX_WITH_PYTHON can be used to set that variable prior to running this +# macro. The $PYTHON_VERSION variable will be valorized with the detected +# version. +# +# LICENSE +# +# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 12 + +AC_DEFUN([AX_PROG_PYTHON_VERSION],[ + AC_REQUIRE([AC_PROG_SED]) + AC_REQUIRE([AC_PROG_GREP]) + + AS_IF([test -n "$PYTHON"],[ + ax_python_version="$1" + + AC_MSG_CHECKING([for python version]) + changequote(<<,>>) + python_version=`$PYTHON -V 2>&1 | $GREP "^Python " | $SED -e 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'` + changequote([,]) + AC_MSG_RESULT($python_version) + + AC_SUBST([PYTHON_VERSION],[$python_version]) + + AX_COMPARE_VERSION([$ax_python_version],[le],[$python_version],[ + : + $2 + ],[ + : + $3 + ]) + ],[ + AC_MSG_WARN([could not find the python interpreter]) + $3 + ]) +]) diff --git a/freetype/builds/unix/ftconfig.h.in b/freetype/builds/unix/ftconfig.h.in new file mode 100644 index 000000000..00b5a8226 --- /dev/null +++ b/freetype/builds/unix/ftconfig.h.in @@ -0,0 +1,62 @@ +/**************************************************************************** + * + * ftconfig.h.in + * + * UNIX-specific configuration file (specification only). + * + * Copyright (C) 1996-2020 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + + /************************************************************************** + * + * This header file contains a number of macro definitions that are used by + * the rest of the engine. Most of the macros here are automatically + * determined at compile time, and you should not need to change it to port + * FreeType, except to compile the library with a non-ANSI compiler. + * + * Note however that if some specific modifications are needed, we advise + * you to place a modified copy in your build directory. + * + * The build directory is usually `builds/<system>`, and contains + * system-specific files that are always included first when building the + * library. + * + */ + +#ifndef FTCONFIG_H_ +#define FTCONFIG_H_ + +#include <ft2build.h> +#include FT_CONFIG_OPTIONS_H +#include FT_CONFIG_STANDARD_LIBRARY_H + +#undef HAVE_UNISTD_H +#undef HAVE_FCNTL_H + +#undef FT_USE_AUTOCONF_SIZEOF_TYPES +#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES + +#undef SIZEOF_INT +#undef SIZEOF_LONG +#define FT_SIZEOF_INT SIZEOF_INT +#define FT_SIZEOF_LONG SIZEOF_LONG + +#endif /* FT_USE_AUTOCONF_SIZEOF_TYPES */ + +#include <freetype/config/integer-types.h> +#include <freetype/config/public-macros.h> +#include <freetype/config/mac-support.h> + +#endif /* FTCONFIG_H_ */ + + +/* END */ |