- AC_CANONICAL_HOST
-
- MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
- DSO_CFLAGS=''
- DSO_PIC_CFLAGS='-KPIC -DPIC'
-
- case "$host" in
- *solaris*)
- DSO_LDOPTS='-G -z text -z defs -h $@'
- LIBS="$LIBS -lc"
- ;;
- *irix6*)
- DSO_LDOPTS='-shared -rpath $(libdir) -set_version sgi1.0 -soname $@'
- LIBS="$LIBS -lc"
- ;;
- *osf[[123]]*)
- # since the library is using soname-style versioning, don't use
- # internal versioning, via -set_version.
- DSO_LDOPTS='-shared -rpath $(libdir) -soname $@'
- LIBS="$LIBS -lc"
+ # try using libiconv
+ fontconfig_save_libs="$LIBS"
+ LIBS="$LIBS -liconv"
+
+ AC_TRY_LINK([#include <iconv.h>],
+ [iconv_open ("from", "to");],
+ [use_iconv=1],
+ [use_iconv=0])
+
+ if test x$use_iconv = x1; then
+ ICONV_LIBS="-liconv"
+ AC_MSG_RESULT([libiconv])
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ LIBS="$fontconfig_save_libs"
+fi
+AC_SUBST(ICONV_LIBS)
+AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.])
+
+#
+# Checks for FreeType
+#
+
+AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
+
+if test "$freetype_config" = "yes"; then
+ AC_PATH_PROG(ft_config,freetype-config,no)
+ if test "$ft_config" = "no"; then
+ AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
+ fi
+else
+ ft_config="$freetype_config"
+fi
+
+FREETYPE_CFLAGS="`$ft_config --cflags`"
+FREETYPE_LIBS="`$ft_config --libs`"
+
+AC_SUBST(FREETYPE_LIBS)
+AC_SUBST(FREETYPE_CFLAGS)
+
+fontconfig_save_libs="$LIBS"
+fontconfig_save_cflags="$CFLAGS"
+LIBS="$LIBS $FREETYPE_LIBS"
+CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
+AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names FT_Get_X11_Font_Format FT_Select_Size)
+AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
+ HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
+ HAVE_FT_BITMAP_SIZE_Y_PPEM=0,
+[#include <ft2build.h>
+#include FT_FREETYPE_H])
+AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
+ [FT_Bitmap_Size structure includes y_ppem field])
+CFLAGS="$fontconfig_save_cflags"
+LIBS="$fontconfig_save_libs"
+
+#
+# Check expat configuration
+#
+
+AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes)
+AC_ARG_WITH(expat-includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes)
+AC_ARG_WITH(expat-lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes)
+
+if test "$enable_libxml2" != "yes"; then
+ case "$expat" in
+ no)