+ AC_MSG_ERROR([Cannot find usable expat library. This could mean that your version is too old.])
+ ;;
+esac
+
+#
+# Set default font directory
+#
+
+AC_ARG_WITH(default-fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], default_fonts="$withval", default_fonts=yes)
+
+case "$default_fonts" in
+yes)
+ if test "$os_win32" = "yes"; then
+ FC_DEFAULT_FONTS="WINDOWSFONTDIR"
+ AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "WINDOWSFONTDIR",
+ [Windows font directory])
+ else
+ FC_DEFAULT_FONTS="/usr/share/fonts"
+ AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts",
+ [System font directory])
+ fi
+ ;;
+*)
+ FC_DEFAULT_FONTS="$default_fonts"
+ AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts",
+ [System font directory])
+ ;;
+esac
+
+AC_SUBST(FC_DEFAULT_FONTS)
+
+#
+# Add more fonts if available. By default, add only the directories
+# with outline fonts; those with bitmaps can be added as desired in
+# local.conf or ~/.fonts.conf
+#
+AC_ARG_WITH(add-fonts, [ --with-add-fonts=DIR1,DIR2,...Find additional fonts in DIR1,DIR2,... ], add_fonts="$withval", add_fonts=yes)
+
+case "$add_fonts" in
+yes)
+ FC_ADD_FONTS=""
+ for dir in /usr/X11R6/lib/X11 /usr/X11/lib/X11 /usr/lib/X11; do
+ case x"$FC_ADD_FONTS" in
+ x)
+ if test -d "$dir/fonts"; then
+ for sub in "$dir"/fonts/*; do
+ if ls "$sub" | grep -q -i '\.pf\|\.tt\|\.ot'; then
+ case x$FC_ADD_FONTS in
+ x)
+ FC_ADD_FONTS="$sub"
+ ;;
+ *)
+ FC_ADD_FONTS="$FC_ADD_FONTS,$sub"
+ ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done
+ AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])
+ ;;
+no)
+ FC_ADD_FONTS=""
+ ;;
+*)
+ FC_ADD_FONTS="$add_fonts"
+ AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])