Compare commits

..

2 Commits

Author SHA1 Message Date
Greg Williamson 8d73e559bb
wrap lines at 78 columns 2020-08-30 17:57:20 -04:00
Greg Williamson 3f82a109c0
Greg Williamson 2020 GsoC Pproject to add continous integration 2020-08-30 12:59:45 -04:00
683 changed files with 13696 additions and 44728 deletions

10
.gitignore vendored
View File

@ -1,7 +1,3 @@
/build/
/config.mk
include/dlg/
src/dlg/dlg.c
subprojects/*
!subprojects/*.wrap
/tests/data/*
config.mk
objs/vc2010/
build

View File

@ -1,230 +0,0 @@
# CI setup for FreeType.
stages:
- build
# FIXME: Use --werror once warnings are fixed.
variables:
MESON_ARGS: --fatal-meson-warnings --default-library=both
MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib
.build windows common:
# See
# https://gitlab.freedesktop.org/gstreamer/gst-ci/container_registry/213
image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:2021-09-09.0-master'
stage: 'build'
tags:
- 'docker'
- 'windows'
- '1809'
- 'gstreamer-windows'
.build linux common:
# See
# https://gitlab.freedesktop.org/freetype/docker-images/container_registry/20896
image: 'registry.freedesktop.org/freetype/docker-images/debian:latest'
stage: 'build'
.build macos common:
stage: 'build'
tags:
- 'gst-macos-11.1'
.build windows meson:
extends: '.build windows common'
variables:
# Make sure any failure in PowerShell scripts is fatal.
ErrorActionPreference: 'Stop'
WarningPreference: 'Stop'
# Uncomment the following key if you need to pass custom args, as well
# with the `$env:MESON_ARGS` line in the `script:` blocks.
# MESON_ARGS: >-
# -Dfoo=enabled
# -Dbar=disabled
before_script:
# Update RootCAs in order to access to some sites.
- certutil -generateSSTFromWU "C:\roots.sst"
- Import-Certificate -CertStoreLocation "Cert:\LocalMachine\Root" "C:\roots.sst"
# Make sure meson is up to date so we don't need to rebuild the image
# with each release.
- pip3 install -U 'meson==0.59.*'
- pip3 install --upgrade certifi
- pip3 install -U ninja
# Generate a UWP cross-file in case it's used
- $PSDefaultParameterValues['Out-File:Encoding'] = 'ASCII'
- echo "[binaries]" > uwp-crossfile.meson
- echo "c = 'cl'" >> uwp-crossfile.meson
- echo "strip = ['true']" >> uwp-crossfile.meson
- echo "[built-in options]" >> uwp-crossfile.meson
- echo "c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP', '-DUNICODE', '-D_WIN32_WINNT=0x0A00', '-we4013']" >> uwp-crossfile.meson
- echo "c_winlibs = ['windowsapp.lib']" >> uwp-crossfile.meson
script:
# For some reason, options are separated by newlines instead of spaces,
# so we have to replace them first.
#
# - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
#
# Gitlab executes PowerShell in docker, but `VsDevCmd.bat` is a batch
# script. Environment variables substitutions is done by PowerShell
# before calling `cmd.exe`, that's why we use `$env:FOO` instead of
# `%FOO%`.
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH $env:VS_UWP &&
meson setup build $env:MESON_ARGS_WINDOWS $env:MESON_ARGS_UWP &&
meson compile --verbose -C build
$env:MESON_WINDOWS_TESTS"
# Format of job names:
# <OS> <Build-Tool> <Build-Params> <Architecture>
# Windows jobs.
windows meson vs2017 amd64:
extends: '.build windows meson'
variables:
ARCH: 'amd64'
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
windows meson vs2017 x86:
extends: '.build windows meson'
variables:
ARCH: 'x86'
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
windows meson vs2017 amd64 uwp:
extends: '.build windows meson'
variables:
ARCH: 'amd64'
VS_UWP: '-app_platform=UWP'
MESON_ARGS_UWP: '--cross-file uwp-crossfile.meson -Dc_winlibs="windowsapp.lib"'
# Linux Jobs.
#
# Jobs with "libs" in the name force-enable libraries.
# They are disabled for the remaining jobs.
linux autotools:
extends: '.build linux common'
script: |
./autogen.sh
./configure --with-brotli=no \
--with-bzip2=no \
--with-harfbuzz=no \
--with-png=no \
--with-zlib=no \
CC=gcc
make -j$(nproc) && make install
linux autotools libs:
extends: '.build linux common'
script: |
./autogen.sh
./configure --with-brotli=yes \
--with-bzip2=yes \
--with-harfbuzz=yes \
--with-png=yes \
--with-zlib=yes \
CC=gcc
make -j$(nproc) && make install
linux autotools libs clang:
extends: '.build linux common'
script: |
./autogen.sh
./configure --with-brotli=yes \
--with-bzip2=yes \
--with-harfbuzz=yes \
--with-png=yes \
--with-zlib=yes \
CC=clang
make -j$(nproc) && make install
linux meson:
extends: '.build linux common'
script: |
meson setup build ${MESON_ARGS} \
-Dbrotli=disabled \
-Dbzip2=disabled \
-Dharfbuzz=disabled \
-Dpng=disabled \
-Dzlib=disabled
meson compile --verbose -C build
meson install -C build
linux meson libs:
extends: '.build linux common'
script: |
meson setup build ${MESON_ARGS} \
-Dbrotli=enabled \
-Dbzip2=enabled \
-Dharfbuzz=disabled \
-Dpng=disabled \
-Dzlib=disabled
meson compile --verbose -C build
meson install -C build
linux cmake:
extends: '.build linux common'
script: |
cmake -B build -D FT_DISABLE_BROTLI=TRUE \
-D FT_DISABLE_BZIP2=TRUE \
-D FT_DISABLE_HARFBUZZ=TRUE \
-D FT_DISABLE_PNG=TRUE \
-D FT_DISABLE_ZLIB=TRUE
cmake --build build --target install
linux cmake libs:
extends: '.build linux common'
script: |
cmake -B build -D FT_REQUIRE_BROTLI=TRUE \
-D FT_REQUIRE_BZIP2=TRUE \
-D FT_REQUIRE_HARFBUZZ=TRUE \
-D FT_REQUIRE_PNG=TRUE \
-D FT_REQUIRE_ZLIB=TRUE
cmake --build build --target install
# MacOS jobs.
macos autotools:
extends: '.build macos common'
before_script:
- '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
script:
- brew install autoconf automake libtool
- ./autogen.sh
- ./configure
- 'make -j$(sysctl -n hw.logicalcpu)'
- make install
macos autotools clang:
extends: '.build macos common'
before_script:
- '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
script:
- brew install autoconf automake libtool
- ./autogen.sh
- './configure CC=clang'
- 'make -j$(sysctl -n hw.logicalcpu)'
- make install
macos meson:
extends: '.build macos common'
script:
- pip3 install --upgrade pip
- pip3 install -U meson
- pip3 install --upgrade certifi
- pip3 install -U ninja
- meson setup build ${MESON_ARGS}
- meson compile --verbose -C build
- sudo meson install -C build

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "dlg"]
path = subprojects/dlg
url = https://github.com/nyorain/dlg.git

View File

@ -1,24 +1,10 @@
Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> <behdad.esfahbod@gmail.com>
Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> <behdad@google.com>
Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org>
Alexander Borsuk <me@alex.bio> <alexander.borsuk@qnective.com>
Ewald Hew (Hew Yih Shiuan 丘毅宣) <ewaldhew@gmail.com>
Moazin Khatti (موؤذن کھٹی) <moazinkhatri@gmail.com>
Priyesh Kumar (प्रियेश कुमार) <priyeshkkumar@gmail.com>
Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com>
Nikhil Ramakrishnan (निखिल रामकृष्णन) <ramakrishnan.nikhil@gmail.com>
Dominik Röttsches <drott@chromium.org> <drott@google.com>
Kostya Serebryany <kcc@google.com> <konstantin.s.serebryany@gmail.com>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> <sssa@flavor1.ipc.hiroshima-u.ac.jp>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@IPA2004-mps.local>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@sssas-powerbook-g4-12.local>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Behdad Esfahbod <behdad@behdad.org> <behdad.esfahbod@gmail.com>
Bram Tassyns <bramt@enfocus.be> bram tassyns <BramT@enfocus.be>
Bram Tassyns <bramt@enfocus.be> <BramT@enfocus.com>
David Turner <david@freetype.org> <david.turner.dev@gmail.com>
David Turner <david@freetype.org> <digit@google.com>
Anuj Verma (अनुज वर्मा) <anujv@iitbhilai.ac.in>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> <sssa@flavor1.ipc.hiroshima-u.ac.jp>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@IPA2004-mps.local>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Ben Wagner <bungeman@gmail.com> Bungeman <bungeman@gmail.com>
Ben Wagner <bungeman@gmail.com> <bungeman@google.com>
Ben Wagner <bungeman@gmail.com> <bungeman@chromium.org>
Nikolaus Waxweiler <madigens@gmail.com> <nikolaus.waxweiler@daltonmaag.com>
Ewald Hew (Hew Yih Shiuan 丘毅宣) <ewaldhew@gmail.com>
Nikhil Ramakrishnan (निखिल रामकृष्णन) <ramakrishnan.nikhil@gmail.com>

72
CI/Readme.md Normal file
View File

@ -0,0 +1,72 @@
# Freetype2 CI
Continuous integration is a tool used in software development to ensure that
your application and/or library builds and runs correctly.
Continuous deployment takes this a step further and uses the builds from
the CI to create releases for developers and other users to download and
use. In this folder are several configuration files and scripts drafted by
Greg Williamson for a 2020 GSoC
project: https://summerofcode.withgoogle.com/projects/#5724074732421120
# How it works
Upon each commit, several builds are triggered for various operating systems
and build configurations. Each build status is then reported back to the
developers in the Pull Request comment section on GitLab or GitHub. Each
build creates artifacts containing the newly-built FreeType libraries for
developers and users to download. There are also special pipeline phases
called "Regression Tests" that run FreeType's built-in demo programs to
compare visual outputs between commits. An HTML report that contains a
table of the results is uploaded as an artifact for these tests. For text
output there is an HTML page displaying a .diff generated and for images a
special page is generated that shows both images, layered, so that you can
mouse over each to see differences. There is also a generated heatmap image
which will draw matching regions of the image in green, and any mismatching
regions in red.
# Running locally
All of the "Regression Tests" can be run locally (Currently only on
Linux-based platforms). You will need to have xvfb, imagemagick, and
prettydiff installed. You can find more details about this in
CI/ft-regression.sh. You will also need "Liberation Fonts" which can be
found here: https://releases.pagure.org/liberation-fonts/. The current
tests expect the .ttf files to be extracted to ${HOME}/test-fonts. Once set
up, you can run all tests by running ./CI/ft-regression.sh <TEST_INDEX>,
where TEST_INDEX is the index of the test you wish to run (or "all" to run
all tests). Run this command from inside the directory you cloned FreeType
to. An HTML report will then be generated to /tmp/ft-test for you to
inspect.
# Adding / Changing Tests
All regular build tests are listed and configured in azure-pipelines.yml and
the several templates it includes in the CI/ folder. If you wish to add an
additional platform or build configuration, azure-pipelines.yml is the place
to do so. For "Regression Tests", there exists a configuration file at
CI/ft-tests.config that contains an array where you can add, remove or change
test configurations. Each line in the array is a separate test. In order to
have Azure run new tests, you will also need to modify azure-pipelines.yml
at the root of the project to add/remove tests from the matrix. For each
test, you will need to add a line to the yaml like so:
```yaml
strategy:
matrix:
Test1:
TEST: 0
Test2:
TEST: 1
Test3:
TEST: 2
```
# Todo
Savannah doesn't allow for integration with any modern CI so this cannot be
implemented directly until FreeType moves to GitLab or GitHub. GitHub makes
integrating this as simple as a few mouse clicks. For the GitLab route,
however, we may need to port my yaml configurations to their CI's format.
Another alternative is mirroring the repo. GitLab does have some mirroring
capabilities, but for Savannah, developers would need to upload their commit
to both manually.

21
CI/arch-setup.yml Normal file
View File

@ -0,0 +1,21 @@
steps:
- bash: |
set -e
cd $(Build.BinariesDirectory)
ARCH_URL=`curl -s https://mirrors.acm.wpi.edu/archlinux/iso/latest/ | egrep -o 'archlinux-bootstrap-([0-9._]+)-x86_64.tar.gz' | head -n1`
echo https://mirrors.acm.wpi.edu/archlinux/iso/latest/$ARCH_URL
curl https://mirrors.acm.wpi.edu/archlinux/iso/latest/$ARCH_URL -o arch.tar.gz
sudo tar xzf arch.tar.gz
sudo mount --bind ./root.x86_64/ ./root.x86_64/
sudo cp -R $(Agent.BuildDirectory)/freetype2 ./root.x86_64/
sudo mkdir -p ./root.x86_64/$(Build.BinariesDirectory)
sudo mount --bind $(Build.BinariesDirectory) ./root.x86_64/$(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
echo 'Server = https://mirrors.kernel.org/archlinux/\$repo/os/\$arch' >> /etc/pacman.d/mirrorlist
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --noconfirm base base-devel git gcc cmake harfbuzz zlib libpng xorg-server-xvfb imagemagick npm xorg-xwd
npm install -g pretty-diff
EOF
displayName: 'Bootstrap Archlinux'

86
CI/build-autotools.yml Normal file
View File

@ -0,0 +1,86 @@
# This is a template for building and publishing freetype2 build artifacts using autotools
parameters:
- name: buildArgs # Configure flags
default: ''
- name: mingw # Mingw requires special enviormental setup
type: boolean
default: false
- name: preCMD # Command(s) executed before calling configure
default: ''
- name: srcDIR # Location of freetype2 sources
default: '.'
- name: postCMD # Command(s) executed after calling make
default: ''
steps:
- ${{ if eq(parameters.mingw, true) }}:
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
cd $(Build.SourcesDirectory)
%CD:~0,2%\msys64\usr\bin\bash -lc "./autogen.sh && ./configure"
displayName: 'Configure'
env:
MSYSTEM: $(MINGW_UPPER)
CHERE_INVOKING: yes
MINGW_INSTALLS: $(MINGW_LOWER)
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\bash -lc "make && make install DESTDIR=$(echo \"$(Build.BinariesDirectory)/install\" | tr '\\' '/')"
%CD:~0,2%\msys64\usr\bin\bash -lc "cp -R ${{ parameters.srcDIR }} $(echo \"$(Build.BinariesDirectory)/freetype2\" | tr '\\' '/')"
displayName: 'Build and Package'
env:
MSYSTEM: $(MINGW_UPPER)
CHERE_INVOKING: yes
MINGW_INSTALLS: $(MINGW_LOWER)
# Building Demos in mingw seems broken do to configuration error of it including termios.h in ttdebug.c which doesn't exist in mingw
#- script: |
# set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
# %CD:~0,2%\msys64\usr\bin\bash -lc "cd $(echo \"$(Build.BinariesDirectory)\" | tr '\\' '/') && git clone git://git.sv.nongnu.org/freetype/freetype2-demos.git && cd freetype2-demos && make && mv bin/ $(echo \"$(Build.BinariesDirectory)/install/demos\" | tr '\\' '/')"
# displayName: 'Build Demos'
# env:
# MSYSTEM: $(MINGW_UPPER)
# CHERE_INVOKING: yes
# MINGW_INSTALLS: $(MINGW_LOWER)
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
%CD:~0,2%\msys64\usr\bin\bash -lc "zip -r $(echo \"$(Build.ArtifactStagingDirectory)/freetype-build.zip\" | tr '\\' '/') $(echo \"$(Build.BinariesDirectory)/install\" | tr '\\' '/')"
displayName: 'Stage Artifacts'
- ${{ if eq(parameters.mingw, false) }}:
- script: |
${{ parameters.preCMD }}
cd ${{ parameters.srcDIR }}
./autogen.sh
./configure ${{ parameters.buildArgs }}
${{ parameters.postCMD }}
displayName: 'Configure'
- script: |
${{ parameters.preCMD }}
cd ${{ parameters.srcDIR }}
make
make install DESTDIR=$(Build.BinariesDirectory)/install
${{ parameters.postCMD }}
displayName: 'Build and Install'
- script: |
cd ${{ parameters.srcDIR }}
git clone git://git.sv.nongnu.org/freetype/freetype2-demos.git
cd freetype2-demos
ln -s ${{ parameters.srcDIR }} ../freetype2
make
mv bin/ $(Build.BinariesDirectory)/install/demos
displayName: 'Build Demos'
- script: |
zip -r $(Build.ArtifactStagingDirectory)/freetype-build.zip $(Build.BinariesDirectory)/install
displayName: 'Stage Artifacts'
- task: PublishBuildArtifacts@1
displayName: 'Push Build Artifacts'
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(Agent.JobName)

59
CI/build-cmake.yml Normal file
View File

@ -0,0 +1,59 @@
# This is a template for building and publishing freetype2 build artifacts using CMake
parameters:
- name: buildArgs # CMake configure flags
default: ''
- name: mingw # Mingw requires special enviormental setup
type: boolean
default: false
- name: preCMD # Command(s) executed before calling CMake
default: ''
- name: srcDIR # Location of freetype2 sources
default: '.'
- name: postCMD # Command(s) executed after calling CMake
default: ''
steps:
- ${{ if eq(parameters.mingw, true) }}:
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
cd $(Build.SourcesDirectory)
%CD:~0,2%\msys64\usr\bin\bash -lc "cmake . ${{ parameters.buildArgs }} -B $(echo \"$(Build.BinariesDirectory)\" | tr '\\' '/') -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=install"
displayName: 'CMake Configure'
env:
MSYSTEM: $(MINGW_UPPER)
CHERE_INVOKING: yes
MINGW_INSTALLS: $(MINGW_LOWER)
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\bash -lc "cmake --build $(echo \"$(Build.BinariesDirectory)\" | tr '\\' '/') --config Release --target package"
displayName: 'CMake Build and Package'
env:
MSYSTEM: $(MINGW_UPPER)
CHERE_INVOKING: yes
MINGW_INSTALLS: $(MINGW_LOWER)
- ${{ if eq(parameters.mingw, false) }}:
- script: |
${{ parameters.preCMD }}
cd ${{ parameters.srcDIR }}
cmake . ${{ parameters.buildArgs }} -B $(Build.BinariesDirectory) -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=install
${{ parameters.postCMD }}
displayName: 'CMake Configure'
- script: |
${{ parameters.preCMD }}
cd ${{ parameters.srcDIR }}
cmake --build $(Build.BinariesDirectory) --config Release --target package
${{ parameters.postCMD }}
displayName: 'CMake Build and Package'
- script: mv $(Build.BinariesDirectory)/freetype-* $(Build.ArtifactStagingDirectory)
displayName: 'Stage Artifacts'
- task: PublishBuildArtifacts@1
displayName: 'Push Build Artifacts'
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(Agent.JobName)

23
CI/build.yml Normal file
View File

@ -0,0 +1,23 @@
# passthrough templateto call other build templates
parameters:
- name: buildArgs # CMake configure flags
default: ''
- name: buildArgs # CMake configure flags
default: ''
- name: mingw # Mingw requires special enviormental setup
type: boolean
default: false
- name: preCMD # Command(s) executed before calling CMake
default: ''
- name: srcDIR # Location of freetype2 sources
default: '.'
- name: postCMD # Command(s) executed after calling CMake
default: ''
- template: build-autotools.yml
parameters:
preCMD: ${{ parameters.preCMD }}
srcDIR: ${{ parameters.srcDIR }}
postCMD: ${{ parameters.postCMD }}
buildArgs: ${{ parameters.buildArgs }}

98
CI/ft-regression.sh Executable file
View File

@ -0,0 +1,98 @@
#!/bin/bash
# Include our configuration
. ./CI/ft-tests.config
# Usage: ./CI/ft-regression.sh <commit to test against> <test to run (a number or "all")>
# The following script checks the source code in the current folder for
# regressions or changes against previous commits. This is the main script you
# should be calling and the rest are more for utility.
# These scripts requires xvfb (for capturing demos), imagick
# (for comparing images) and pretty-diff which can be installed via npm
# (for diffing text)
# Below is utility function used to build both versions of freetype and
# respective demos exes linked against the specific builds
function build() {
# Here we set the script to exit on any failed command because if the build
# fails, then there's nothing to compare so no point in continuing.
set -e
./autogen.sh
./configure
make
pushd ..
[[ -d ./freetype2-demos ]]\
|| git clone ${DEMOS_URL}
pushd freetype2-demos
git checkout `git rev-list -n 1 --first-parent --before="$(git show -s --format=%ci $1)" master`
make
popd
popd
# Unset exit on error so the tests will continue to run despie any errors.
set +e
}
# The script wasn't passed a git hash to compare so we exit early and print.
if [ -z "$1" ]; then
echo "No commit specified to check out master for regression tests."
echo "Aborting!"
exit 1
fi
if [ -z "$2" ]; then
echo "No tests specified running all tests"
export RUN_TEST="all"
else
export RUN_TEST="$2"
fi
# We want a fresh checkout and work dir in order to prevent any stale changes
# from slipping through.
rm -rf "${COMP_COMMIT_DIR}" "${TEST_OUTDIR}"
# Here we store the current directories shortened commit hash which is used as
# the subdirectory name for where to dump the logs and images.
PREV_GIT_HASH=$(git log --pretty=format:'%h' -n 1)
# Again we export this because it's used in the other scripts later.
export PREVIOUS_PWD=${PWD}
# This is the first build/run of the current dir that will dump our "A"
# metricts.
build ${PREV_GIT_HASH}
./CI/ft-test.sh
# Next we set up our "B" directory by copyiing our current sources.
echo "Copying ${PWD} to ${COMP_COMMIT_DIR}"
cp -p -r "${PWD}" "${COMP_COMMIT_DIR}"
pushd "${COMP_COMMIT_DIR}"
# Clean before we checkout
make clean
# Here we stash / clean in the copied "B" directory to prevent any issues
# checking out the desired test commit.
if [[ "${PWD}" == "${COMP_COMMIT_DIR}" ]]; then
git stash
git clean -f -d
git checkout "$1"
GIT_HASH=$(git log --pretty=format:'%h' -n 1)
# Here we start the build / metrics for build "B"
build ${GIT_HASH}
# We call the scripts from the current directory as they may not exist in
# previous commits and to prevent confusion when modifying them. One set of
# scripts is called but on each call they call different versions of the demos
# exes.
${PREVIOUS_PWD}/CI/ft-test.sh ${PREV_GIT_HASH} ${GIT_HASH}
EXIT=$?
popd
else
echo "Failed to change directory to ${COMP_COMMIT_DIR}.\
Something is horribly wrong..."
echo "Aborting!"
exit 1
fi
exit 0

177
CI/ft-report.sh Executable file
View File

@ -0,0 +1,177 @@
#!/bin/bash
# Include our configuration
. ${PREVIOUS_PWD}/CI/ft-tests.config
# Arguments
FONT=$1
SIZE=$2
COMMIT_A=$3
COMMIT_B=$4
# This script generates diffs and html reports from the metrics previously
# generated.
EXIT=0
metrics_dir="$(basename ${FONT})/${SIZE}/"
diff_dir="${TEST_OUTDIR}/${COMMIT_A}_${COMMIT_B}_diffs/${metrics_dir}"
mkdir -p "${diff_dir}"
OUTDIR_A="${TEST_OUTDIR}/${COMMIT_A}/$(basename ${FONT})/${SIZE}/"
OUTDIR_B="${TEST_OUTDIR}/${COMMIT_B}/$(basename ${FONT})/${SIZE}/"
RELATIVE_OUTDIR_A="${COMMIT_A}/$(basename ${FONT})/${SIZE}/"
RELATIVE_OUTDIR_B="${COMMIT_B}/$(basename ${FONT})/${SIZE}/"
# Function below generates a page to compare images. The image should change
# between the two versions on mouse over to easily spot differences.
function write_img_comp() {
echo "<!DOCTYPE html>
<html>
<head>
<style>
.comp {
width: $(identify -format '%w' $1)px;
height: $(identify -format '%h' $1)px;
background: url(\"${RELATIVE_OUTDIR_A}/$(basename $1)\") no-repeat;
display: inline-block;
}
.comp:hover {
background: url(\"${RELATIVE_OUTDIR_B}/$(basename $1)\") no-repeat;
}
.diff {
width: $(identify -format '%w' $1)px;
height: $(identify -format '%h' $1)px;
background: url(\"${diff_dir}/$(basename $1 .png)_diff.png\") no-repeat;
display: inline-block;
}
</style>
</head>
<body>
<h2>
Comparison of $(basename $1) between commits ${COMMIT_A} and ${COMMIT_B}
</h2>
<div class=\"comp\"></div>
<div class=\"diff\"></div>
</body>
</html>"
}
# Here we start generating html report. It is just a simple table of pass / fail
# results.
echo "<!DOCTYPE html>
<html>
<head>
<style>
table, tr {
border: 1px solid black;
display:table;
margin-right:auto;
margin-left:auto;
width:100%;
}
th.fail {
color: red
}
th.pass {
color: green
}
</style>
</head>
<body>
<h2>Freetype2 Difference Report</h2>
<h3>
Commit A: ${COMMIT_A}
Commit B: ${COMMIT_B}
</h3>
<h3>
Font: $(basename $1)
</h3>
<h3>
Size: $2
</h3>
<table>"
PASS=()
FAIL=()
FILES=${OUTDIR_A}/*
for f in $FILES
do
filename=$(basename $f)
extension="${filename##*.}"
# If is png compare with imagick
if [[ "$extension" == "png" ]];
then
diif_cmd=$(compare -metric AE -highlight-color Red -lowlight-color PaleGreen $f ${OUTDIR_B}/$(basename $f)\
"${diff_dir}/$(basename $f .png)_diff.png" &> /dev/null)
result=$?
# Else if txt compare with
else
diif_cmd=$(diff $f ${OUTDIR_B}/$(basename $f) &>\
$diff_dir/$(basename $f .$extension).diff) # we only care about return result
result=$?
fi
# Generate approriate diff page
PAGE="$(basename $f .$extension)_${COMMIT_A}_${COMMIT_B}_diff.html"
if [ "$result" -eq "0" ];
then
PASS+="$f "
else
if [[ "$extension" == "png" ]];
then
write_img_comp $f &> "${TEST_OUTDIR}/${COMMIT_A}_${COMMIT_B}_diffs/$PAGE"
else
DISPLAY=-1 pretty-diff $f ${OUTDIR_B}/$(basename $f)
mv /tmp/diff.html "${TEST_OUTDIR}/${COMMIT_A}_${COMMIT_B}_diffs/$PAGE"
fi
FAIL+="$f "
fi
done
# Below we fill out the results table
echo "<tr><th class=\"fail\">FAIL</th></tr>"
for f in $FAIL
do
filename=$(basename $f)
extension="${filename##*.}"
if [[ "$filename" != "bench.txt" ]];
then
EXIT=1
fi
PAGE="$(basename $f .$extension).html"
echo "
<tr>
<td><a href=\"${COMMIT_A}_${COMMIT_B}_diffs/$(basename $f .$extension)_${COMMIT_A}_${COMMIT_B}_diff.html\">$(basename $f)</a></td>
</tr>"
done
echo "<tr><th class=\"pass\">PASS</th></tr>"
for f in $PASS
do
echo "
<tr>
<td><a href=\"${COMMIT_A}_${COMMIT_B}_diffs/${COMMIT_A}/${metrics_dir}/$(basename $f)\">$(basename $f)</a></td>
</tr>"
done
echo "
</table>
</body>
</html>"
# Move our tests results into dir so html refrences work
cp -R ${TEST_OUTDIR}/${COMMIT_A}/ ${TEST_OUTDIR}/${COMMIT_A}_${COMMIT_B}_diffs &> /dev/null
cp -R ${TEST_OUTDIR}/${COMMIT_B}/ ${TEST_OUTDIR}/${COMMIT_A}_${COMMIT_B}_diffs &> /dev/null
exit $EXIT

94
CI/ft-test-font.sh Executable file
View File

@ -0,0 +1,94 @@
#!/bin/bash
# Include our configuration
. ${PREVIOUS_PWD}/CI/ft-tests.config
# Arguments
COMMIT=$1
FONT=$2
SIZE=$3
DPI=$4
DUMP=$5
BENCH=$6
VIEW=$7
STRING=$8
START_GLYPH=$9
END_GLYPH=${10}
OUT_DIR="${TEST_OUTDIR}/${COMMIT}/$(basename ${FONT})/${SIZE}/"
# Ensure directory we want to write to exists.
mkdir -p $OUT_DIR
# This script dumps specified metrics for a specified font. The arguments listed
# above allow you to specify which metricts to dum when this script is called
# from ft-test.sh
# Below sets up a virtual X framebuffer to run the demos in. It is 1024x768 at
# 24b depth. If you need a larget screen to fit the demos change the resolution
# here.
function startX {
if [ ! -f "/tmp/.X${1}-lock" ]; then
Xvfb :"$1" -screen 0 1024x768x24 &
# Wait 2 seconds to ensure X is ready.
sleep 2
fi
}
# Below is a utility function to run a command inside the virtual frame buffer,
# wait 1 second and capture the screen and kill it.The first two arguments are
# the xvfb ID and the output image file name.
function xvfbRunAndScreenShot {
display="$1"
shift
screenshot_name="$1"
shift
DISPLAY=:"$display" $@ &
PID=$!
sleep 1
DISPLAY=:"$display" xwd -root -silent\
| convert -colorspace sRGB -define png:color-type=2 -trim xwd:- png:${OUT_DIR}/${screenshot_name}
kill $PID
}
# Because witing 1 second for every command can be slow we set up multiple xvfbs
# in order to expedite the proccess.
for worker in $(seq 1 $WORKERS)
do
startX $((98 + ${worker})) &
done
# Below are simple metricts to test that only require one run per font.
if [[ "$DUMP" -eq 1 ]]; then
${DEMOS_DIR}/ftdump ${FONT} &> ${OUT_DIR}/dump.txt
fi
if [[ "$BENCH" -eq 1 ]]; then
${DEMOS_DIR}/ftbench ${FONT} &> ${OUT_DIR}/bench.txt
fi
if [[ "$STRING" -eq 1 ]]; then
xvfbRunAndScreenShot 99 "ftstring.png" ${DEMOS_DIR}/ftstring\
-r $DPI ${SIZE} ${FONT}
fi
if [[ "$VIEW" -eq 1 ]]; then
xvfbRunAndScreenShot 99 "ftview.png" ${DEMOS_DIR}/ftview -r $DPI ${SIZE} ${FONT}
fi
# For ftgrid we run it on thousands of glyphys so this loop takes advantage of
# the above mentioned xvfb workers to speed it up.
for GLYPH in $(seq ${START_GLYPH} ${END_GLYPH})
do
((i=i%WORKERS)); ((i++==0)) && wait
echo "$(basename $FONT) ftgrid ${GLYPH}"
# Pad name with 0s to maintain order
GLYPH_padded=$(printf "%04d" ${GLYPH})
xvfbRunAndScreenShot $((98 + ${i})) "ftgrid_${GLYPH_padded}.png"\
${DEMOS_DIR}/ftgrid -r $DPI -f ${GLYPH} ${SIZE} ${FONT} &
done
sleep 2 # wait for workers to finish up
#killall Xvfb
sleep 2 # wait for all xvfb to die

124
CI/ft-test.sh Executable file
View File

@ -0,0 +1,124 @@
#!/bin/bash
# Include our configuration
. ${PREVIOUS_PWD}/CI/ft-tests.config
# Arguments to /ft-test-font.sh
#COMMIT=$1
#FONT=$2
#SIZE=$3
#DPI=$4
#DUMP=$5
#BENCH=$6
#VIEW=$7
#STRING=$8
#START_GLYPH=$9
#END_GLYPH=$10
# This script is where one might add additional tests. Currently, it cycles
# through the below directory and call the metric dumping script for any files
# in that directory. Currently, it only tests all files at pt 16 and dpi 72 and
# with ft-grid's default rendering mode.
GIT_HASH=$(git log --pretty=format:'%h' -n 1)
EXIT=0
PASS=()
FAIL=()
# Ensure directory we want to write to exists.
mkdir -p $TEST_OUTDIR
if [[ "$RUN_TEST" == "all" ]]; then
for ((i = 0; i < ${#FT_TESTS[@]}; i++))
do
args=(${FT_TESTS[$i]})
${PREVIOUS_PWD}/CI/ft-test-font.sh ${GIT_HASH} ${FT_TESTS[$i]}
if [ ! -z "$1" ]; then
${PREVIOUS_PWD}/CI/ft-report.sh ${args[0]} ${args[1]} ${1} ${2}\
&> ${TEST_OUTDIR}/ft-$(basename ${args[0]})-${args[1]}-report.html
result=$?
if [ "$result" -eq "0" ];
then
RESULT_STR="PASS"
PASS+="ft-$(basename ${args[0]})-${args[1]}-report.html "
else
RESULT_STR="FAIL"
FAIL+="ft-$(basename ${args[0]})-${args[1]}-report.html "
# We store any failure to use later in the exit command.
EXIT=1
fi
echo "ft-$(basename ${args[0]})-${args[1]}-report.html [$RESULT_STR]"
fi
done
else
args=(${FT_TESTS[$RUN_TEST]})
${PREVIOUS_PWD}/CI/ft-test-font.sh ${GIT_HASH} ${FT_TESTS[$RUN_TEST]}
if [ ! -z "$1" ]; then
${PREVIOUS_PWD}/CI/ft-report.sh ${args[0]} ${args[1]} ${1} ${2}\
&> ${TEST_OUTDIR}/ft-$(basename ${args[0]})-${args[1]}-report.html
result=$?
if [ "$result" -eq "0" ];
then
RESULT_STR="PASS"
PASS+="ft-$(basename ${args[0]})-${args[1]}-report.html "
else
RESULT_STR="FAIL"
FAIL+="ft-$(basename ${args[0]})-${args[1]}-report.html "
# We store any failure to use later in the exit command.
EXIT=1
fi
echo "ft-$(basename ${args[0]})-${args[1]}-report.html [$RESULT_STR]"
fi
fi
# Below we generate an index of all reports generated
echo "<!DOCTYPE html>
<html>
<head>
<style>
table, tr {
border: 1px solid black;
display:table;
margin-right:auto;
margin-left:auto;
width:100%;
}
th.fail {
color: red
}
th.pass {
color: green
}
</style>
</head>
<body>
<h2>Freetype2 Difference Reports Index</h2>
<table>" &> "${TEST_OUTDIR}/index.html"
echo "<tr><th class=\"fail\">FAIL</th></tr>" &>> "${TEST_OUTDIR}/index.html"
for f in $FAIL
do
echo "
<tr>
<td><a href=\"$f\">$(basename $f .html)</a></td>
</tr>" &>> "${TEST_OUTDIR}/index.html"
done
echo "<tr><th class=\"pass\">PASS</th></tr>" &>> "${TEST_OUTDIR}/index.html"
for f in $PASS
do
echo "
<tr>
<td><a href=\"$f\">$(basename $f .html)</a></td>
</tr>" &>> "${TEST_OUTDIR}/index.html"
done
echo "
</table>
</body>
</html>" &>> "${TEST_OUTDIR}/index.html"
exit $EXIT

35
CI/ft-tests.config Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
# URL to clone demos from
DEMOS_URL="git://git.sv.nongnu.org/freetype/freetype2-demos.git"
# Directory of demos relative to freetype
DEMOS_DIR="../freetype2-demos/bin"
# Base directory to ouptut test results
TEST_OUTDIR="/tmp/ft-tests"
# This is where we build the commit of freetype we wish to compare against. We
# export it here because this variable is used in other scripts invoked later.
COMP_COMMIT_DIR="/tmp/freetype2"
# Number of xvfb threads to use
WORKERS=20
# List of tests Below
## Arguments (in order)
### FONT: path to ttf
### SIZE: size to render test at
### DPI: dpi to render test at
### DUMP: boolean, run dump test
### BENCH: boolean, run bench test
### VIEW: boolean, run dump view test
### STRING: boolean, run string test
### START_GLYPH: first glyph to use in ftview tests
### END_GLYPH: last glyph to use in ftview tests
FT_TESTS=(
"${HOME}/test-fonts/LiberationSerif-Regular.ttf 16 72 1 1 1 1 0 10"
"${HOME}/test-fonts/LiberationSans-Bold.ttf 32 72 1 1 1 1 10 30"
"${HOME}/test-fonts/LiberationMono-BoldItalic.ttf 32 72 1 1 1 1 0 2394"
)

24
CI/mingw-setup.yml Normal file
View File

@ -0,0 +1,24 @@
steps:
- script: |
git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64
%CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git
displayName: Install MSYS2
- script: |
set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
%CD:~0,2%\msys64\usr\bin\curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
%CD:~0,2%\msys64\usr\bin\pacman-key --verify msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
%CD:~0,2%\msys64\usr\bin\pacman --overwrite='*' --noconfirm -U msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
displayName: Update MSYS2
- script: taskkill /f /fi "MODULES eq msys-2.0.dll" || exit /b 0s
displayName: Reset MSYS2
- script: |
set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S zip git base-devel mingw-w64-$(MINGW_ARCH)-toolchain mingw-w64-$(MINGW_ARCH)-cmake mingw-w64-$(MINGW_ARCH)-harfbuzz
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc
displayName: Install Toolchain

39
CI/regression-test.yml Normal file
View File

@ -0,0 +1,39 @@
# This is a template for building, running and publishing freetype2 build
# regression test artifacts
parameters:
- name: preCMD # Command(s) executed before calling configure
default: ''
- name: srcDIR # Location of freetype2 sources
default: '.'
- name: postCMD # Command(s) executed after calling make
default: ''
- name: testNum # Test number to run
default: '0'
steps:
- script: |
${{ parameters.preCMD }}
curl https://releases.pagure.org/liberation-fonts/liberation-fonts-ttf-2.00.1.tar.gz -o /tmp/fonts.tar.gz
tar -xf /tmp/fonts.tar.gz
mkdir -p ~/test-fonts/
mv liberation-fonts-*/*.ttf ~/test-fonts/
cd ${{ parameters.srcDIR }}
git clone git://git.sv.nongnu.org/freetype/freetype2-demos.git
cd freetype2-demos
ln -s ${{ parameters.srcDIR }} ../freetype2
cd /freetype2
./CI/ft-regression.sh master ${{ parameters.testNum }}
chmod -R 755 /tmp/ft-tests/
mv /tmp/ft-tests/ /
${{ parameters.postCMD }}
displayName: 'Run Regression Tests'
- script: |
cp -R $(Build.BinariesDirectory)/root.x86_64/ft-tests $(Build.ArtifactStagingDirectory)
displayName: 'Stage Artifacts'
- task: PublishBuildArtifacts@1
displayName: 'Push Build Artifacts'
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(Agent.JobName)

View File

@ -1,6 +1,6 @@
# CMakeLists.txt
#
# Copyright (C) 2013-2022 by
# Copyright (C) 2013-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written originally by John Cary <cary@txcorp.com>
@ -12,17 +12,13 @@
# fully.
#
#
# The following will (1) create a build directory, and (2) change into it and
# The following will 1. create a build directory and 2. change into it and
# call cmake to configure the build with default parameters as a static
# library. See
#
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
#
# for information about debug or release builds, for example
# library. See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
# for information about Debug, Release, etc. builds.
#
# cmake -B build -D CMAKE_BUILD_TYPE=Release
#
#
# For a dynamic library, use
#
# cmake -B build -D BUILD_SHARED_LIBS=true -D CMAKE_BUILD_TYPE=Release
@ -43,8 +39,7 @@
#
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR64 ..
#
#
# Finally, build the project with
# Finally, build the project with:
#
# cmake --build build
#
@ -61,66 +56,56 @@
#
# Some notes.
#
# - `cmake' creates configuration files in
# . `cmake' creates configuration files in
#
# <build-directory>/include/freetype/config
#
# which should be further modified if necessary.
#
# - You can use `cmake' directly on a freshly cloned FreeType git
# . You can use `cmake' directly on a freshly cloned FreeType git
# repository.
#
# - `CMakeLists.txt' is provided as-is since it is normally not used by the
# . `CMakeLists.txt' is provided as-is since it is normally not used by the
# developer team.
#
# - Set the `FT_REQUIRE_ZLIB', `FT_REQUIRE_BZIP2', `FT_REQUIRE_PNG',
# `FT_REQUIRE_HARFBUZZ', and `FT_REQUIRE_BROTLI' CMake variables to `ON'
# or `TRUE' to force using a dependency. Leave a variable undefined
# (which is the default) to use the dependency only if it is available.
# Example:
# . Set the `FT_WITH_ZLIB', `FT_WITH_BZIP2', `FT_WITH_PNG',
# `FT_WITH_HARFBUZZ', and `FT_WITH_BROTLI' CMake variables to `ON' to
# force using a dependency. Leave a variable undefined (which is the
# default) to use the dependency only if it is available. Example:
#
# cmake -B build -D FT_REQUIRE_ZLIB=TRUE \
# -D FT_REQUIRE_BZIP2=TRUE \
# -D FT_REQUIRE_PNG=TRUE \
# -D FT_REQUIRE_HARFBUZZ=TRUE \
# -D FT_REQUIRE_BROTLI=TRUE [...]
# cmake -B build -D FT_WITH_ZLIB=ON \
# -D FT_WITH_BZIP2=ON \
# -D FT_WITH_PNG=ON \
# -D FT_WITH_HARFBUZZ=ON \
# -D FT_WITH_BROTLI=ON [...]
#
# - Set `FT_DISABLE_XXX=TRUE' to disable a dependency completely (where
# `XXX' is a CMake package name like `BZip2'). Example for disabling all
# Set `CMAKE_DISABLE_FIND_PACKAGE_XXX=TRUE' to disable a dependency completely
# (where `XXX' is a CMake package name like `BZip2'). Example for disabling all
# dependencies:
#
# cmake -B build -D FT_DISABLE_ZLIB=TRUE \
# -D FT_DISABLE_BZIP2=TRUE \
# -D FT_DISABLE_PNG=TRUE \
# -D FT_DISABLE_HARFBUZZ=TRUE \
# -D FT_DISABLE_BROTLI=TRUE [...]
# cmake -B build -D CMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE \
# -D CMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE \
# -D CMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE \
# -D CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE \
# -D CMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE [...]
#
# - NOTE: If a package is set as DISABLED, it cannot be set as REQUIRED
# without unsetting the DISABLED value first. For example, if
# `FT_DISABLE_HARFBUZZ=TRUE' has been set (Cache is present), you need to
# call `FT_DISABLE_HARFBUZZ=FALSE' before calling
# `FT_REQUIRE_HARFBUZZ=TRUE'.
#
# - Installation of FreeType can be controlled with the CMake variables
# . Installation of FreeType can be controlled with the CMake variables
# `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
# (this is compatible with the same CMake variables in zlib's CMake
# support).
# To minimize the number of cmake_policy() workarounds,
# CMake >= 3 is requested.
cmake_minimum_required(VERSION 3.0)
# FreeType explicitly marks the API to be exported and relies on the compiler
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
# starting with 2.8.12.
cmake_minimum_required(VERSION 2.8.12)
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
# Allow symbol visibility settings also on static libraries. CMake < 3.3
# only sets the property on a shared library build.
cmake_policy(SET CMP0063 NEW)
# Support new IN_LIST if() operator.
cmake_policy(SET CMP0057 NEW)
endif ()
include(CheckIncludeFile)
include(CMakeDependentOption)
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
# configures the base build environment and references the toolchain file
@ -161,8 +146,8 @@ endif ()
project(freetype C)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "12")
set(VERSION_PATCH "1")
set(VERSION_MINOR "10")
set(VERSION_PATCH "2")
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'")
@ -183,37 +168,13 @@ string(REGEX REPLACE
math(EXPR LIBRARY_SOVERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
set(LIBRARY_VERSION "${LIBRARY_SOVERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}")
# External dependency library detection is automatic. See the notes at the
# top of this file, for how to force or disable dependencies completely.
option(FT_DISABLE_ZLIB
"Disable use of system zlib and use internal zlib library instead." OFF)
cmake_dependent_option(FT_REQUIRE_ZLIB
"Require system zlib instead of internal zlib library." OFF
"NOT FT_DISABLE_ZLIB" OFF)
option(FT_DISABLE_BZIP2
"Disable support of bzip2 compressed fonts." OFF)
cmake_dependent_option(FT_REQUIRE_BZIP2
"Require support of bzip2 compressed fonts." OFF
"NOT FT_DISABLE_BZIP2" OFF)
option(FT_DISABLE_PNG
"Disable support of PNG compressed OpenType embedded bitmaps." OFF)
cmake_dependent_option(FT_REQUIRE_PNG
"Require support of PNG compressed OpenType embedded bitmaps." OFF
"NOT FT_DISABLE_PNG" OFF)
option(FT_DISABLE_HARFBUZZ
"Disable HarfBuzz (used for improving auto-hinting of OpenType fonts)." OFF)
cmake_dependent_option(FT_REQUIRE_HARFBUZZ
"Require HarfBuzz for improving auto-hinting of OpenType fonts." OFF
"NOT FT_DISABLE_HARFBUZZ" OFF)
option(FT_DISABLE_BROTLI
"Disable support of compressed WOFF2 fonts." OFF)
cmake_dependent_option(FT_REQUIRE_BROTLI
"Require support of compressed WOFF2 fonts." OFF
"NOT FT_DISABLE_BROTLI" OFF)
# External dependency library detection is automatic. See the notes at the top
# of this file, for how to force or disable dependencies completely.
option(FT_WITH_ZLIB "Use system zlib instead of internal library." OFF)
option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF)
option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF)
option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF)
option(FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF)
# Disallow in-source builds
@ -238,58 +199,41 @@ if (BUILD_FRAMEWORK)
message(FATAL_ERROR
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
endif ()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
set(BUILD_SHARED_LIBS ON)
endif ()
# Find dependencies
include(FindPkgConfig)
if (NOT FT_DISABLE_HARFBUZZ)
set(HARFBUZZ_MIN_VERSION "2.0.0")
if (FT_REQUIRE_HARFBUZZ)
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION} REQUIRED)
else ()
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})
endif ()
set(HARFBUZZ_MIN_VERSION "1.8.0")
if (FT_WITH_HARFBUZZ)
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION} REQUIRED)
else ()
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})
endif ()
if (NOT FT_DISABLE_PNG)
if (FT_REQUIRE_PNG)
find_package(PNG REQUIRED)
else ()
find_package(PNG)
endif ()
if (FT_WITH_PNG)
find_package(PNG REQUIRED)
else ()
find_package(PNG)
endif ()
if (NOT FT_DISABLE_ZLIB)
if (FT_REQUIRE_ZLIB)
find_package(ZLIB REQUIRED)
else ()
find_package(ZLIB)
endif ()
if (FT_WITH_ZLIB)
find_package(ZLIB REQUIRED)
else ()
find_package(ZLIB)
endif ()
if (NOT FT_DISABLE_BZIP2)
# Genuine BZip2 does not provide bzip2.pc, but some platforms have it.
# For better dependency in freetype2.pc, bzip2.pc is searched
# regardless of the availability of libbz2. If bzip2.pc is found,
# Requires.private is used instead of Libs.private.
if (FT_REQUIRE_BZIP2)
find_package(BZip2 REQUIRED)
else ()
find_package(BZip2)
endif ()
pkg_check_modules(PC_BZIP2 bzip2)
if (FT_WITH_BZIP2)
find_package(BZip2 REQUIRED)
else ()
find_package(BZip2)
endif ()
if (NOT FT_DISABLE_BROTLI)
if (FT_REQUIRE_BROTLI)
find_package(BrotliDec REQUIRED)
else ()
find_package(BrotliDec)
endif ()
if (FT_WITH_BROTLI)
find_package(BrotliDec REQUIRED)
else ()
find_package(BrotliDec)
endif ()
# Create the configuration file
@ -403,10 +347,8 @@ set(BASE_SRCS
src/pshinter/pshinter.c
src/psnames/psnames.c
src/raster/raster.c
src/sdf/sdf.c
src/sfnt/sfnt.c
src/smooth/smooth.c
src/svg/svg.c
src/truetype/truetype.c
src/type1/type1.c
src/type42/type42.c
@ -415,8 +357,6 @@ set(BASE_SRCS
if (UNIX)
list(APPEND BASE_SRCS "builds/unix/ftsystem.c")
elseif (WIN32)
list(APPEND BASE_SRCS "builds/windows/ftsystem.c")
else ()
list(APPEND BASE_SRCS "src/base/ftsystem.c")
endif ()
@ -480,7 +420,7 @@ target_include_directories(
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include
# Make <ftconfig.h> available for builds/unix/ftsystem.c.
${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config
)
@ -492,55 +432,41 @@ if (BUILD_FRAMEWORK)
)
set_target_properties(freetype PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/builds/mac/freetype-Info.plist
MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
PUBLIC_HEADER "${PUBLIC_HEADERS}"
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
)
endif ()
# 'freetype-interface' is an interface library, to be accessed with
# `EXPORT_NAME Freetype::Freetype`. This is the target name provided by
# CMake's `FindFreetype.cmake`, so we provide it for compatibility.
add_library(freetype-interface INTERFACE)
set_target_properties(freetype-interface PROPERTIES
EXPORT_NAME Freetype::Freetype
INTERFACE_LINK_LIBRARIES freetype)
set(PKGCONFIG_REQUIRES "")
set(PKGCONFIG_REQUIRES_PRIVATE "")
set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
set(PKGCONFIG_LIBS_PRIVATE "")
set(PKG_CONFIG_REQUIRED_PRIVATE "")
if (ZLIB_FOUND)
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "zlib")
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib")
endif ()
if (BZIP2_FOUND)
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
if (PC_BZIP2_FOUND)
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "bzip2")
else ()
list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
endif ()
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "bzip2")
endif ()
if (PNG_FOUND)
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng")
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libpng")
endif ()
if (HarfBuzz_FOUND)
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
if (HARFBUZZ_FOUND)
target_link_libraries(freetype PRIVATE ${HARFBUZZ_LIBRARIES})
target_include_directories(freetype PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
endif ()
if (BROTLIDEC_FOUND)
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec")
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libbrotlidec")
endif ()
@ -565,64 +491,44 @@ endif ()
if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# Generate the pkg-config file
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
if (UNIX)
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
string(REPLACE ";" ", " PKGCONFIG_REQUIRES_PRIVATE "${PKGCONFIG_REQUIRES_PRIVATE}")
string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%exec_prefix%" "\${prefix}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%exec_prefix%" "\${prefix}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
if (BUILD_SHARED_LIBS)
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
else ()
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES} ${PKGCONFIG_REQUIRES_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" ""
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS} ${PKGCONFIG_LIBS_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" ""
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
endif ()
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
else ()
set(ORIGINAL_FREETYPE2_PC_IN "")
endif ()
if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
endif ()
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
else ()
set(ORIGINAL_FREETYPE2_PC_IN "")
endif ()
if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
install(
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT pkgconfig)
endif ()
install(
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT pkgconfig)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${PROJECT_BINARY_DIR}/freetype-config-version.cmake
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
COMPATIBILITY SameMajorVersion)
install(
TARGETS freetype freetype-interface
TARGETS freetype
EXPORT freetype-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@ -634,10 +540,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
FILE freetype-config.cmake
COMPONENT headers)
install(
FILES ${PROJECT_BINARY_DIR}/freetype-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
COMPONENT headers)
endif ()
@ -645,7 +547,7 @@ endif ()
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.TXT")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/LICENSE.TXT")
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})

File diff suppressed because it is too large Load Diff

View File

@ -2597,7 +2597,7 @@
----------------------------------------------------------------------------
Copyright (C) 2000-2022 by
Copyright (C) 2000-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -9422,7 +9422,7 @@
----------------------------------------------------------------------------
Copyright (C) 2002-2022 by
Copyright (C) 2002-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -2821,7 +2821,7 @@
----------------------------------------------------------------------------
Copyright (C) 2005-2022 by
Copyright (C) 2005-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -7932,7 +7932,7 @@
----------------------------------------------------------------------------
Copyright (C) 2006-2022 by
Copyright (C) 2006-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -707,7 +707,7 @@
[base] Fix integer overflow.
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
outgoing vectors and use fixed-point arithmetic.
outgoing vectors and use fixed point arithmetic.
2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
@ -6344,7 +6344,7 @@
----------------------------------------------------------------------------
Copyright (C) 2010-2022 by
Copyright (C) 2010-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -5145,7 +5145,7 @@
----------------------------------------------------------------------------
Copyright (C) 2013-2022 by
Copyright (C) 2013-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -5695,7 +5695,7 @@
----------------------------------------------------------------------------
Copyright (C) 2015-2022 by
Copyright (C) 2015-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -2090,7 +2090,7 @@
----------------------------------------------------------------------------
Copyright (C) 2016-2022 by
Copyright (C) 2016-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -3120,7 +3120,7 @@
----------------------------------------------------------------------------
Copyright (C) 2016-2022 by
Copyright (C) 2016-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -2336,7 +2336,7 @@
----------------------------------------------------------------------------
Copyright (C) 2017-2022 by
Copyright (C) 2017-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -1,42 +0,0 @@
FREETYPE LICENSES
-----------------
The FreeType 2 font engine is copyrighted work and cannot be used
legally without a software license. In order to make this project
usable to a vast majority of developers, we distribute it under two
mutually exclusive open-source licenses.
This means that *you* must choose *one* of the two licenses described
below, then obey all its terms and conditions when using FreeType 2 in
any of your projects or products.
- The FreeType License, found in the file `docs/FTL.TXT`, which is
similar to the original BSD license *with* an advertising clause
that forces you to explicitly cite the FreeType project in your
product's documentation. All details are in the license file.
This license is suited to products which don't use the GNU General
Public License.
Note that this license is compatible to the GNU General Public
License version 3, but not version 2.
- The GNU General Public License version 2, found in
`docs/GPLv2.TXT` (any later version can be used also), for
programs which already use the GPL. Note that the FTL is
incompatible with GPLv2 due to its advertisement clause.
The contributed BDF and PCF drivers come with a license similar to
that of the X Window System. It is compatible to the above two
licenses (see files `src/bdf/README` and `src/pcf/README`). The same
holds for the source code files `src/base/fthash.c` and
`include/freetype/internal/fthash.h`; they wer part of the BDF driver
in earlier FreeType versions.
The gzip module uses the zlib license (see `src/gzip/zlib.h`) which
too is compatible to the above two licenses.
The MD5 checksum support (only used for debugging in development
builds) is in the public domain.
--- end of LICENSE.TXT ---

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

116
README
View File

@ -1,100 +1,92 @@
FreeType 2.12.1
===============
FreeType 2.10.2
===============
Homepage: https://www.freetype.org
Homepage: https://www.freetype.org
FreeType is a freely available software library to render fonts.
FreeType is a freely available software library to render fonts.
It is written in C, designed to be small, efficient, highly
customizable, and portable while capable of producing high-quality
output (glyph images) of most vector and bitmap font formats.
It is written in C, designed to be small, efficient, highly
customizable, and portable while capable of producing high-quality
output (glyph images) of most vector and bitmap font formats.
Please read the `docs/CHANGES` file, it contains IMPORTANT
INFORMATION.
Please read the docs/CHANGES file, it contains IMPORTANT
INFORMATION.
Read the files `docs/INSTALL*` for installation instructions; see the
file `docs/LICENSE.TXT` for the available licenses.
Read the files `docs/INSTALL*' for installation instructions; see
the file `docs/LICENSE.TXT' for the available licenses.
For using FreeType's git repository instead of a distribution bundle,
please read file `README.git`. Note that you have to actually clone
the repository; using a snapshot will not work (in other words, don't
use gitlab's 'Download' button).
The FreeType 2 API reference is located in `docs/reference/site';
use the file `index.html' as the top entry point. [Please note that
currently the search function for locally installed documentation
doesn't work due to cross-site scripting issues.]
The FreeType 2 API reference is located in directory `docs/reference`;
use the file `index.html` as the top entry point. [Please note that
currently the search function for locally installed documentation
doesn't work due to cross-site scripting issues.]
Additional documentation is available as a separate package from our
sites. Go to
Additional documentation is available as a separate package from our
sites. Go to
https://download.savannah.gnu.org/releases/freetype/
https://download.savannah.gnu.org/releases/freetype/
and download one of the following files.
and download one of the following files.
freetype-doc-2.10.2.tar.xz
freetype-doc-2.10.2.tar.gz
ftdoc2102.zip
freetype-doc-2.12.1.tar.xz
freetype-doc-2.12.1.tar.gz
ftdoc2121.zip
To view the documentation online, go to
To view the documentation online, go to
https://www.freetype.org/freetype2/docs/
https://www.freetype.org/freetype2/docs/
Mailing Lists
-------------
Mailing Lists
=============
The preferred way of communication with the FreeType team is using
e-mail lists.
The preferred way of communication with the FreeType team is using
e-mail lists.
general use and discussion: freetype@nongnu.org
engine internals, porting, etc.: freetype-devel@nongnu.org
announcements: freetype-announce@nongnu.org
git repository tracker: freetype-commit@nongnu.org
general use and discussion: freetype@nongnu.org
engine internals, porting, etc.: freetype-devel@nongnu.org
announcements: freetype-announce@nongnu.org
git repository tracker: freetype-commit@nongnu.org
The lists are moderated; see
The lists are moderated; see
https://www.freetype.org/contact.html
https://www.freetype.org/contact.html
how to subscribe.
how to subscribe.
Bugs
----
Bugs
====
Please submit bug reports at
Please submit bug reports at
https://gitlab.freedesktop.org/freetype/freetype/-/issues
https://savannah.nongnu.org/bugs/?group=freetype
Alternatively, you might report bugs by e-mail to
`freetype-devel@nongnu.org`. Don't forget to send a detailed
explanation of the problem -- there is nothing worse than receiving a
terse message that only says 'it doesn't work'.
Alternatively, you might report bugs by e-mail to
`freetype-devel@nongnu.org'. Don't forget to send a detailed
explanation of the problem -- there is nothing worse than receiving
a terse message that only says `it doesn't work'.
Patches
-------
Patches
=======
For larger changes please provide merge requests at
Please submit patches to the `freetype-devel@nongnu.org' mailing
list -- and thank you in advance for your work on improving
FreeType!
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests
Details on the process can be found here:
Alternatively, you can send patches to the `freetype-devel@nongnu.org`
mailing list -- and thank you in advance for your work on improving
FreeType!
Details on the process can be found here:
https://www.freetype.org/developer.html#patches
https://www.freetype.org/developer.html#patches
Enjoy!
Enjoy!
The FreeType Team
The FreeType Team
----------------------------------------------------------------------
Copyright (C) 2006-2022 by
Copyright (C) 2006-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -1,36 +1,4 @@
README.git
==========
repository issues
-----------------
FreeType's official repository site is
https://gitlab.freedesktop.org/freetype ,
from which the 'freetype.git' and 'freetype-demos.git' repositories
can be cloned in the usual way.
git clone https://gitlab.freedesktop.org/freetype/freetype.git
git clone https://gitlab.freedesktop.org/freetype/freetype-demos.git
If you want to use the Savannah mirror instead, you have to do a
slightly different incantation because the repository names contain
digit '2' for historical reasons.
git clone \
https://git.savannah.nongnu.org/git/freetype/freetype2.git \
freetype
git clone \
https://git.savannah.nongnu.org/git/freetype/freetype2-demos.git \
freetype-demos
standard builds with `configure`
--------------------------------
The git repository doesn't contain pre-built configuration scripts for
The git archive doesn't contain pre-built configuration scripts for
UNIXish platforms. To generate them say
sh autogen.sh
@ -42,54 +10,34 @@ which in turn depends on the following packages:
autoconf (2.62)
The versions given in parentheses are known to work. Newer versions
should work too, of course. Note that `autogen.sh` also sets up
proper file permissions for the `configure` and auxiliary scripts.
should work too, of course. Note that autogen.sh also sets up proper
file permissions for the `configure' and auxiliary scripts.
The `autogen.sh` script checks whether the versions of the above three
tools match the numbers above. Otherwise it will complain and suggest
either upgrading or using environment variables to point to more
recent versions of the required tools.
The autogen.sh script now checks the version of above three packages
whether they match the numbers above. Otherwise it will complain and
suggest either upgrading or using an environment variable to point to
a more recent version of the required tool(s).
Note that `aclocal` is provided by the 'automake' package on Linux,
and that `libtoolize` is called `glibtoolize` on Darwin (OS X).
Note that `aclocal' is provided by the `automake' package on Linux,
and that `libtoolize' is called `glibtoolize' on Darwin (OS X).
alternative build methods
-------------------------
For static builds that don't use platform-specific optimizations, no
For static builds which don't use platform specific optimizations, no
configure script is necessary at all; saying
make setup ansi
make
should work on all platforms that have GNU `make` (or `makepp`).
A build with `cmake` or `meson` can be done directly from the git
repository. However, if you want to use the `FT_DEBUG_LOGGING` macro
(see file `docs/DEBUG` for more information) it is currently mandatory
to execute `autogen.sh` in advance; this script clones the 'dlg' git
submodule and copies some files into FreeType's source tree.
should work on all platforms which have GNU make (or makepp).
Code of Conduct
---------------
Similarly, a build with `cmake' can be done directly from the git
repository.
Please note that this project is released with a Contributor Code of
Conduct (CoC). By participating in this project you agree to abide by
its terms, which you can find in the following link:
https://www.freedesktop.org/wiki/CodeOfConduct
CoC issues may be raised to the project maintainers at the following
address:
wl@gnu.org
apodtele@gmail.com
----------------------------------------------------------------------
Copyright (C) 2005-2022 by
Copyright (C) 2005-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (C) 2005-2022 by
# Copyright (C) 2005-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -110,10 +110,7 @@ check_tool_version ()
fi
}
# Solaris 10's shell doesn't like the `!` operator to negate the exit status.
if test -f ./builds/unix/configure.raw; then
:
else
if test ! -f ./builds/unix/configure.raw; then
echo "You must be in the same directory as \`autogen.sh'."
echo "Bootstrapping doesn't work if srcdir != builddir."
exit 1
@ -141,25 +138,18 @@ check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
# This sets FREETYPE version.
eval `sed -n \
-e 's/^#define *\(FREETYPE_MAJOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
-e 's/^#define *\(FREETYPE_MINOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
-e 's/^#define *\(FREETYPE_PATCH\) *\([0-9][0-9]*\).*/\1=\2/p' \
include/freetype/freetype.h`
# This sets freetype_major, freetype_minor, and freetype_patch.
eval `sed -nf version.sed include/freetype/freetype.h`
if test "$FREETYPE_PATCH" = "0"; then
FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR
else
FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH
# We set freetype-patch to an empty value if it is zero.
if test "$freetype_patch" = ".0"; then
freetype_patch=
fi
echo "FreeType $FREETYPE:"
cd builds/unix
echo "generating \`configure.ac'"
sed -e "s;@VERSION@;$FREETYPE;" \
sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
< configure.raw > configure.ac
run aclocal -I . --force
@ -172,29 +162,4 @@ cd ../..
chmod +x ./configure
# Copy all necessary 'dlg' files.
copy_submodule_files ()
{
echo "Copying files from \`subprojects/dlg' to \`src/dlg' and \`include/dlg'"
mkdir include/dlg 2> /dev/null
cp $DLG_INC_DIR/output.h include/dlg
cp $DLG_INC_DIR/dlg.h include/dlg
cp $DLG_SRC_DIR/* src/dlg
}
if test -e ".git"; then
DLG_INC_DIR=subprojects/dlg/include/dlg
DLG_SRC_DIR=subprojects/dlg/src/dlg
if test -d "$DLG_INC_DIR"; then
:
else
echo "Checking out submodule in \`subprojects/dlg':"
git submodule init
git submodule update
fi
copy_submodule_files
fi
# EOF

232
azure-pipelines.yml Normal file
View File

@ -0,0 +1,232 @@
# This file is responsible for seting up several compiler enviorments.
# Once setup is done, the template "CI/build-cmake.yml" is invoked to test freetype
# compiles successfully on various operating systems and compilers liststed
# below. Artifacts of all builds are also published to azure.
# TODO: Add functionality tests
trigger:
- master
variables:
vcpkgGitRef: a41c53c14794bb32cb03269069cdd3b66fedda5f # Update this git ref to update vcpkg
vckpgPackages: zlib bzip2 libpng harfbuzz
jobs:
## Linux ##
- job: ArchLinux_Regression
displayName: "Archlinux Regression tests"
pool:
vmImage: ubuntu-latest
strategy:
matrix:
Test1:
TEST: 0
Test2:
TEST: 1
Test3:
TEST: 2
timeoutInMinutes: 360
steps:
- checkout: self
path: freetype2
- template: CI/arch-setup.yml
- template: CI/regression-test.yml
parameters:
preCMD: 'cd $(Build.BinariesDirectory) && cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/'
srcDIR: freetype2
postCMD: 'EOF'
testNum: $(TEST)
- job: ArchLinux_Autotools
displayName: "Archlinux Autotools"
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
path: freetype2
- template: CI/arch-setup.yml
- template: CI/build-autotools.yml
- job: ArchLinux_Cmake
displayName: "Archlinux CMake"
pool:
vmImage: ubuntu-latest
strategy:
matrix:
shared:
BUILD_SHARED_LIBS: true
BUILD_ARGS: '-G "Unix Makefiles" -D BUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS)'
static:
BUILD_SHARED_LIBS: false
steps:
- checkout: self
path: freetype2
- template: CI/arch-setup.yml
- template: CI/build-cmake.yml
parameters:
preCMD: 'cd $(Build.BinariesDirectory) && cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/'
srcDIR: freetype2
postCMD: 'EOF'
buildArgs: $(BUILD_ARGS)
## Windows ##
- job: MSVC_2019_CMake
displayName: "MVSC 2019 CMake"
pool:
vmImage: windows-latest
strategy:
matrix:
i686_shared:
TRIPLET: x86-windows
BUILD_SHARED_LIBS: true
ARCH: Win32
x86_64_shared:
TRIPLET: x64-windows
BUILD_SHARED_LIBS: true
ARCH: x64
i686_static:
TRIPLET: x86-windows-static
BUILD_SHARED_LIBS: false
ARCH: Win32
x86_64_static:
TRIPLET: x64-windows-static
BUILD_SHARED_LIBS: false
ARCH: x64
steps:
- task: Cache@2
displayName: 'Cache VCPKG Artifacts'
inputs:
key: '"$(TRIPLET)" | "$(vckpgPackages)" | "$(vcpkgGitRef)" | "$(Agent.OS)"'
path: '$(Build.BinariesDirectory)/vcpkg'
- task: run-vcpkg@0
displayName: 'Run VCPKG'
inputs:
vcpkgArguments: --triplet $(TRIPLET) $(vckpgPackages)
vcpkgGitCommitId: $(vcpkgGitRef)
vcpkgGitURL: https://github.com/microsoft/vcpkg.git
- template: CI/build-cmake.yml
parameters:
buildArgs: '-G "Visual Studio 16 2019" -A $(ARCH) -D CMAKE_TOOLCHAIN_FILE=$(Build.BinariesDirectory)\vcpkg\scripts\buildsystems\vcpkg.cmake -D VCPKG_ROOT=$(Build.BinariesDirectory)\vcpkg -D VCPKG_TARGET_TRIPLET=$(TRIPLET) -D BUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS)'
- job: MINGW_Autotools
displayName: "Mingw Autotools"
pool:
vmImage: windows-latest
strategy:
matrix:
i686:
MINGW_UPPER: MINGW32
MINGW_LOWER: mingw32
MINGW_ARCH: i686
x86_64:
MINGW_UPPER: MINGW64
MINGW_LOWER: mingw64
MINGW_ARCH: x86_64
steps:
- template: CI/mingw-setup.yml
- template: CI/build-autotools.yml
parameters:
mingw: true
- job: MINGW_CMake
displayName: "MingGW CMake"
pool:
vmImage: windows-latest
strategy:
matrix:
i686_shared:
MINGW_UPPER: MINGW32
MINGW_LOWER: mingw32
MINGW_ARCH: i686
BUILD_SHARED_LIBS: true
x86_64_shared:
MINGW_UPPER: MINGW64
MINGW_LOWER: mingw64
MINGW_ARCH: x86_64
BUILD_SHARED_LIBS: true
i686_static:
MINGW_UPPER: MINGW32
MINGW_LOWER: mingw32
MINGW_ARCH: i686
BUILD_SHARED_LIBS: false
x86_64_static:
MINGW_UPPER: MINGW64
MINGW_LOWER: mingw64
MINGW_ARCH: x86_64
BUILD_SHARED_LIBS: false
steps:
- template: CI/mingw-setup.yml
- template: CI/build-cmake.yml
parameters:
mingw: true
buildArgs: '-G \"MSYS Makefiles\" -D BUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS)'
## MacOS X ##
- job: MacOS_X_Autotools
displayName: "MacOS X Autotools"
pool:
vmImage: macos-latest
steps:
- script: |
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh
bash ./install.sh
brew install autoconf automake
displayName: 'Install Brew'
- template: CI/build-autotools.yml
- job: MacOS_X_CMake
displayName: "MacOS X CMake"
pool:
vmImage: macos-latest
steps:
- template: CI/build-cmake.yml
parameters:
buildArgs: '-G Xcode -D BUILD_FRAMEWORK:BOOL=true'
### iOS ##
- job: iOS_CMake
displayName: "iOS CMake"
pool:
vmImage: macos-latest
strategy:
matrix:
OS:
IOS_PLATFORM: OS
Simulator:
IOS_PLATFORM: SIMULATOR64
TV_OS:
IOS_PLATFORM: TVOS
TV_OS_Simulator:
IOS_PLATFORM: SIMULATOR_TVOS
Watch_OS:
IOS_PLATFORM: WATCHOS
Watch_OS_Simulator:
IOS_PLATFORM: SIMULATOR_WATCHOS
steps:
- template: CI/build-cmake.yml
parameters:
buildArgs: '-G Xcode -D PLATFORM=$(IOS_PLATFORM)'

View File

@ -1,7 +1,7 @@
README for the builds/amiga subdirectory.
Copyright (C) 2005-2022 by
Copyright (C) 2005-2020 by
Werner Lemberg and Detlef Würkner.
This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
/* */
/* Amiga-specific configuration file (specification only). */
/* */
/* Copyright (C) 2005-2022 by */
/* Copyright (C) 2005-2020 by */
/* Werner Lemberg and Detlef Würkner. */
/* */
/* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */
/* Amiga-specific FreeType module selection. */
/* */
/* Copyright (C) 2005-2022 by */
/* Copyright (C) 2005-2020 by */
/* Werner Lemberg and Detlef Würkner. */
/* */
/* This file is part of the FreeType project, and may only be used, */

View File

@ -5,7 +5,7 @@
#
# Copyright (C) 2005-2022 by
# Copyright (C) 2005-2020 by
# Werner Lemberg and Detlef Würkner.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
#
# Copyright (C) 2005-2022 by
# Copyright (C) 2005-2020 by
# Werner Lemberg and Detlef Würkner.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 2005-2022 by
# Copyright (C) 2005-2020 by
# Werner Lemberg and Detlef Würkner.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
*
* Debugging and logging component for amiga (body).
*
* Copyright (C) 1996-2022 by
* Copyright (C) 1996-2020 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */
/* Amiga-specific FreeType low-level system interface (body). */
/* */
/* Copyright (C) 1996-2022 by */
/* Copyright (C) 1996-2020 by */
/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -264,7 +264,7 @@ Free_VecPooled( APTR poolHeader,
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = NULL;
stream->base = 0;
}

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -13,11 +13,11 @@
# fully.
DELETE := rm -f
CAT := cat
SEP := /
PLATFORM_DIR := $(TOP_DIR)/builds/ansi
PLATFORM := ansi
DELETE := rm -f
CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/ansi
PLATFORM := ansi
# This is used for `make refdoc' and `make refdoc-venv'
#
@ -64,14 +64,14 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?=
ANSIFLAGS :=
# EOF

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -15,7 +15,7 @@ To compile FreeType 2 as a library the following changes must be applied:
INCLUDE;E:\freetype2\include
- The file `freetype/include/Ft2build.h' must be patched as follows to
- The file `freetype2/include/Ft2build.h' must be patched as follows to
include ATARI.H:
#ifndef FT2_BUILD_GENERIC_H_
@ -40,7 +40,7 @@ ge
INCLUDE;E:\freetype2\include
- In der Datei freetype/include/Ft2build.h muss zu Beginn
- In der Datei freetype2/include/Ft2build.h muss zu Beginn
ein #include "ATARI.H" wie folgt eingef<65>gt werden:
#ifndef FT2_BUILD_GENERIC_H_

View File

@ -5,7 +5,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -15,11 +15,11 @@
# fully.
DELETE := rm -f
CAT := cat
SEP := /
PLATFORM_DIR := $(TOP_DIR)/builds/beos
PLATFORM := beos
DELETE := rm -f
CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/beos
PLATFORM := beos
# This is used for `make refdoc' and `make refdoc-venv'
#
@ -66,14 +66,14 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?=
ANSIFLAGS :=
# EOF

View File

@ -2,7 +2,7 @@
# FreeType 2 configuration rules for a BeOS system
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -27,11 +27,11 @@ endif
ifeq ($(PLATFORM),beos)
DELETE := rm -f
CAT := cat
SEP := /
PLATFORM_DIR := $(TOP_DIR)/builds/beos
CONFIG_FILE := beos.mk
DELETE := rm -f
CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/beos
CONFIG_FILE := beos.mk
setup: std_setup

View File

@ -1,6 +1,6 @@
# FindBrotliDec.cmake
#
# Copyright (C) 2019-2022 by
# Copyright (C) 2019-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written by Werner Lemberg <wl@gnu.org>
@ -19,8 +19,7 @@
# BROTLIDEC_INCLUDE_DIRS
# BROTLIDEC_LIBRARIES
find_package(PkgConfig QUIET)
include(FindPkgConfig)
pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)
if (PC_BROTLIDEC_VERSION)
@ -42,7 +41,7 @@ find_library(BROTLIDEC_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
BrotliDec
brotlidec
REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
FOUND_VAR BROTLIDEC_FOUND
VERSION_VAR BROTLIDEC_VERSION)

View File

@ -1,5 +1,4 @@
# Copyright (c) 2012, Intel Corporation
# Copyright (c) 2019 Sony Interactive Entertainment Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ -24,180 +23,65 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Try to find Harfbuzz include and library directories.
# Try to find HarfBuzz include and library directories.
#
# After successful discovery, this will set for inclusion where needed:
# HarfBuzz_INCLUDE_DIRS - containg the HarfBuzz headers
# HarfBuzz_LIBRARIES - containg the HarfBuzz library
#
# HARFBUZZ_INCLUDE_DIRS - containg the HarfBuzz headers
# HARFBUZZ_LIBRARIES - containg the HarfBuzz library
#[=======================================================================[.rst:
FindHarfBuzz
--------------
Find HarfBuzz headers and libraries.
Imported Targets
^^^^^^^^^^^^^^^^
``HarfBuzz::HarfBuzz``
The HarfBuzz library, if found.
``HarfBuzz::ICU``
The HarfBuzz ICU library, if found.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables in your project:
``HarfBuzz_FOUND``
true if (the requested version of) HarfBuzz is available.
``HarfBuzz_VERSION``
the version of HarfBuzz.
``HarfBuzz_LIBRARIES``
the libraries to link against to use HarfBuzz.
``HarfBuzz_INCLUDE_DIRS``
where to find the HarfBuzz headers.
``HarfBuzz_COMPILE_OPTIONS``
this should be passed to target_compile_options(), if the
target is not used for linking
#]=======================================================================]
find_package(PkgConfig QUIET)
include(FindPkgConfig)
pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz)
set(HarfBuzz_COMPILE_OPTIONS ${PC_HARFBUZZ_CFLAGS_OTHER})
set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION})
find_path(HarfBuzz_INCLUDE_DIR
NAMES hb.h
HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS}
PATH_SUFFIXES harfbuzz
)
find_path(HARFBUZZ_INCLUDE_DIRS
NAMES hb.h
HINTS ${PC_HARFBUZZ_INCLUDEDIR}
${PC_HARFBUZZ_INCLUDE_DIRS}
PATH_SUFFIXES harfbuzz)
find_library(HarfBuzz_LIBRARY
NAMES ${HarfBuzz_NAMES} harfbuzz
HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS}
)
find_library(HARFBUZZ_LIBRARIES
NAMES harfbuzz
HINTS ${PC_HARFBUZZ_LIBDIR}
${PC_HARFBUZZ_LIBRARY_DIRS})
if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION)
if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h")
file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content)
if (HARFBUZZ_INCLUDE_DIRS)
if (EXISTS "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h")
file(READ "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h" _harfbuzz_version_content)
string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}")
set(HarfBuzz_VERSION "${CMAKE_MATCH_1}")
endif ()
endif ()
if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}")
if (HarfBuzz_FIND_REQUIRED)
message(FATAL_ERROR
"Required version (" ${HarfBuzz_FIND_VERSION} ")"
" is higher than found version (" ${HarfBuzz_VERSION} ")")
else ()
message(WARNING
"Required version (" ${HarfBuzz_FIND_VERSION} ")"
" is higher than found version (" ${HarfBuzz_VERSION} ")")
unset(HarfBuzz_VERSION)
unset(HarfBuzz_INCLUDE_DIRS)
unset(HarfBuzz_LIBRARIES)
return ()
string(REGEX MATCH
"#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\""
_dummy "${_harfbuzz_version_content}")
set(HARFBUZZ_VERSION "${CMAKE_MATCH_1}")
endif ()
endif ()
# Find components
if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY)
set(_HarfBuzz_REQUIRED_LIBS_FOUND ON)
set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}")
else ()
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)")
endif ()
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS)
pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu)
set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER})
find_path(HarfBuzz_ICU_INCLUDE_DIR
NAMES hb-icu.h
HINTS ${PC_HARFBUZZ_ICU_INCLUDEDIR} ${PC_HARFBUZZ_ICU_INCLUDE_DIRS}
PATH_SUFFIXES harfbuzz
)
find_library(HarfBuzz_ICU_LIBRARY
NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu
HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS}
)
if (HarfBuzz_ICU_LIBRARY)
if (HarfBuzz_FIND_REQUIRED_ICU)
list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}")
else ()
list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}")
endif ()
else ()
if (HarfBuzz_FIND_REQUIRED_ICU)
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)")
else ()
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)")
endif ()
endif ()
endif ()
endif ()
if (NOT HarfBuzz_FIND_QUIETLY)
if (HarfBuzz_LIBS_FOUND)
message(STATUS "Found the following HarfBuzz libraries:")
foreach (found ${HarfBuzz_LIBS_FOUND})
message(STATUS " ${found}")
endforeach ()
endif ()
if (HarfBuzz_LIBS_NOT_FOUND)
message(STATUS "The following HarfBuzz libraries were not found:")
foreach (found ${HarfBuzz_LIBS_NOT_FOUND})
message(STATUS " ${found}")
endforeach ()
endif ()
if ("${harfbuzz_FIND_VERSION}" VERSION_GREATER "${HARFBUZZ_VERSION}")
message(FATAL_ERROR
"Required version (" ${harfbuzz_FIND_VERSION} ")"
" is higher than found version (" ${HARFBUZZ_VERSION} ")")
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HarfBuzz
FOUND_VAR HarfBuzz_FOUND
REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND
VERSION_VAR HarfBuzz_VERSION
)
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz)
add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL)
set_target_properties(HarfBuzz::HarfBuzz PROPERTIES
IMPORTED_LOCATION "${HarfBuzz_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}"
)
endif ()
if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU)
add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL)
set_target_properties(HarfBuzz::ICU PROPERTIES
IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_ICU_INCLUDE_DIR}"
)
endif ()
endif ()
find_package_handle_standard_args(
harfbuzz
REQUIRED_VARS HARFBUZZ_INCLUDE_DIRS HARFBUZZ_LIBRARIES
VERSION_VAR HARFBUZZ_VERSION)
mark_as_advanced(
HarfBuzz_INCLUDE_DIR
HarfBuzz_ICU_INCLUDE_DIR
HarfBuzz_LIBRARY
HarfBuzz_ICU_LIBRARY
)
HARFBUZZ_INCLUDE_DIRS
HARFBUZZ_LIBRARIES)
if (HarfBuzz_FOUND)
set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY})
set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR} ${HarfBuzz_ICU_INCLUDE_DIR})
# Allow easy linking as in
#
# target_link_libraries(freetype PRIVATE Harfbuzz::Harfbuzz)
#
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
if (HARFBUZZ_FOUND AND NOT TARGET Harfbuzz::Harfbuzz)
add_library(Harfbuzz::Harfbuzz INTERFACE IMPORTED)
set_target_properties(
Harfbuzz::Harfbuzz PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIRS}")
endif ()
endif ()

View File

@ -1,270 +1,726 @@
# iOS.cmake
# This file is part of the ios-cmake project. It was retrieved from
# https://github.com/cristeab/ios-cmake.git, which is a fork of
# https://code.google.com/p/ios-cmake/. Which in turn is based off of
# the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which
# are included with CMake 2.8.4
#
# Copyright (C) 2014-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
# The ios-cmake project is licensed under the new BSD license.
#
# Written by David Wimsey <david@wimsey.us>
# Copyright (c) 2014, Bogdan Cristea and LTE Engineering Software,
# Kitware, Inc., Insight Software Consortium. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 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.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# This file is based off of the Platform/Darwin.cmake and
# Platform/UnixPaths.cmake files which are included with CMake 2.8.4
# It has been altered for iOS development.
#
# Updated by Alex Stewart (alexs.mac@gmail.com)
#
# *****************************************************************************
# Now maintained by Alexander Widerberg (widerbergaren [at] gmail.com)
# under the BSD-3-Clause license
# https://github.com/leetal/ios-cmake
# *****************************************************************************
#
# INFORMATION / HELP
#
# The following arguments control the behaviour of this toolchain:
#
# PLATFORM: (default "OS")
# OS = Build for iPhoneOS.
# OS64 = Build for arm64 iphoneOS.
# OS64COMBINED = Build for arm64 x86_64 iphoneOS. Combined into FAT STATIC lib (supported on 3.14+ of CMakewith "-G Xcode" argument ONLY)
# SIMULATOR = Build for x86 i386 iphoneOS Simulator.
# SIMULATOR64 = Build for x86_64 iphoneOS Simulator.
# TVOS = Build for arm64 tvOS.
# TVOSCOMBINED = Build for arm64 x86_64 tvOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
# SIMULATOR_TVOS = Build for x86_64 tvOS Simulator.
# WATCHOS = Build for armv7k arm64_32 for watchOS.
# WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
# SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator.
#
# CMAKE_OSX_SYSROOT: Path to the SDK to use. By default this is
# automatically determined from PLATFORM and xcodebuild, but
# can also be manually specified (although this should not be required).
#
# CMAKE_DEVELOPER_ROOT: Path to the Developer directory for the platform
# being compiled for. By default this is automatically determined from
# CMAKE_OSX_SYSROOT, but can also be manually specified (although this should
# not be required).
#
# DEPLOYMENT_TARGET: Minimum SDK version to target. Default 2.0 on watchOS and 9.0 on tvOS+iOS
#
# ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 1 (true)
#
# ENABLE_ARC: (1|0) Enables or disables ARC support. Default 1 (true, ARC enabled by default)
#
# ENABLE_VISIBILITY: (1|0) Enables or disables symbol visibility support. Default 0 (false, visibility hidden by default)
#
# ENABLE_STRICT_TRY_COMPILE: (1|0) Enables or disables strict try_compile() on all Check* directives (will run linker
# to actually check if linking is possible). Default 0 (false, will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY)
#
# ARCHS: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM
# OS = armv7 armv7s arm64 (if applicable)
# OS64 = arm64 (if applicable)
# SIMULATOR = i386
# SIMULATOR64 = x86_64
# TVOS = arm64
# SIMULATOR_TVOS = x86_64 (i386 has since long been deprecated)
# WATCHOS = armv7k arm64_32 (if applicable)
# SIMULATOR_WATCHOS = x86_64 (i386 has since long been deprecated)
#
# This toolchain defines the following variables for use externally:
#
# XCODE_VERSION: Version number (not including Build version) of Xcode detected.
# SDK_VERSION: Version of SDK being used.
# CMAKE_OSX_ARCHITECTURES: Architectures being compiled for (generated from PLATFORM).
# APPLE_TARGET_TRIPLE: Used by autoconf build systems. NOTE: If "ARCHS" are overridden, this will *NOT* be set!
#
# This toolchain defines the following macros for use externally:
#
# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT)
# A convenience macro for setting xcode specific properties on targets.
# Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel
# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all").
#
# find_host_package (PROGRAM ARGS)
# A macro used to find executable programs on the host system, not within the
# environment. Thanks to the android-cmake project for providing the
# command.
#
# ******************************** DEPRECATIONS *******************************
#
# IOS_DEPLOYMENT_TARGET: (Deprecated) Alias to DEPLOYMENT_TARGET
# CMAKE_IOS_DEVELOPER_ROOT: (Deprecated) Alias to CMAKE_DEVELOPER_ROOT
# IOS_PLATFORM: (Deprecated) Alias to PLATFORM
# IOS_ARCH: (Deprecated) Alias to ARCHS
#
# *****************************************************************************
#
# This file is derived from the files `Platform/Darwin.cmake' and
# `Platform/UnixPaths.cmake', which are part of CMake 2.8.4. It has been
# altered for iOS development.
# Fix for PThread library not in path
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
# Options
# -------
#
# IOS_PLATFORM = OS | SIMULATOR
#
# This decides whether SDKS are selected from the `iPhoneOS.platform' or
# `iPhoneSimulator.platform' folders.
#
# OS - the default, used to build for iPhone and iPad physical devices,
# which have an ARM architecture.
# SIMULATOR - used to build for the Simulator platforms, which have an
# x86 architecture.
#
# CMAKE_IOS_DEVELOPER_ROOT = /path/to/platform/Developer folder
#
# By default, this location is automatically chosen based on the
# IOS_PLATFORM value above. If you manually set this variable, it
# overrides the default location and forces the use of a particular
# Developer Platform.
#
# CMAKE_IOS_SDK_ROOT = /path/to/platform/Developer/SDKs/SDK folder
#
# By default, this location is automatically chosen based on the
# CMAKE_IOS_DEVELOPER_ROOT value. In this case it is always the most
# up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path. If you
# manually set this variable, it forces the use of a specific SDK
# version.
#
#
# Macros
# ------
#
# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE)
#
# A convenience macro for setting Xcode specific properties on targets.
#
# Example:
#
# set_xcode_property(myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1")
#
# find_host_package (PROGRAM ARGS)
#
# A macro to find executable programs on the host system, not within the
# iOS environment. Thanks to the `android-cmake' project for providing
# the command.
# Cache what generator is used
set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" CACHE STRING "Expose CMAKE_GENERATOR" FORCE)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14")
set(MODERN_CMAKE YES)
endif()
# standard settings
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_VERSION 1)
set(UNIX True)
set(APPLE True)
set(IOS True)
# Get the Xcode version being used.
execute_process(COMMAND xcodebuild -version
OUTPUT_VARIABLE XCODE_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}")
string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}")
# required as of cmake 2.8.10
set(CMAKE_OSX_DEPLOYMENT_TARGET ""
CACHE STRING "Force unset of the deployment target for iOS" FORCE
)
######## ALIASES (DEPRECATION WARNINGS)
# determine the cmake host system version so we know where to find the iOS
# SDKs
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
if (CMAKE_UNAME)
exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1"
DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
endif (CMAKE_UNAME)
if(DEFINED IOS_PLATFORM)
set(PLATFORM ${IOS_PLATFORM})
message(DEPRECATION "IOS_PLATFORM argument is DEPRECATED. Consider using the new PLATFORM argument instead.")
endif()
# skip the platform compiler checks for cross compiling
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
if(DEFINED IOS_DEPLOYMENT_TARGET)
set(DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET})
message(DEPRECATION "IOS_DEPLOYMENT_TARGET argument is DEPRECATED. Consider using the new DEPLOYMENT_TARGET argument instead.")
endif()
# all iOS/Darwin specific settings - some may be redundant
if(DEFINED CMAKE_IOS_DEVELOPER_ROOT)
set(CMAKE_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT})
message(DEPRECATION "CMAKE_IOS_DEVELOPER_ROOT argument is DEPRECATED. Consider using the new CMAKE_DEVELOPER_ROOT argument instead.")
endif()
if(DEFINED IOS_ARCH)
set(ARCHS ${IOS_ARCH})
message(DEPRECATION "IOS_ARCH argument is DEPRECATED. Consider using the new ARCHS argument instead.")
endif()
######## END ALIASES
# Unset the FORCE on cache variables if in try_compile()
set(FORCE_CACHE FORCE)
get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
if(_CMAKE_IN_TRY_COMPILE)
unset(FORCE_CACHE)
endif()
# Default to building for iPhoneOS if not specified otherwise, and we cannot
# determine the platform from the CMAKE_OSX_ARCHITECTURES variable. The use
# of CMAKE_OSX_ARCHITECTURES is such that try_compile() projects can correctly
# determine the value of PLATFORM from the root project, as
# CMAKE_OSX_ARCHITECTURES is propagated to them by CMake.
if(NOT DEFINED PLATFORM)
if (CMAKE_OSX_ARCHITECTURES)
if(CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*" AND CMAKE_OSX_SYSROOT MATCHES ".*iphoneos.*")
set(PLATFORM "OS")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*")
set(PLATFORM "SIMULATOR")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*")
set(PLATFORM "SIMULATOR64")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "arm64" AND CMAKE_OSX_SYSROOT MATCHES ".*appletvos.*")
set(PLATFORM "TVOS")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" AND CMAKE_OSX_SYSROOT MATCHES ".*appletvsimulator.*")
set(PLATFORM "SIMULATOR_TVOS")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ".*armv7k.*" AND CMAKE_OSX_SYSROOT MATCHES ".*watchos.*")
set(PLATFORM "WATCHOS")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*watchsimulator.*")
set(PLATFORM "SIMULATOR_WATCHOS")
endif()
endif()
if (NOT PLATFORM)
set(PLATFORM "OS")
endif()
endif()
set(PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets.")
# Handle the case where we are targeting iOS and a version above 10.3.4 (32-bit support dropped officially)
if(PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
set(PLATFORM_INT "OS64")
message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
elseif(PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
set(PLATFORM_INT "SIMULATOR64")
message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
endif()
# Determine the platform name and architectures for use in xcodebuild commands
# from the specified PLATFORM name.
if(PLATFORM_INT STREQUAL "OS")
set(SDK_NAME iphoneos)
if(NOT ARCHS)
set(ARCHS armv7 armv7s arm64)
set(APPLE_TARGET_TRIPLE_INT arm-apple-ios)
endif()
elseif(PLATFORM_INT STREQUAL "OS64")
set(SDK_NAME iphoneos)
if(NOT ARCHS)
if (XCODE_VERSION VERSION_GREATER 10.0)
set(ARCHS arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
else()
set(ARCHS arm64)
endif()
set(APPLE_TARGET_TRIPLE_INT aarch64-apple-ios)
endif()
elseif(PLATFORM_INT STREQUAL "OS64COMBINED")
set(SDK_NAME iphoneos)
if(MODERN_CMAKE)
if(NOT ARCHS)
if (XCODE_VERSION VERSION_GREATER 10.0)
set(ARCHS arm64 x86_64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
else()
set(ARCHS arm64 x86_64)
endif()
set(APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-ios)
endif()
else()
message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the OS64COMBINED setting work")
endif()
elseif(PLATFORM_INT STREQUAL "SIMULATOR")
set(SDK_NAME iphonesimulator)
if(NOT ARCHS)
set(ARCHS i386)
set(APPLE_TARGET_TRIPLE_INT i386-apple-ios)
endif()
message(DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead.")
elseif(PLATFORM_INT STREQUAL "SIMULATOR64")
set(SDK_NAME iphonesimulator)
if(NOT ARCHS)
set(ARCHS x86_64)
set(APPLE_TARGET_TRIPLE_INT x86_64-apple-ios)
endif()
elseif(PLATFORM_INT STREQUAL "TVOS")
set(SDK_NAME appletvos)
if(NOT ARCHS)
set(ARCHS arm64)
set(APPLE_TARGET_TRIPLE_INT aarch64-apple-tvos)
endif()
elseif (PLATFORM_INT STREQUAL "TVOSCOMBINED")
set(SDK_NAME appletvos)
if(MODERN_CMAKE)
if(NOT ARCHS)
set(ARCHS arm64 x86_64)
set(APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-tvos)
endif()
else()
message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the TVOSCOMBINED setting work")
endif()
elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS")
set(SDK_NAME appletvsimulator)
if(NOT ARCHS)
set(ARCHS x86_64)
set(APPLE_TARGET_TRIPLE_INT x86_64-apple-tvos)
endif()
elseif(PLATFORM_INT STREQUAL "WATCHOS")
set(SDK_NAME watchos)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fgnu-inline-asm")
if(NOT ARCHS)
if (XCODE_VERSION VERSION_GREATER 10.0)
set(ARCHS armv7k arm64_32)
set(APPLE_TARGET_TRIPLE_INT aarch64_32-apple-watchos)
else()
set(ARCHS armv7k)
set(APPLE_TARGET_TRIPLE_INT arm-apple-watchos)
endif()
endif()
elseif(PLATFORM_INT STREQUAL "WATCHOSCOMBINED")
set(SDK_NAME watchos)
if(MODERN_CMAKE)
if(NOT ARCHS)
if (XCODE_VERSION VERSION_GREATER 10.0)
set(ARCHS armv7k arm64_32 i386)
set(APPLE_TARGET_TRIPLE_INT aarch64_32-i386-apple-watchos)
else()
set(ARCHS armv7k i386)
set(APPLE_TARGET_TRIPLE_INT arm-i386-apple-watchos)
endif()
endif()
else()
message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the WATCHOSCOMBINED setting work")
endif()
elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
set(SDK_NAME watchsimulator)
if(NOT ARCHS)
set(ARCHS i386)
set(APPLE_TARGET_TRIPLE_INT i386-apple-watchos)
endif()
else()
message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}")
endif()
if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode")
endif()
# If user did not specify the SDK root to use, then query xcodebuild for it.
execute_process(COMMAND xcodebuild -version -sdk ${SDK_NAME} Path
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT)
message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
"is pointing to the correct path. Please run:"
"sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"
"and see if that fixes the problem for you.")
message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
"does not exist.")
elseif(DEFINED CMAKE_OSX_SYSROOT_INT)
set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
endif()
# Set Xcode property for SDKROOT as well if Xcode generator is used
if(USED_CMAKE_GENERATOR MATCHES "Xcode")
set(CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "")
if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM)
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "123456789A" CACHE INTERNAL "")
endif()
endif()
# Specify minimum version of deployment target.
if(NOT DEFINED DEPLOYMENT_TARGET)
if (PLATFORM_INT STREQUAL "WATCHOS" OR PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
# Unless specified, SDK version 2.0 is used by default as minimum target version (watchOS).
set(DEPLOYMENT_TARGET "2.0"
CACHE STRING "Minimum SDK version to build for." )
else()
# Unless specified, SDK version 9.0 is used by default as minimum target version (iOS, tvOS).
set(DEPLOYMENT_TARGET "9.0"
CACHE STRING "Minimum SDK version to build for." )
endif()
message(STATUS "Using the default min-version since DEPLOYMENT_TARGET not provided!")
endif()
# Use bitcode or not
if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+")
# Unless specified, enable bitcode support by default
message(STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!")
set(ENABLE_BITCODE TRUE)
elseif(NOT DEFINED ENABLE_BITCODE)
message(STATUS "Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!")
set(ENABLE_BITCODE FALSE)
endif()
set(ENABLE_BITCODE_INT ${ENABLE_BITCODE} CACHE BOOL "Whether or not to enable bitcode" ${FORCE_CACHE})
# Use ARC or not
if(NOT DEFINED ENABLE_ARC)
# Unless specified, enable ARC support by default
set(ENABLE_ARC TRUE)
message(STATUS "Enabling ARC support by default. ENABLE_ARC not provided!")
endif()
set(ENABLE_ARC_INT ${ENABLE_ARC} CACHE BOOL "Whether or not to enable ARC" ${FORCE_CACHE})
# Use hidden visibility or not
if(NOT DEFINED ENABLE_VISIBILITY)
# Unless specified, disable symbols visibility by default
set(ENABLE_VISIBILITY FALSE)
message(STATUS "Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!")
endif()
set(ENABLE_VISIBILITY_INT ${ENABLE_VISIBILITY} CACHE BOOL "Whether or not to hide symbols (-fvisibility=hidden)" ${FORCE_CACHE})
# Set strict compiler checks or not
if(NOT DEFINED ENABLE_STRICT_TRY_COMPILE)
# Unless specified, disable strict try_compile()
set(ENABLE_STRICT_TRY_COMPILE FALSE)
message(STATUS "Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!")
endif()
set(ENABLE_STRICT_TRY_COMPILE_INT ${ENABLE_STRICT_TRY_COMPILE} CACHE BOOL "Whether or not to use strict compiler checks" ${FORCE_CACHE})
# Get the SDK version information.
execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion
OUTPUT_VARIABLE SDK_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find the Developer root for the specific iOS platform being compiled for
# from CMAKE_OSX_SYSROOT. Should be ../../ from SDK specified in
# CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain
# this information from xcrun or xcodebuild.
if (NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT} PATH)
get_filename_component(CMAKE_DEVELOPER_ROOT ${PLATFORM_SDK_DIR} PATH)
if (NOT DEFINED CMAKE_DEVELOPER_ROOT)
message(FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: "
"${CMAKE_DEVELOPER_ROOT} does not exist.")
endif()
endif()
# Find the C & C++ compilers for the specified SDK.
if(NOT CMAKE_C_COMPILER)
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang
OUTPUT_VARIABLE CMAKE_C_COMPILER
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}")
endif()
if(NOT CMAKE_CXX_COMPILER)
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang++
OUTPUT_VARIABLE CMAKE_CXX_COMPILER
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}")
endif()
# Find (Apple's) libtool.
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool
OUTPUT_VARIABLE BUILD_LIBTOOL
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using libtool: ${BUILD_LIBTOOL}")
# Configure libtool to be used instead of ar + ranlib to build static libraries.
# This is required on Xcode 7+, but should also work on previous versions of
# Xcode.
set(CMAKE_C_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
# Find the toolchain's provided install_name_tool if none is found on the host
if(NOT CMAKE_INSTALL_NAME_TOOL)
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find install_name_tool
OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL_INT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_INSTALL_NAME_TOOL ${CMAKE_INSTALL_NAME_TOOL_INT} CACHE STRING "" ${FORCE_CACHE})
endif()
# Get the version of Darwin (OS X) of the host.
execute_process(COMMAND uname -r
OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(SDK_NAME MATCHES "iphone")
set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
endif()
# CMake 3.14+ support building for iOS, watchOS and tvOS out of the box.
if(MODERN_CMAKE)
if(SDK_NAME MATCHES "appletv")
set(CMAKE_SYSTEM_NAME tvOS CACHE INTERNAL "" ${FORCE_CACHE})
elseif(SDK_NAME MATCHES "watch")
set(CMAKE_SYSTEM_NAME watchOS CACHE INTERNAL "" ${FORCE_CACHE})
endif()
# Provide flags for a combined FAT library build on newer CMake versions
if(PLATFORM_INT MATCHES ".*COMBINED")
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO" CACHE INTERNAL "" ${FORCE_CACHE})
set(CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "" ${FORCE_CACHE})
message(STATUS "Will combine built (static) artifacts into FAT lib...")
endif()
elseif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
# Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
else()
# Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE})
endif()
# Standard settings.
set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "")
set(UNIX TRUE CACHE BOOL "")
set(APPLE TRUE CACHE BOOL "")
set(IOS TRUE CACHE BOOL "")
set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
set(CMAKE_STRIP strip CACHE FILEPATH "" FORCE)
# Set the architectures for which to build.
set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS")
# Change the type of target generated for try_compile() so it'll work when cross-compiling, weak compiler checks
if(ENABLE_STRICT_TRY_COMPILE_INT)
message(STATUS "Using strict compiler checks (default in CMake).")
else()
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif()
# All iOS/Darwin specific settings - some may be redundant.
set(CMAKE_MACOSX_BUNDLE YES)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
set(CMAKE_SHARED_MODULE_PREFIX "lib")
set(CMAKE_SHARED_MODULE_SUFFIX ".so")
set(CMAKE_C_COMPILER_ABI ELF)
set(CMAKE_CXX_COMPILER_ABI ELF)
set(CMAKE_C_HAS_ISYSROOT 1)
set(CMAKE_CXX_HAS_ISYSROOT 1)
set(CMAKE_MODULE_EXISTS 1)
set(CMAKE_DL_LIBS "")
set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG
"-compatibility_version ")
set(CMAKE_C_OSX_CURRENT_VERSION_FLAG
"-current_version ")
set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG
"${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG
"${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
if(ARCHS MATCHES "((^|;|, )(arm64|arm64e|x86_64))+")
set(CMAKE_C_SIZEOF_DATA_PTR 8)
set(CMAKE_CXX_SIZEOF_DATA_PTR 8)
if(ARCHS MATCHES "((^|;|, )(arm64|arm64e))+")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
else()
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
endif()
else()
set(CMAKE_C_SIZEOF_DATA_PTR 4)
set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
set(CMAKE_SYSTEM_PROCESSOR "arm")
endif()
# hidden visibility is required for cxx on iOS
set(CMAKE_C_FLAGS_INIT "")
set(CMAKE_CXX_FLAGS_INIT
"-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
# Note that only Xcode 7+ supports the newer more specific:
# -m${SDK_NAME}-version-min flags, older versions of Xcode use:
# -m(ios/ios-simulator)-version-min instead.
if(${CMAKE_VERSION} VERSION_LESS "3.11")
if(PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64")
if(XCODE_VERSION VERSION_LESS 7.0)
set(SDK_NAME_VERSION_FLAGS
"-mios-version-min=${DEPLOYMENT_TARGET}")
else()
# Xcode 7.0+ uses flags we can build directly from SDK_NAME.
set(SDK_NAME_VERSION_FLAGS
"-m${SDK_NAME}-version-min=${DEPLOYMENT_TARGET}")
endif()
elseif(PLATFORM_INT STREQUAL "TVOS")
set(SDK_NAME_VERSION_FLAGS
"-mtvos-version-min=${DEPLOYMENT_TARGET}")
elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS")
set(SDK_NAME_VERSION_FLAGS
"-mtvos-simulator-version-min=${DEPLOYMENT_TARGET}")
elseif(PLATFORM_INT STREQUAL "WATCHOS")
set(SDK_NAME_VERSION_FLAGS
"-mwatchos-version-min=${DEPLOYMENT_TARGET}")
elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
set(SDK_NAME_VERSION_FLAGS
"-mwatchos-simulator-version-min=${DEPLOYMENT_TARGET}")
else()
# SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min.
set(SDK_NAME_VERSION_FLAGS
"-mios-simulator-version-min=${DEPLOYMENT_TARGET}")
endif()
else()
# Newer versions of CMake sets the version min flags correctly
set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET} CACHE STRING
"Set CMake deployment target" ${FORCE_CACHE})
endif()
set(CMAKE_C_LINK_FLAGS
"-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
set(CMAKE_CXX_LINK_FLAGS
"-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
if(DEFINED APPLE_TARGET_TRIPLE_INT)
set(APPLE_TARGET_TRIPLE ${APPLE_TARGET_TRIPLE_INT} CACHE STRING
"Autoconf target triple compatible variable" ${FORCE_CACHE})
endif()
if(ENABLE_BITCODE_INT)
set(BITCODE "-fembed-bitcode")
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode" CACHE INTERNAL "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES" CACHE INTERNAL "")
else()
set(BITCODE "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO" CACHE INTERNAL "")
endif()
if(ENABLE_ARC_INT)
set(FOBJC_ARC "-fobjc-arc")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES" CACHE INTERNAL "")
else()
set(FOBJC_ARC "-fno-objc-arc")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "NO" CACHE INTERNAL "")
endif()
if(NOT ENABLE_VISIBILITY_INT)
set(VISIBILITY "-fvisibility=hidden")
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "YES" CACHE INTERNAL "")
else()
set(VISIBILITY "")
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "NO" CACHE INTERNAL "")
endif()
if(NOT IOS_TOOLCHAIN_HAS_RUN)
#Check if Xcode generator is used, since that will handle these flags automagically
if(USED_CMAKE_GENERATOR MATCHES "Xcode")
message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
else()
set(CMAKE_C_FLAGS
"${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}")
# Hidden visibilty is required for C++ on iOS.
set(CMAKE_CXX_FLAGS
"${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fvisibility-inlines-hidden -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
set(CMAKE_CXX_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp")
# In order to ensure that the updated compiler flags are used in try_compile()
# tests, we have to forcibly set them in the CMake cache, not merely set them
# in the local scope.
set(VARS_TO_FORCE_IN_CACHE
CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_LINK_FLAGS
CMAKE_CXX_LINK_FLAGS)
foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE})
set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "" ${FORCE_CACHE})
endforeach()
endif()
## Print status messages to inform of the current state
message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}")
message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT}")
if(DEFINED APPLE_TARGET_TRIPLE)
message(STATUS "Autoconf target triple: ${APPLE_TARGET_TRIPLE}")
endif()
message(STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}"
" (SDK version: ${SDK_VERSION})")
if(MODERN_CMAKE)
message(STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!")
endif()
if(USED_CMAKE_GENERATOR MATCHES "Xcode")
message(STATUS "Using Xcode version: ${XCODE_VERSION}")
endif()
if(DEFINED SDK_NAME_VERSION_FLAGS)
message(STATUS "Using version flags: ${SDK_NAME_VERSION_FLAGS}")
endif()
message(STATUS "Using a data_ptr size of: ${CMAKE_CXX_SIZEOF_DATA_PTR}")
message(STATUS "Using install_name_tool: ${CMAKE_INSTALL_NAME_TOOL}")
if(ENABLE_BITCODE_INT)
message(STATUS "Enabling bitcode support.")
else()
message(STATUS "Disabling bitcode support.")
endif()
if(ENABLE_ARC_INT)
message(STATUS "Enabling ARC support.")
else()
message(STATUS "Disabling ARC support.")
endif()
if(NOT ENABLE_VISIBILITY_INT)
message(STATUS "Hiding symbols (-fvisibility=hidden).")
endif()
endif()
set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
"-dynamiclib -headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"-bundle -headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_LOADER_C_FLAG
"-Wl,-bundle_loader,")
set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG
"-Wl,-bundle_loader,")
set(CMAKE_FIND_LIBRARY_SUFFIXES
".dylib" ".so" ".a")
set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
# hack: If a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old
# build tree (where `install_name_tool' was hardcoded), and where
# CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't
# fail in `CMakeFindBinUtils.cmake' (because it isn't rerun), hardcode
# CMAKE_INSTALL_NAME_TOOL here to `install_name_tool' so it behaves as
# it did before.
if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
# set up iOS platform unless specified manually with IOS_PLATFORM
if (NOT DEFINED IOS_PLATFORM)
set(IOS_PLATFORM "OS")
endif (NOT DEFINED IOS_PLATFORM)
set(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")
# check the platform selection and setup for developer root
if (${IOS_PLATFORM} STREQUAL "OS")
set(IOS_PLATFORM_LOCATION "iPhoneOS.platform")
# this causes the installers to properly locate the output libraries
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos")
elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
set(IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
# this causes the installers to properly locate the output libraries
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
else (${IOS_PLATFORM} STREQUAL "OS")
message(FATAL_ERROR
"Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR.")
endif (${IOS_PLATFORM} STREQUAL "OS")
# set up iOS developer location unless specified manually with
# CMAKE_IOS_DEVELOPER_ROOT --
# note that Xcode 4.3 changed the installation location; choose the most
# recent one available
set(XCODE_POST_43_ROOT
"/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
set(XCODE_PRE_43_ROOT
"/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
if (EXISTS ${XCODE_POST_43_ROOT})
set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT})
elseif (EXISTS ${XCODE_PRE_43_ROOT})
set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT})
endif (EXISTS ${XCODE_POST_43_ROOT})
endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
set(CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT}
CACHE PATH "Location of iOS Platform"
)
# find and use the most recent iOS SDK unless specified manually with
# CMAKE_IOS_SDK_ROOT
if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
file(GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
if (_CMAKE_IOS_SDKS)
list(SORT _CMAKE_IOS_SDKS)
list(REVERSE _CMAKE_IOS_SDKS)
list(GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
else (_CMAKE_IOS_SDKS)
message(FATAL_ERROR
"No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
endif (_CMAKE_IOS_SDKS)
message(STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
set(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT}
CACHE PATH "Location of the selected iOS SDK"
)
# set the sysroot default to the most recent SDK
set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT}
CACHE PATH "Sysroot used for iOS support"
)
# set the architecture for iOS --
# note that currently both ARCHS_STANDARD_32_BIT and
# ARCHS_UNIVERSAL_IPHONE_OS set armv7 only, so set both manually
if (${IOS_PLATFORM} STREQUAL "OS")
set(IOS_ARCH $(ARCHS_STANDARD_32_64_BIT))
else (${IOS_PLATFORM} STREQUAL "OS")
set(IOS_ARCH i386)
endif (${IOS_PLATFORM} STREQUAL "OS")
set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH}
CACHE string "Build architecture for iOS"
)
# set the find root to the iOS developer roots and to user defined paths
set(CMAKE_FIND_ROOT_PATH
${CMAKE_IOS_DEVELOPER_ROOT}
${CMAKE_IOS_SDK_ROOT}
${CMAKE_PREFIX_PATH}
CACHE string "iOS find search path root"
)
# default to searching for frameworks first
# Set the find root to the iOS developer roots and to user defined paths.
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT_INT} ${CMAKE_PREFIX_PATH} CACHE STRING "Root path that will be prepended
to all search paths")
# Default to searching for frameworks first.
set(CMAKE_FIND_FRAMEWORK FIRST)
# Set up the default search directories for frameworks.
set(CMAKE_FRAMEWORK_PATH
${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks
${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks
${CMAKE_FRAMEWORK_PATH} CACHE STRING "Frameworks search paths" ${FORCE_CACHE})
# set up the default search directories for frameworks
set(CMAKE_SYSTEM_FRAMEWORK_PATH
${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
)
set(IOS_TOOLCHAIN_HAS_RUN TRUE CACHE BOOL "Has the CMake toolchain run already?" ${FORCE_CACHE})
# only search the iOS SDKs, not the remainder of the host filesystem
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# By default, search both the specified iOS SDK and the remainder of the host filesystem.
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE STRING "" ${FORCE_CACHE})
endif()
if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH CACHE STRING "" ${FORCE_CACHE})
endif()
if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH CACHE STRING "" ${FORCE_CACHE})
endif()
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH CACHE STRING "" ${FORCE_CACHE})
endif()
# this little macro lets you set any Xcode specific property
macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
set_property(TARGET ${TARGET}
PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
#
# Some helper-macros below to simplify and beautify the CMakeFile
#
# This little macro lets you set any Xcode specific property.
macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION)
set(XCODE_RELVERSION_I "${XCODE_RELVERSION}")
if(XCODE_RELVERSION_I STREQUAL "All")
set_property(TARGET ${TARGET} PROPERTY
XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}")
else()
set_property(TARGET ${TARGET} PROPERTY
XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}")
endif()
endmacro(set_xcode_property)
# this macro lets you find executable programs on the host system
# This macro lets you find executable programs on the host system.
macro(find_host_package)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
set(IOS FALSE)
find_package(${ARGN})
set(IOS TRUE)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
endmacro(find_host_package)
# eof

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
# Copyright (C) 2015-2022 by
# Copyright (C) 2015-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -59,7 +59,7 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c
@ -68,7 +68,7 @@ CFLAGS ?= -c
#
# we assume the compiler is already strictly ANSI
#
ANSIFLAGS ?=
ANSIFLAGS :=
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -60,14 +60,14 @@ TE := -e
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?= -A
ANSIFLAGS := -A
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -60,14 +60,14 @@ TE := -e
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?= -A
ANSIFLAGS := -A
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 2003-2022 by
# Copyright (C) 2003-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -58,14 +58,14 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c -g -O6 -Wall
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?=
ANSIFLAGS :=
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -59,7 +59,7 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
@ -82,9 +82,8 @@ ifndef CFLAGS
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# You can override this on the command line.
#
ANSIFLAGS ?= -std=c99 -pedantic
ANSIFLAGS := -ansi -pedantic
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -58,14 +58,14 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c -g -O3 -Wall
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?= -std=c99 -pedantic
ANSIFLAGS := -ansi -pedantic
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -61,7 +61,7 @@ TE := /Fe
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
# Note that the Intel C/C++ compiler version 4.5 complains about
@ -74,7 +74,7 @@ CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?= /Qansi_alias /Za
ANSIFLAGS := /Qansi_alias /Za
# Library linking
#

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -60,7 +60,7 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c -g
@ -71,7 +71,7 @@ CFLAGS ?= -c -g
#
# the "-A" flag simply increments verbosity about non ANSI code
#
ANSIFLAGS ?= -A
ANSIFLAGS := -A
# library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -63,14 +63,14 @@ TE := /Fe
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= /nologo /c /Ox /W3 /WX
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?= /Za /D_CRT_SECURE_NO_DEPRECATE
ANSIFLAGS := /Za /D_CRT_SECURE_NO_DEPRECATE
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -60,14 +60,14 @@ T := -FO=
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -zq
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS ?= -za
ANSIFLAGS := -za
# Library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -60,7 +60,7 @@ T := -Fo
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -c -g2 -O
@ -69,7 +69,7 @@ CFLAGS ?= -c -g2 -O
#
# LCC is pure ANSI anyway!
#
ANSIFLAGS ?=
ANSIFLAGS :=
# library linking

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -16,7 +16,7 @@
# This sub-Makefile is in charge of detecting the current platform. It sets
# the following variables:
#
# PLATFORM_DIR The configuration and system-specific directory. Usually
# BUILD_DIR The configuration and system-specific directory. Usually
# `builds/$(PLATFORM)' but can be different for custom builds
# of the library.
#
@ -49,8 +49,8 @@ SEP := /
BUILD_CONFIG := $(TOP_DIR)/builds
# These two assignments must be delayed.
PLATFORM_DIR = $(BUILD_CONFIG)/$(PLATFORM)
CONFIG_RULES = $(PLATFORM_DIR)/$(CONFIG_FILE)
BUILD_DIR = $(BUILD_CONFIG)/$(PLATFORM)
CONFIG_RULES = $(BUILD_DIR)/$(CONFIG_FILE)
# We define the BACKSLASH variable to hold a single back-slash character.
# This is needed because a line like
@ -113,7 +113,7 @@ std_setup:
$(info )
$(info $(empty) platform $(PLATFORM))
$(info $(empty) compiler $(CC))
$(info $(empty) configuration directory $(subst /,$(SEP),$(PLATFORM_DIR)))
$(info $(empty) configuration directory $(subst /,$(SEP),$(BUILD_DIR)))
$(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES)))
$(info )
$(info If this does not correspond to your system or settings please remove the file)

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -13,11 +13,11 @@
# fully.
DELETE := del
CAT := type
SEP := $(strip \ )
PLATFORM_DIR := $(TOP_DIR)/builds/dos
PLATFORM := dos
DELETE := del
CAT := type
SEP := $(strip \ )
BUILD_DIR := $(TOP_DIR)/builds/dos
PLATFORM := dos
# This is used for `make refdoc' and `make refdoc-venv'
#

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 2003-2022 by
# Copyright (C) 2003-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 2003-2022 by
# Copyright (C) 2003-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 2005-2022 by
# Copyright (C) 2005-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -20,8 +20,8 @@
# The following variables (set by other Makefile components, in the
# environment, or on the command line) are used:
#
# PLATFORM_DIR The architecture-dependent directory,
# e.g., `$(TOP_DIR)/builds/unix'. Added to INCLUDES also.
# BUILD_DIR The architecture dependent directory,
# e.g. `$(TOP_DIR)/builds/unix'. Added to INCLUDES also.
#
# OBJ_DIR The directory in which object files are created.
#
@ -121,7 +121,7 @@ PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
#
INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
$(DEVEL_DIR) \
$(PLATFORM_DIR) \
$(BUILD_DIR) \
$(TOP_DIR)/include)
INCLUDE_FLAGS := $(INCLUDES:%=$I%)
@ -150,9 +150,9 @@ endif
#
# `CPPFLAGS' might be specified by the user in the environment.
#
FT_CFLAGS = $(CPPFLAGS) \
$(CFLAGS) \
$DFT2_BUILD_LIBRARY
FT_CFLAGS = $(CPPFLAGS) \
$(CFLAGS) \
$DFT2_BUILD_LIBRARY
FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS)
@ -175,16 +175,16 @@ OBJECTS_LIST :=
# changes, the whole library is recompiled.
#
ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
FTOPTION_H := $(OBJ_DIR)/ftoption.h
else ifneq ($(wildcard $(PLATFORM_DIR)/ftoption.h),)
FTOPTION_H := $(PLATFORM_DIR)/ftoption.h
FTOPTION_H := $(OBJ_DIR)/ftoption.h
else ifneq ($(wildcard $(BUILD_DIR)/ftoption.h),)
FTOPTION_H := $(BUILD_DIR)/ftoption.h
endif
PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h)
INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \
$(wildcard $(SERVICES_DIR)/*.h)
CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \
$(wildcard $(PLATFORM_DIR)/config/*.h) \
$(wildcard $(BUILD_DIR)/config/*.h) \
$(FTMODULE_H) \
$(FTOPTION_H)
DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h)
@ -220,7 +220,6 @@ $(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
#
include $(SRC_DIR)/base/rules.mk
include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES))
include $(SRC_DIR)/dlg/rules.mk
# ftinit component
@ -261,8 +260,8 @@ endif
# All FreeType library objects.
#
OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M) $(DLG_OBJS_M)
OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S) $(DLG_OBJS_S)
OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
# The target `multi' on the Make command line indicates that we want to

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -9,7 +9,7 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>freetype</string>
<string>FreeType</string>
<key>CFBundleGetInfoString</key>
<string>FreeType ${PROJECT_VERSION}</string>

View File

@ -5,7 +5,7 @@
/* Mac FOND support. Written by just@letterror.com. */
/* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */
/* */
/* Copyright (C) 1996-2022 by */
/* Copyright (C) 1996-2020 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -97,7 +97,7 @@
#define FT_DEPRECATED_ATTRIBUTE
#include <freetype/ftmac.h>
#include FT_MAC_H
/* undefine blocking-macros in ftmac.h */
#undef FT_GetFile_From_Mac_Name
@ -447,7 +447,7 @@ typedef short ResourceIndex;
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = NULL;
stream->base = 0;
}
@ -939,7 +939,7 @@ typedef short ResourceIndex;
if ( lwfn_file_name[0] )
{
err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
buff, sizeof ( buff ) );
buff, sizeof ( buff ) );
if ( !err )
have_lwfn = 1;
}
@ -1011,7 +1011,7 @@ typedef short ResourceIndex;
old_total_size = total_size;
}
if ( FT_QALLOC( buffer, (FT_Long)total_size ) )
if ( FT_ALLOC( buffer, (FT_Long)total_size ) )
goto Error;
/* Second pass: append all POST data to the buffer, add PFB fields. */
@ -1127,7 +1127,7 @@ typedef short ResourceIndex;
return FT_THROW( Invalid_Handle );
sfnt_size = (FT_ULong)GetHandleSize( sfnt );
if ( FT_QALLOC( sfnt_data, (FT_Long)sfnt_size ) )
if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
{
ReleaseResource( sfnt );
return error;

View File

@ -1,117 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 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.
"""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())

View File

@ -1,115 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 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.
"""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())

View File

@ -1,89 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 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.
"""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())

View File

@ -1,171 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 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.
"""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",
"svg": "ft_svg",
}.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())

View File

@ -1,115 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 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.
"""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) + "\n"
# 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())

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -13,11 +13,11 @@
# fully.
DELETE := del
CAT := type
SEP := $(strip \ )
PLATFORM_DIR := $(TOP_DIR)/builds/os2
PLATFORM := os2
DELETE := del
CAT := type
SEP := $(strip \ )
BUILD_DIR := $(TOP_DIR)/builds/os2
PLATFORM := os2
# This is used for `make refdoc' and `make refdoc-venv'
#

View File

@ -5,7 +5,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -2,7 +2,7 @@
// FreeType 2 project for the symbian platform
//
// Copyright (C) 2008-2022 by
// Copyright (C) 2008-2020 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used, modified,

View File

@ -2,7 +2,7 @@
// FreeType 2 makefile for the symbian platform
//
// Copyright (C) 2008-2022 by
// Copyright (C) 2008-2020 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -103,7 +103,6 @@ ifneq ($(findstring setup,$(MAKECMDGOALS)),)
check_platform := 1
endif
# Include the automatic host platform detection rules when we need to
# check the platform.
#
@ -113,17 +112,6 @@ ifdef check_platform
include $(TOP_DIR)/builds/detect.mk
# For builds directly from the git repository we need to copy files
# from `subprojects/dlg' to `src/dlg' and `include/dlg'.
#
ifeq ($(wildcard $(TOP_DIR)/src/dlg/dlg.*),)
ifeq ($(wildcard $(TOP_DIR)/subprojects/dlg/*),)
copy_submodule: check_out_submodule
endif
setup: copy_submodule
endif
# This rule makes sense for Unix only to remove files created by a run of
# the configure script which hasn't been successful (so that no
# `config.mk' has been created). It uses the built-in $(RM) command of
@ -166,23 +154,6 @@ else
endif # test check_platform
.PHONY: check_out_submodule copy_submodule
check_out_submodule:
$(info Checking out submodule in `subprojects/dlg')
git submodule init
git submodule update
copy_submodule:
$(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg')
ifeq ($(wildcard include/dlg),)
mkdir $(subst /,$(SEP),include/dlg)
endif
$(COPY) $(subst /,$(SEP),subprojects/dlg/include/dlg/output.h include/dlg)
$(COPY) $(subst /,$(SEP),subprojects/dlg/include/dlg/dlg.h include/dlg)
$(COPY) $(subst /,$(SEP),subprojects/dlg/src/dlg/dlg.c src/dlg)
# We always need the list of modules in ftmodule.h.
#
all setup: $(FTMODULE_H)
@ -226,7 +197,6 @@ patch := $(firstword $(patch))
# else
version := $(major).$(minor).$(patch)
winversion := $(major)$(minor)$(patch)
version_tag := VER-$(major)-$(minor)-$(patch)
# endif
@ -249,10 +219,7 @@ dist:
currdir=`pwd` ; \
for f in `find . -wholename '*/.git' -prune \
-o -name .gitattributes \
-o -name .gitignore \
-o -name .gitlab-ci.yml \
-o -name .gitmodules \
-o -name .mailmap \
-o -type d \
-o -print` ; do \
@ -283,10 +250,6 @@ dist:
CONFIG_GUESS = ~/git/config/config.guess
CONFIG_SUB = ~/git/config/config.sub
# We also use this repository to access the gnulib script that converts git
# commit messages to a ChangeLog file.
CHANGELOG_SCRIPT = ~/git/config/gitlog-to-changelog
# Don't say `make do-dist'. Always use `make dist' instead.
#
@ -304,19 +267,8 @@ do-dist: distclean refdoc
cp $(CONFIG_GUESS) builds/unix
cp $(CONFIG_SUB) builds/unix
@# Generate `ChangeLog' file with commits since release 2.11.0
@# (when we stopped creating this file manually).
$(CHANGELOG_SCRIPT) \
--format='%B%n' \
--no-cluster \
-- VER-2-11-0..$(version_tag) \
> ChangeLog
@# Remove intermediate files created by the `refdoc' target.
rm -rf docs/markdown
rm -f docs/mkdocs.yml
@# Remove more stuff related to git.
rm -rf subprojects/dlg
# EOF

View File

@ -1,522 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
# needed for multi-threaded programs (defaults to the value of CC
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
# special cc_r/CC_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
# CXX="$PTHREAD_CXX"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 30
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_TARGET])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items with a "," contain both
# C compiler flags (before ",") and linker flags (after ","). Other items
# starting with a "-" are C compiler flags, and remaining items are
# library names, except for "none" which indicates that we try without
# any flags at all, and "pthread-config" which is a program returning
# the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case $target_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
;;
esac
# Are we compiling with Clang?
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
# Note that for GCC and Clang -pthread generally implies -lpthread,
# except when -nostdlib is passed.
# This is problematic using libtool to build C++ shared libraries with pthread:
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
# To solve this, first try -pthread together with -lpthread for GCC
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
AS_IF([test "x$ax_pthread_clang" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $target_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
*,*)
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void *some_global = NULL;
static void routine(void *a)
{
/* To avoid any unused-parameter or
unused-but-set-parameter warning. */
some_global = a;
}
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
# Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $target_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;
return i;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then
case $target_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
],
[
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
]
)
])
;;
esac
fi
fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
AC_SUBST([PTHREAD_CXX])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

View File

@ -2,7 +2,7 @@
#
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 2001-2022 by
# Copyright (C) 2001-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.h.in])
# Don't forget to update `docs/VERSIONS.TXT'!
version_info='24:3:18'
version_info='23:2:17'
AC_SUBST([version_info])
ft_version=`echo $version_info | tr : .`
AC_SUBST([ft_version])
@ -97,12 +97,85 @@ esac
# checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h unistd.h])
# checks for typedefs, structures, and compiler characteristics
AC_C_CONST
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_TYPE_LONG_LONG_INT
# check whether cpp computation of size of int and long in ftconfig.h.in works
AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
orig_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${CPPFLAGS}"
ac_clean_files=
if test ! -f ft2build.h; then
ac_clean_files=ft2build.h
touch ft2build.h
fi
cat > conftest.c <<\_ACEOF
#include <limits.h>
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
#include "ftconfig.h.in"
_ACEOF
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
echo >> conftest.c "#endif"
echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
echo >> conftest.c "#endif"
${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
eval `cat conftest.sh`
rm -f conftest.* $ac_clean_files
if test x != "x${ac_cpp_ft_sizeof_int}" \
-a x != x"${ac_cpp_ft_sizeof_long}"; then
unset ft_use_autoconf_sizeof_types
else
ft_use_autoconf_sizeof_types=yes
fi
AC_ARG_ENABLE(biarch-config,
[ --enable-biarch-config install biarch ftconfig.h to support multiple
architectures by single file], [], [])
case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
:yes:yes:)
AC_MSG_RESULT([broken but use it])
unset ft_use_autoconf_sizeof_types
;;
::no:)
AC_MSG_RESULT([works but ignore it])
ft_use_autoconf_sizeof_types=yes
;;
::yes: | :::)
AC_MSG_RESULT([yes])
unset ft_use_autoconf_sizeof_types
;;
*)
AC_MSG_RESULT([no])
ft_use_autoconf_sizeof_types=yes
;;
esac
if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES], [],
[Define if autoconf sizeof types should be used.])
fi
CPPFLAGS="${orig_CPPFLAGS}"
AC_ARG_ENABLE([freetype-config],
AS_HELP_STRING([--enable-freetype-config], [install freetype-config]),
@ -119,59 +192,53 @@ AC_SUBST(INSTALL_FT2_CONFIG, [$enable_freetype_config])
AC_SYS_LARGEFILE
# Here we check whether we can use our mmap file component.
#
# Note that `ftsystem.c` for Windows has its own mmap-like implementation
# not covered by `AC_FUNC_MMAP` and/or `FT_UNMAP_PARAM`.
AC_ARG_ENABLE([mmap],
AS_HELP_STRING([--disable-mmap],
[do not check mmap() and do not use]),
[enable_mmap="no"], [enable_mmap="yes"])
if test "x${enable_mmap}" != "xno"; then
case "$host" in
*-*-mingw*)
AC_MSG_CHECKING([for working mmap])
AC_MSG_RESULT([using MapViewOfFile in Windows])
FTSYS_SRC='$(TOP_DIR)/builds/windows/ftsystem.c'
;;
*)
AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c'
AC_FUNC_MMAP
fi
if test "x${enable_mmap}" = "xno" \
-o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
else
FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
AC_CHECK_DECLS([munmap],
[],
[],
[
AC_CHECK_DECLS([munmap],
[],
[],
[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/mman.h>
])
])
FT_MUNMAP_PARAM
fi
;;
esac
fi
if test -z "$FTSYS_SRC"; then
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
FT_MUNMAP_PARAM
fi
AC_SUBST([FTSYS_SRC])
AC_CHECK_FUNCS([memcpy memmove])
# get compiler flags right
#
# We try to make the compiler work for C99-strict source. Even if the
# C compiler is gcc and C99 flags are available, some system headers
# might be broken in C99 mode. We have to check whether compilation
# finishes successfully.
# We try to make the compiler work for C89-strict source. Even if the
# C compiler is gcc and C89 flags are available, some system headers
# (e.g., Android Bionic libc) are broken in C89 mode. We have to check
# whether the compilation finishes successfully.
#
# Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
#
# To avoid zillions of
#
# ISO C90 does not support 'long long'
#
# warnings, we disable `-pedantic' for gcc version < 4.6.
#
if test "x$GCC" = xyes; then
XX_CFLAGS="-Wall"
@ -183,11 +250,23 @@ if test "x$GCC" = xyes; then
XX_ANSIFLAGS="-pedantic"
;;
*)
XX_ANSIFLAGS=""
GCC_VERSION=`$CC -dumpversion`
GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
for a in "-pedantic" "-std=c99"
XX_PEDANTIC=-pedantic
if test $GCC_MAJOR -lt 4; then
XX_PEDANTIC=
else
if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
XX_PEDANTIC=
fi
fi
XX_ANSIFLAGS=""
for a in $XX_PEDANTIC -ansi
do
AC_MSG_CHECKING([$CC compiler flag ${a} to assure ANSI C99 works correctly])
AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly])
orig_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
AC_COMPILE_IFELSE([
@ -317,12 +396,6 @@ if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
AC_MSG_ERROR([external zlib support requested but library not found])
fi
SYSTEM_ZLIB=
if test "$have_zlib" != no; then
SYSTEM_ZLIB=yes
fi
AC_SUBST([SYSTEM_ZLIB])
# check for system libbz2
@ -435,7 +508,7 @@ AC_ARG_WITH([harfbuzz],
have_harfbuzz=no
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
harfbuzz_pkg="harfbuzz >= 2.0.0"
harfbuzz_pkg="harfbuzz >= 1.8.0"
have_harfbuzz_pkg=no
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
@ -514,48 +587,19 @@ if test x"$with_brotli" = xyes -a "$have_brotli" = no; then
fi
# Checks for the demo programs.
# check for librt
#
# FreeType doesn't need this. However, since the demo program repository
# doesn't come with a `configure` script of its own, we integrate the tests
# here for simplicity.
# We need `clock_gettime` from 'librt' for the `ftbench` demo program.
# We need `clock_gettime' for the `ftbench' demo program.
#
# The code is modeled after gnulib's file `clock_time.m4`, ignoring
# The code is modeled after gnulib's file `clock_time.m4', ignoring
# very old Solaris systems.
LIB_CLOCK_GETTIME=
AC_SEARCH_LIBS([clock_gettime],
[rt],
[test "$ac_cv_search_clock_gettime" = "none required" \
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
FT_DEMO_CFLAGS=""
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
# 'librsvg' is needed to demonstrate SVG support.
AC_ARG_WITH([librsvg],
[AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
[support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
[], [with_librsvg=auto])
have_librsvg=no
if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
[have_librsvg="yes (pkg-config)"], [:])
if test "$have_librsvg" != no; then
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
fi
fi
if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
AC_MSG_ERROR([librsvg support requested but library not found])
fi
AC_SUBST([FT_DEMO_CFLAGS])
AC_SUBST([FT_DEMO_LDFLAGS])
AC_SUBST([LIB_CLOCK_GETTIME])
# Some options handling SDKs/archs in CFLAGS should be copied
@ -968,10 +1012,6 @@ case "$CFLAGS" in
;;
esac
# Check for pthreads
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
# Check for Python and docwriter
have_py3=no
@ -984,7 +1024,7 @@ if test "x$PYTHON" != "xmissing"; then
if test "x$have_py3" = "xyes"; then
PIP="$PYTHON -m $PIP"
AC_MSG_CHECKING([for `docwriter' Python module])
AC_MSG_CHECKING([for \`docwriter' Python module])
$PYTHON -m docwriter -h > /dev/null 2>&1
if test "x$?" = "x0"; then
have_docwriter=yes
@ -997,32 +1037,32 @@ fi
# entries in Requires.private are separated by commas
PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
$bzip2_reqpriv, \
$libpng_reqpriv, \
$harfbuzz_reqpriv, \
$brotli_reqpriv"
REQUIRES_PRIVATE="$zlib_reqpriv, \
$bzip2_reqpriv, \
$libpng_reqpriv, \
$harfbuzz_reqpriv, \
$brotli_reqpriv"
# beautify
PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
| sed -e 's/^ *//' \
-e 's/ *$//' \
-e 's/, */,/g' \
-e 's/,,*/,/g' \
-e 's/^,*//' \
-e 's/,*$//' \
-e 's/,/, /g'`
REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
| sed -e 's/^ *//' \
-e 's/ *$//' \
-e 's/, */,/g' \
-e 's/,,*/,/g' \
-e 's/^,*//' \
-e 's/,*$//' \
-e 's/,/, /g'`
PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
$bzip2_libspriv \
$libpng_libspriv \
$harfbuzz_libspriv \
$brotli_libspriv \
$ft2_extra_libs"
LIBS_PRIVATE="$zlib_libspriv \
$bzip2_libspriv \
$libpng_libspriv \
$harfbuzz_libspriv \
$brotli_libspriv \
$ft2_extra_libs"
# beautify
PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
| sed -e 's/^ *//' \
-e 's/ *$//' \
-e 's/ */ /g'`
LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
| sed -e 's/^ *//' \
-e 's/ *$//' \
-e 's/ */ /g'`
LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libsstaticconf \
@ -1040,28 +1080,10 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
-e 's/ *$//' \
-e 's/ */ /g'`
# If FreeType gets installed with `--disable-shared', don't use
# 'private' fields. `pkg-config' only looks into `.pc' files and is
# completely agnostic to whether shared libraries are actually present
# or not. As a consequence, the user had to specify `--static' while
# calling `pkg-config', which configure scripts are normally not
# prepared for.
PKGCONFIG_REQUIRES=
PKGCONFIG_LIBS='-L${libdir} -lfreetype'
if test $enable_shared = "no"; then
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
PKGCONFIG_REQUIRES_PRIVATE=
PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
PKGCONFIG_LIBS_PRIVATE=
fi
AC_SUBST([ftmac_c])
AC_SUBST([PKGCONFIG_REQUIRES])
AC_SUBST([PKGCONFIG_LIBS])
AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
AC_SUBST([REQUIRES_PRIVATE])
AC_SUBST([LIBS_PRIVATE])
AC_SUBST([LIBSSTATIC_CONFIG])
AC_SUBST([hardcode_libdir_flag_spec])
@ -1120,11 +1142,6 @@ else
ftoption_unset FT_CONFIG_OPTION_USE_BROTLI
fi
if test "$have_pthread" != no; then
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS"
fi
AC_SUBST([CFLAGS])
AC_SUBST([LDFLAGS])
@ -1159,27 +1176,16 @@ Library configuration:
libpng: $have_libpng
harfbuzz: $have_harfbuzz
brotli: $have_brotli
pthread: $have_pthread
])
# Warn if docwriter is not installed
if test $have_docwriter = no; then
AC_MSG_WARN([
`make refdoc' will fail since pip package `docwriter' is not installed.
To install, run `$PIP install docwriter', or to use a Python
virtual environment, run `make refdoc-venv' (requires pip package
`virtualenv'). These operations require Python >= 3.5.
])
fi
# Warn if pthread is not available
if test $have_pthread = no; then
AC_MSG_WARN([
`FT_DEBUG_LOGGING' will not work since the `pthread' library is not
available. This warning can be safely ignored if you don't plan to use
this configuration macro.
\`make refdoc' will fail since pip package \`docwriter' is not installed.
To install, run \`$PIP install docwriter', or to use a Python
virtual environment, run \`make refdoc-venv' (requires pip package
\`virtualenv'). These operations require Python >= 3.5.
])
fi

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,

View File

@ -1,6 +1,6 @@
#! /bin/sh
#
# Copyright (C) 2000-2022 by
# Copyright (C) 2000-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -7,8 +7,8 @@ Name: FreeType 2
URL: https://freetype.org
Description: A free, high-quality, and portable font engine.
Version: %ft_version%
Requires: %PKGCONFIG_REQUIRES%
Requires.private: %PKGCONFIG_REQUIRES_PRIVATE%
Libs: %PKGCONFIG_LIBS%
Libs.private: %PKGCONFIG_LIBS_PRIVATE%
Requires:
Requires.private: %REQUIRES_PRIVATE%
Libs: -L${libdir} -lfreetype
Libs.private: %LIBS_PRIVATE%
Cflags: -I${includedir}/freetype2

View File

@ -1,7 +1,7 @@
# Configure paths for FreeType2
# Marcelo Magallon 2001-10-26, based on `gtk.m4` by Owen Taylor
# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
#
# Copyright (C) 2001-2022 by
# Copyright (C) 2001-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -15,32 +15,32 @@
# generated by Autoconf, under the same distribution terms as the rest of
# that program.
#
# serial 6
# serial 5
# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
# MINIMUM-VERSION is what libtool reports; the default is '7.0.1' (this is
# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
# FreeType 2.0.4).
#
# To make this code work with older autoconf versions, `AS_HELP_STRING` is
# not quoted.
#
AC_DEFUN([AC_CHECK_FT2],
[# Get the cflags and libraries from the freetype-config script
#
AC_ARG_WITH([ft-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-prefix=PREFIX],
[Prefix where FreeType is installed (optional)]),
[ft_config_prefix="$withval"],
[ft_config_prefix=""])
AC_ARG_WITH([ft-exec-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
[Exec prefix where FreeType is installed (optional)]),
[ft_config_exec_prefix="$withval"],
[ft_config_exec_prefix=""])
AC_ARG_ENABLE([freetypetest],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--disable-freetypetest],
[Do not try to compile and run a test FreeType program]),
[],

View File

@ -1,6 +1,6 @@
## FreeType specific autoconf tests
#
# Copyright (C) 2002-2022 by
# Copyright (C) 2002-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
*
* UNIX-specific configuration file (specification only).
*
* Copyright (C) 1996-2022 by
* 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,
@ -42,6 +42,16 @@
#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>

View File

@ -1,24 +1,24 @@
/****************************************************************************
*
* ftsystem.c
*
* Unix-specific FreeType low-level system interface (body).
*
* Copyright (C) 1996-2022 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.
*
*/
/***************************************************************************/
/* */
/* ftsystem.c */
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
/* 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. */
/* */
/***************************************************************************/
#include <ft2build.h>
/* we use our special ftconfig.h file, not the standard one */
#include FT_CONFIG_CONFIG_H
#include <ftconfig.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/ftsystem.h>
#include <freetype/fterrors.h>
@ -70,40 +70,29 @@
#include <errno.h>
/**************************************************************************
*
* MEMORY MANAGEMENT INTERFACE
*
*/
/*************************************************************************/
/* */
/* MEMORY MANAGEMENT INTERFACE */
/* */
/*************************************************************************/
/**************************************************************************
*
* It is not necessary to do any error checking for the
* allocation-related functions. This will be done by the higher level
* routines like ft_mem_alloc() or ft_mem_realloc().
*
*/
/**************************************************************************
*
* @Function:
* ft_alloc
*
* @Description:
* The memory allocation function.
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* size ::
* The requested size in bytes.
*
* @Return:
* The address of newly allocated block.
*/
/*************************************************************************/
/* */
/* <Function> */
/* ft_alloc */
/* */
/* <Description> */
/* The memory allocation function. */
/* */
/* <Input> */
/* memory :: A pointer to the memory object. */
/* */
/* size :: The requested size in bytes. */
/* */
/* <Return> */
/* The address of newly allocated block. */
/* */
FT_CALLBACK_DEF( void* )
ft_alloc( FT_Memory memory,
long size )
@ -114,30 +103,26 @@
}
/**************************************************************************
*
* @Function:
* ft_realloc
*
* @Description:
* The memory reallocation function.
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* cur_size ::
* The current size of the allocated memory block.
*
* new_size ::
* The newly requested size in bytes.
*
* block ::
* The current address of the block in memory.
*
* @Return:
* The address of the reallocated memory block.
*/
/*************************************************************************/
/* */
/* <Function> */
/* ft_realloc */
/* */
/* <Description> */
/* The memory reallocation function. */
/* */
/* <Input> */
/* memory :: A pointer to the memory object. */
/* */
/* cur_size :: The current size of the allocated memory block. */
/* */
/* new_size :: The newly requested size in bytes. */
/* */
/* block :: The current address of the block in memory. */
/* */
/* <Return> */
/* The address of the reallocated memory block. */
/* */
FT_CALLBACK_DEF( void* )
ft_realloc( FT_Memory memory,
long cur_size,
@ -151,21 +136,19 @@
}
/**************************************************************************
*
* @Function:
* ft_free
*
* @Description:
* The memory release function.
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* block ::
* The address of block in memory to be freed.
*/
/*************************************************************************/
/* */
/* <Function> */
/* ft_free */
/* */
/* <Description> */
/* The memory release function. */
/* */
/* <Input> */
/* memory :: A pointer to the memory object. */
/* */
/* block :: The address of block in memory to be freed. */
/* */
FT_CALLBACK_DEF( void )
ft_free( FT_Memory memory,
void* block )
@ -176,19 +159,19 @@
}
/**************************************************************************
*
* RESOURCE MANAGEMENT INTERFACE
*
*/
/*************************************************************************/
/* */
/* RESOURCE MANAGEMENT INTERFACE */
/* */
/*************************************************************************/
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
* messages during execution.
*/
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT io
@ -197,17 +180,17 @@
#define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer )
/**************************************************************************
*
* @Function:
* ft_close_stream_by_munmap
*
* @Description:
* The function to close a stream which is opened by mmap.
*
* @Input:
* stream :: A pointer to the stream object.
*/
/*************************************************************************/
/* */
/* <Function> */
/* ft_close_stream_by_munmap */
/* */
/* <Description> */
/* The function to close a stream which is opened by mmap. */
/* */
/* <Input> */
/* stream :: A pointer to the stream object. */
/* */
FT_CALLBACK_DEF( void )
ft_close_stream_by_munmap( FT_Stream stream )
{
@ -215,29 +198,29 @@
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = NULL;
stream->base = 0;
}
/**************************************************************************
*
* @Function:
* ft_close_stream_by_free
*
* @Description:
* The function to close a stream which is created by ft_alloc.
*
* @Input:
* stream :: A pointer to the stream object.
*/
/*************************************************************************/
/* */
/* <Function> */
/* ft_close_stream_by_free */
/* */
/* <Description> */
/* The function to close a stream which is created by ft_alloc. */
/* */
/* <Input> */
/* stream :: A pointer to the stream object. */
/* */
FT_CALLBACK_DEF( void )
ft_close_stream_by_free( FT_Stream stream )
{
ft_free( stream->memory, stream->descriptor.pointer );
ft_free( NULL, stream->descriptor.pointer );
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = NULL;
stream->base = 0;
}
@ -313,7 +296,8 @@
file,
0 );
if ( stream->base != MAP_FAILED )
/* on some RTOS, mmap might return 0 */
if ( (long)stream->base != -1 && stream->base != NULL )
stream->close = ft_close_stream_by_munmap;
else
{
@ -323,7 +307,7 @@
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
stream->base = (unsigned char*)ft_alloc( stream->memory, stream->size );
stream->base = (unsigned char*)ft_alloc( NULL, stream->size );
if ( !stream->base )
{
@ -364,7 +348,7 @@
stream->descriptor.pointer = stream->base;
stream->pathname.pointer = (char*)filepathname;
stream->read = NULL;
stream->read = 0;
FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
@ -373,7 +357,7 @@
return FT_Err_Ok;
Fail_Read:
ft_free( stream->memory, stream->base );
ft_free( NULL, stream->base );
Fail_Map:
close( file );
@ -408,7 +392,7 @@
memory = (FT_Memory)malloc( sizeof ( *memory ) );
if ( memory )
{
memory->user = NULL;
memory->user = 0;
memory->alloc = ft_alloc;
memory->realloc = ft_realloc;
memory->free = ft_free;

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 1996-2022 by
# 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,
@ -62,7 +62,7 @@ endif
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h
$(INSTALL_DATA) $(OBJ_BUILD)/ftoption.h \
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftoption.h
$(INSTALL_SCRIPT) -m 644 $(PLATFORM_DIR)/freetype2.m4 \
$(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \
$(DESTDIR)$(datadir)/aclocal/freetype2.m4
$(INSTALL_SCRIPT) -m 644 $(OBJ_BUILD)/freetype2.pc \
$(DESTDIR)$(libdir)/pkgconfig/freetype2.pc

View File

@ -2,7 +2,7 @@
# FreeType 2 template for Unix-specific compiler definitions
#
# Copyright (C) 1996-2022 by
# 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,
@ -14,7 +14,7 @@
CC := @CC@
COMPILER_SEP := $(SEP)
FT_LIBTOOL_DIR ?= $(PLATFORM_DIR)
FT_LIBTOOL_DIR ?= $(BUILD_DIR)
LIBTOOL := $(FT_LIBTOOL_DIR)/libtool
@ -73,7 +73,7 @@ T := -o$(space)
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
# We use our own FreeType configuration files overriding defaults.
@ -106,7 +106,9 @@ endif
# Linker flags.
#
LDFLAGS := @LDFLAGS@
LDFLAGS := @LDFLAGS@
LIB_CLOCK_GETTIME := @LIB_CLOCK_GETTIME@ # for ftbench
# export symbols
#
@ -116,15 +118,11 @@ EXPORTS_LIST := $(OBJ_DIR)/ftexport.sym
CCexe := $(CCraw_build) # used to compile `apinames' only
# Library linking.
# Library linking
#
LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \
-rpath $(libdir) -version-info $(version_info) \
$(LDFLAGS) -no-undefined \
-export-symbols $(EXPORTS_LIST)
# For the demo programs.
FT_DEMO_CFLAGS := @FT_DEMO_CFLAGS@
FT_DEMO_LDFLAGS := @FT_DEMO_LDFLAGS@
# EOF

Some files were not shown because too many files have changed in this diff Show More