X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=configure.ac;h=d15ef09376c1fc605fc759332872b6cdad92cba7;hb=dfbe13b540375e7c4a9f3e7d863c45315afb6468;hp=53a97d504730b60729c1ef89684a9b13677f2d53;hpb=3c2090ec4f141970d9d7bf1edc4cf01fbbd7f2be;p=m17n%2Fm17n-lib.git diff --git a/configure.ac b/configure.ac index 53a97d5..d15ef09 100644 --- a/configure.ac +++ b/configure.ac @@ -244,27 +244,32 @@ LIBS="$save_LIBS" AC_SUBST(XFT2_LD_FLAGS) dnl Check for fontconfig usability. -save_CPPFLAGS="$CPPFLAGS" -save_LIBS="$LIBS" -FONTCONFIG_LD_FLAGS=-lfontconfig -if test "x$HAVE_PKG_CONFIG" = "xyes"; then - if pkg-config --exists fontconfig; then - CPPFLAGS="$CPPFLAGS `pkg-config --cflags fontconfig`" - FONTCONFIG_LD_FLAGS="`pkg-config --libs fontconfig`" - LIBS="$LIBS $FONTCONFIG_LD_FLAGS" +AC_ARG_WITH(fontconfig, + AC_HELP_STRING([--with-fontconfig], + [with FontConfig library (default is YES)])) +if test "x$with_fontconfig" != "xno"; then + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + FONTCONFIG_LD_FLAGS=-lfontconfig + if test "x$HAVE_PKG_CONFIG" = "xyes"; then + if pkg-config --exists fontconfig; then + CPPFLAGS="$CPPFLAGS `pkg-config --cflags fontconfig`" + FONTCONFIG_LD_FLAGS="`pkg-config --libs fontconfig`" + LIBS="$LIBS $FONTCONFIG_LD_FLAGS" + fi fi -fi -AC_CHECK_LIB(fontconfig, FcInit, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no) -AC_CHECK_HEADER(fontconfig/fontconfig.h, , HAVE_FONTCONFIG=no) -if test "x$HAVE_FONTCONFIG" = "xyes"; then - AC_DEFINE(HAVE_FONTCONFIG, 1, + AC_CHECK_LIB(fontconfig, FcInit, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no) + AC_CHECK_HEADER(fontconfig/fontconfig.h, , HAVE_FONTCONFIG=no) + if test "x$HAVE_FONTCONFIG" = "xyes"; then + AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if you have fontconfig library and header file.]) - M17N_EXT_LIBS="$M17N_EXT_LIBS fontconfig" -else - FONTCONFIG_LD_FLAGS= - CPPFLAGS="$save_CPPFLAGS" + M17N_EXT_LIBS="$M17N_EXT_LIBS fontconfig" + else + FONTCONFIG_LD_FLAGS= + CPPFLAGS="$save_CPPFLAGS" + fi + LIBS="$save_LIBS" fi -LIBS="$save_LIBS" AC_SUBST(FONTCONFIG_LD_FLAGS) dnl Check for gdlib usability.