diff -up motif-2.3.4/ac_find_xft.m4.fontconfig motif-2.3.4/ac_find_xft.m4 --- motif-2.3.4/ac_find_xft.m4.fontconfig 2012-10-22 16:50:38.000000000 +0200 +++ motif-2.3.4/ac_find_xft.m4 2013-01-13 05:09:31.695535906 +0100 @@ -14,7 +14,6 @@ AC_ARG_WITH(freetype_config, [ --with AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes) AC_ARG_WITH(fontconfig_includes, [ --with-fontconfig-includes=DIR Use Fontconfig includes in DIR], fontconfig_includes=$withval, fontconfig_includes=yes) AC_ARG_WITH(fontconfig_lib, [ --with-fontconfig-lib=DIR Use Fontconfig library in DIR], fontconfig_lib=$withval, fontconfig_lib=yes) -AC_ARG_WITH(fontconfig_config, [ --with-fontconfig-config=PROG Use Fontconfig configuration program PROG], fontconfig_config=$withval, fontconfig_config=yes) if test "$enable_xft" = "yes" then @@ -75,7 +74,12 @@ saved_LIBS="$LIBS" LIBS="$LIBS $freetype_lib" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" -AC_CHECK_HEADERS(freetype/freetype.h) +AC_CHECK_HEADERS([ft2build.h]) +AC_CHECK_HEADERS([freetype/freetype.h], [], [], +[#ifdef HAVE_FT2BUILD_H +# include <ft2build.h> +# endif +]) FINDXFT_HAVE_FREETYPE="no" case "$ac_cv_header_freetype_freetype_h" in @@ -168,84 +172,25 @@ yes) ;; esac -# -# Check fontconfig configuration -# -case "$fontconfig_config" in -no) - ;; -yes) - AC_CHECK_PROG(fc_config,fontconfig-config,fontconfig-config,no) - ;; -*) - fc_config="$fontconfig_config" - ;; -esac -case "$fontconfig_includes" in -no) - FONTCONFIG_CFLAGS="" - ;; -yes) - case "$fc_config" in - no) - FONTCONFIG_CFLAGS="" - ;; - *) - FONTCONFIG_CFLAGS="`$fc_config --cflags`" - ;; - esac - ;; -*) - FONTCONFIG_CFLAGS="-I$fontconfig_includes" - ;; -esac +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +if test "x$PKG_CONFIG" = "xno"; then + AC_MSG_ERROR([You need to install pkg-config]) +fi -case "$fontconfig_lib" in -no) - fontconfig_lib="" - ;; -yes) - case "$fc_config" in - no) - fontconfig_lib="" - ;; - *) - FONTCONFIG_LIBS="`$fc_config --libs`" - ;; - esac - ;; -*) - FONTCONFIG_LIBS="-L$fontconfig_lib -lfontconfig" - ;; -esac +# +# pkg-config +# +PKG_PROG_PKG_CONFIG -saved_LIBS="$LIBS" -LIBS="$LIBS $FONTCONFIG_LIBS" -saved_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS" -AC_CHECK_HEADERS(fontconfig/fontconfig.h) +# +# fontconfig +# +PKG_CHECK_MODULES(FONTCONFIG, fontconfig) -case "$ac_cv_header_fontconfig_fontconfig_h" in -no) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - ;; -yes) - AC_CHECK_FUNCS(FcInit) - case "$ac_cv_func_FcInit" in - no) - CPPFLAGS="$saved_CPPFLAGS" - LIBS="$saved_LIBS" - ;; - yes) - AC_DEFINE(HAVE_FONTCONFIG, 1, This is defined if we find the FontConfig library) - AC_SUBST(FONTCONFIG_CFLAGS) - AC_SUBST(FONTCONFIG_LIBS) - ;; - esac - ;; -esac +AC_DEFINE(HAVE_FONTCONFIG, 1, This is defined if we find the FontConfig library) +AC_SUBST(FONTCONFIG_CFLAGS) +AC_SUBST(FONTCONFIG_LIBS) dnl dnl Should this be conditionally defined ? diff -up motif-2.3.4/lib/Xm/Makefile.am.fontconfig motif-2.3.4/lib/Xm/Makefile.am --- motif-2.3.4/lib/Xm/Makefile.am.fontconfig 2013-01-13 04:25:39.258204272 +0100 +++ motif-2.3.4/lib/Xm/Makefile.am 2013-01-13 04:40:27.013882983 +0100 @@ -71,7 +71,7 @@ else PRINTS_SRC = endif -libXm_la_LIBADD = ${X_LIBS} ${X_XMU} -lXt -lXext ${LIB_XP} -lX11 ${X_EXTRA_LIBS} ${JPEG_LIBS} ${PNG_LIBS} +libXm_la_LIBADD = ${X_LIBS} ${X_XMU} -lXt -lXext ${LIB_XP} -lX11 ${X_EXTRA_LIBS} ${JPEG_LIBS} ${PNG_LIBS} ${FONTCONFIG_LIBS} noinst_HEADERS = BaseClassI.h \ BitmapsI.h \