2
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation. Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
26
################################################################################
28
################################################################################
29
AC_DEFUN_ONCE([LIB_SETUP_FONTCONFIG],
31
AC_ARG_WITH(fontconfig, [AS_HELP_STRING([--with-fontconfig],
32
[specify prefix directory for the fontconfig package
33
(expecting the headers under PATH/include)])])
34
AC_ARG_WITH(fontconfig-include, [AS_HELP_STRING([--with-fontconfig-include],
35
[specify directory for the fontconfig include files])])
37
if test "x$NEEDS_LIB_FONTCONFIG" = xfalse; then
38
if (test "x${with_fontconfig}" != x && test "x${with_fontconfig}" != xno) || \
39
(test "x${with_fontconfig_include}" != x && test "x${with_fontconfig_include}" != xno); then
40
AC_MSG_WARN([[fontconfig not used, so --with-fontconfig[-*] is ignored]])
46
if test "x${with_fontconfig}" = xno || test "x${with_fontconfig_include}" = xno; then
47
AC_MSG_ERROR([It is not possible to disable the use of fontconfig. Remove the --without-fontconfig option.])
50
if test "x${with_fontconfig}" != x; then
51
AC_MSG_CHECKING([for fontconfig headers])
52
if test -s "${with_fontconfig}/include/fontconfig/fontconfig.h"; then
53
FONTCONFIG_CFLAGS="-I${with_fontconfig}/include"
55
AC_MSG_RESULT([$FONTCONFIG_FOUND])
57
AC_MSG_ERROR([Can't find 'include/fontconfig/fontconfig.h' under ${with_fontconfig} given with the --with-fontconfig option.])
60
if test "x${with_fontconfig_include}" != x; then
61
AC_MSG_CHECKING([for fontconfig headers])
62
if test -s "${with_fontconfig_include}/fontconfig/fontconfig.h"; then
63
FONTCONFIG_CFLAGS="-I${with_fontconfig_include}"
65
AC_MSG_RESULT([$FONTCONFIG_FOUND])
67
AC_MSG_ERROR([Can't find 'fontconfig/fontconfig.h' under ${with_fontconfig_include} given with the --with-fontconfig-include option.])
70
if test "x$FONTCONFIG_FOUND" = xno; then
71
# Are the fontconfig headers installed in the default /usr/include location?
72
AC_CHECK_HEADERS([fontconfig/fontconfig.h], [
75
DEFAULT_FONTCONFIG=yes
78
if test "x$FONTCONFIG_FOUND" = xno; then
79
HELP_MSG_MISSING_DEPENDENCY([fontconfig])
80
AC_MSG_ERROR([Could not find fontconfig! $HELP_MSG ])
84
AC_SUBST(FONTCONFIG_CFLAGS)