common/autoconf/libraries.m4

changeset 2400
9da665f87c4b
parent 2223
01cc48ed67f3
child 2408
2e38e8d106de
     1.1 --- a/common/autoconf/libraries.m4	Tue Jan 15 10:42:40 2019 +0000
     1.2 +++ b/common/autoconf/libraries.m4	Wed Oct 25 13:11:07 2017 -0700
     1.3 @@ -57,6 +57,7 @@
     1.4      ALSA_NOT_NEEDED=yes
     1.5      PULSE_NOT_NEEDED=yes
     1.6      X11_NOT_NEEDED=yes
     1.7 +    FONTCONFIG_NOT_NEEDED=yes
     1.8      AC_MSG_RESULT([alsa cups pulse x11])
     1.9    fi
    1.10  
    1.11 @@ -65,6 +66,7 @@
    1.12      ALSA_NOT_NEEDED=yes
    1.13      PULSE_NOT_NEEDED=yes
    1.14      X11_NOT_NEEDED=yes
    1.15 +    FONTCONFIG_NOT_NEEDED=yes
    1.16      AC_MSG_RESULT([alsa pulse x11])
    1.17    fi
    1.18  
    1.19 @@ -703,6 +705,67 @@
    1.20    AC_SUBST(ALSA_LIBS)
    1.21  ])
    1.22  
    1.23 +################################################################################
    1.24 +# Setup fontconfig
    1.25 +################################################################################
    1.26 +AC_DEFUN_ONCE([LIB_SETUP_FONTCONFIG],
    1.27 +[
    1.28 +  AC_ARG_WITH(fontconfig, [AS_HELP_STRING([--with-fontconfig],
    1.29 +      [specify prefix directory for the fontconfig package
    1.30 +      (expecting the headers under PATH/include)])])
    1.31 +  AC_ARG_WITH(fontconfig-include, [AS_HELP_STRING([--with-fontconfig-include],
    1.32 +      [specify directory for the fontconfig include files])])
    1.33 +
    1.34 +  if test "x$FONTCONFIG_NOT_NEEDED" = xyes; then
    1.35 +    if (test "x${with_fontconfig}" != x && test "x${with_fontconfig}" != xno) || \
    1.36 +        (test "x${with_fontconfig_include}" != x && test "x${with_fontconfig_include}" != xno); then
    1.37 +      AC_MSG_WARN([[fontconfig not used, so --with-fontconfig[-*] is ignored]])
    1.38 +    fi
    1.39 +    FONTCONFIG_CFLAGS=
    1.40 +  else
    1.41 +    FONTCONFIG_FOUND=no
    1.42 +
    1.43 +    if test "x${with_fontconfig}" = xno || test "x${with_fontconfig_include}" = xno; then
    1.44 +      AC_MSG_ERROR([It is not possible to disable the use of fontconfig. Remove the --without-fontconfig option.])
    1.45 +    fi
    1.46 +
    1.47 +    if test "x${with_fontconfig}" != x; then
    1.48 +      AC_MSG_CHECKING([for fontconfig headers])
    1.49 +      if test -s "${with_fontconfig}/include/fontconfig/fontconfig.h"; then
    1.50 +        FONTCONFIG_CFLAGS="-I${with_fontconfig}/include"
    1.51 +        FONTCONFIG_FOUND=yes
    1.52 +        AC_MSG_RESULT([$FONTCONFIG_FOUND])
    1.53 +      else
    1.54 +        AC_MSG_ERROR([Can't find 'include/fontconfig/fontconfig.h' under ${with_fontconfig} given with the --with-fontconfig option.])
    1.55 +      fi
    1.56 +    fi
    1.57 +    if test "x${with_fontconfig_include}" != x; then
    1.58 +      AC_MSG_CHECKING([for fontconfig headers])
    1.59 +      if test -s "${with_fontconfig_include}/fontconfig/fontconfig.h"; then
    1.60 +        FONTCONFIG_CFLAGS="-I${with_fontconfig_include}"
    1.61 +        FONTCONFIG_FOUND=yes
    1.62 +        AC_MSG_RESULT([$FONTCONFIG_FOUND])
    1.63 +      else
    1.64 +        AC_MSG_ERROR([Can't find 'fontconfig/fontconfig.h' under ${with_fontconfig_include} given with the --with-fontconfig-include option.])
    1.65 +      fi
    1.66 +    fi
    1.67 +    if test "x$FONTCONFIG_FOUND" = xno; then
    1.68 +      # Are the fontconfig headers installed in the default /usr/include location?
    1.69 +      AC_CHECK_HEADERS([fontconfig/fontconfig.h], [
    1.70 +          FONTCONFIG_FOUND=yes
    1.71 +          FONTCONFIG_CFLAGS=
    1.72 +          DEFAULT_FONTCONFIG=yes
    1.73 +      ])
    1.74 +    fi
    1.75 +    if test "x$FONTCONFIG_FOUND" = xno; then
    1.76 +      HELP_MSG_MISSING_DEPENDENCY([fontconfig])
    1.77 +      AC_MSG_ERROR([Could not find fontconfig! $HELP_MSG ])
    1.78 +    fi
    1.79 +  fi
    1.80 +
    1.81 +  AC_SUBST(FONTCONFIG_CFLAGS)
    1.82 +])
    1.83 +
    1.84  AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
    1.85  [
    1.86  

mercurial