summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-12-07 05:19:01 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-12-09 15:47:48 +0100
commit8677e994d37329a28ca8278358a99d18b9cada69 (patch)
tree1c2ec14f4fc8121c03296b30933dabd63a0d6125
parent748b8ad4184130b74ae3fdd7178be2999948d64e (diff)
Simplify FONTCONFIG and FREETYPE tests
Add an additional option to libo_CHECK_SYSTEM_MODULE to select the default external lookup. Don't "if" the libo_CHECK_SYSTEM_MODULE, so the AC_SUBST are always run, but set the test_* flags instead. Change-Id: Ie0a1204b34d596fdd57a7ee770418f91bf8c5d00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126464 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--configure.ac62
-rw-r--r--m4/libo_externals.m412
2 files changed, 26 insertions, 48 deletions
diff --git a/configure.ac b/configure.ac
index ddc9c1d0500d..0cae3577a0ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1179,6 +1179,9 @@ if test "$using_freetype_fontconfig" = yes; then
AC_DEFINE(ENABLE_HEADLESS)
ENABLE_HEADLESS=TRUE
fi
+else
+ test_fontconfig=no
+ test_freetype=no
fi
AC_SUBST(ENABLE_HEADLESS)
@@ -5839,23 +5842,7 @@ fi
AC_SUBST(ENABLE_CUPS)
-# fontconfig checks
-if test "$using_freetype_fontconfig" = yes; then
- AC_MSG_CHECKING([which fontconfig to use])
-fi
-if test "$using_freetype_fontconfig" = yes -a "$test_system_fontconfig" != no; then
- AC_MSG_RESULT([external])
- PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
- SYSTEM_FONTCONFIG=TRUE
- FilterLibs "${FONTCONFIG_LIBS}"
- FONTCONFIG_LIBS="${filteredlibs}"
-elif test "$using_freetype_fontconfig" = yes; then
- AC_MSG_RESULT([internal])
- BUILD_TYPE="$BUILD_TYPE FONTCONFIG"
-fi
-AC_SUBST(FONTCONFIG_CFLAGS)
-AC_SUBST(FONTCONFIG_LIBS)
-AC_SUBST([SYSTEM_FONTCONFIG])
+libo_CHECK_SYSTEM_MODULE([fontconfig],[FONTCONFIG],[fontconfig >= 2.4.1],,,TRUE)
dnl whether to find & fetch external tarballs?
dnl ===================================================================
@@ -9456,38 +9443,25 @@ fi
dnl ===================================================================
dnl Check whether freetype is available
+dnl
+dnl FreeType has 3 different kinds of versions
+dnl * release, like 2.4.10
+dnl * libtool, like 13.0.7 (this what pkg-config returns)
+dnl * soname
+dnl FreeType's docs/VERSION.DLL provides a table mapping between the three
+dnl
+dnl 9.9.3 is 2.2.0
+dnl When the minimal version is at least 2.8.1, remove Skia's check down below.
dnl ===================================================================
-if test "$using_freetype_fontconfig" = yes; then
- AC_MSG_CHECKING([which freetype to use])
-fi
-if test "$using_freetype_fontconfig" = yes -a "$test_system_freetype" != no; then
- AC_MSG_RESULT([external])
- # FreeType has 3 different kinds of versions
- # * release, like 2.4.10
- # * libtool, like 13.0.7 (this what pkg-config returns)
- # * soname
- # FreeType's docs/VERSION.DLL provides a table mapping between the three
- #
- # 9.9.3 is 2.2.0
- # When the minimal version is at least 2.8.1, remove Skia's check down below.
- PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
- FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
- FilterLibs "${FREETYPE_LIBS}"
- FREETYPE_LIBS="${filteredlibs}"
- SYSTEM_FREETYPE=TRUE
-elif test "$using_freetype_fontconfig" = yes; then
- AC_MSG_RESULT([internal])
- FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
+if test "$test_freetype" != no; then
if test "x$ac_config_site_64bit_host" = xYES; then
- FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
+ FREETYPE_LIBS_INTERNAL="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
else
- FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
+ FREETYPE_LIBS_INTERNAL="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
fi
- BUILD_TYPE="$BUILD_TYPE FREETYPE"
fi
-AC_SUBST(FREETYPE_CFLAGS)
-AC_SUBST(FREETYPE_LIBS)
-AC_SUBST([SYSTEM_FREETYPE])
+libo_CHECK_SYSTEM_MODULE([freetype],[FREETYPE],[freetype2 >= 9.9.3],
+ ["${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"],["$FREETYPE_LIBS_INTERNAL"],TRUE)
# ===================================================================
# Check for system libxslt
diff --git a/m4/libo_externals.m4 b/m4/libo_externals.m4
index d19178ab8250..b2b314fec933 100644
--- a/m4/libo_externals.m4
+++ b/m4/libo_externals.m4
@@ -6,15 +6,19 @@ dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
+# <lowercase check>,<variable prefix>,<pkg-config query>,
+# <internal CFLAGS>,<internal LIBS>,<external (default: FALSE)>
AC_DEFUN([libo_CHECK_SYSTEM_MODULE], [
AC_ARG_WITH(system-$1,
- AS_HELP_STRING([--with-system-$1],
- [Use $1 from operating system instead of building and bundling it.]),,
- [with_system_$1="$with_system_libs"])
+ AS_HELP_STRING([m4_ifnblank([$6],[--without-system-$1],[--with-system-$1])],
+ [m4_ifnblank([$6],
+ Build and bundle the internal $1 instead of using the operating system one.,
+ Use $1 from the operating system instead of building and bundling it.)]),
+,[m4_ifnblank([$6],[with_system_$1="yes"],[with_system_$1="$with_system_libs"])])
AC_MSG_CHECKING([which $1 to use])
if test "$test_$1" != "no"; then
ENABLE_$2=TRUE
- if test "$with_system_$1" = "yes"; then
+ if test "$with_system_$1" = yes -a "$test_system_$1" != no; then
AC_MSG_RESULT([external])
SYSTEM_$2=TRUE
PKG_CHECK_MODULES([$2], [$3])