]> git.wh0rd.org - fontconfig.git/blobdiff - configure.in
switch // comment
[fontconfig.git] / configure.in
index 6b94f5eaa5735ec5bafab6cbcd7e561a0ee9491d..f3295bf255024c7e992348d1e88c4fb656bf88dd 100644 (file)
@@ -23,32 +23,28 @@ dnl  PERFORMANCE OF THIS SOFTWARE.
 dnl
 dnl Process this file with autoconf to create configure.
 
+AC_INIT(fonts.dtd)
+
 dnl ==========================================================================
 dnl                               Versioning              
 dnl ==========================================================================
 
-dnl The version number is also in fontconfig/fontconfig.h
-AC_INIT(ChangeLog,1.0.3,fontconfig@fontconfig.org)
-
-FONTCONFIG_HEADER=fontconfig/fontconfig.h
-FONTCONFIG_MAJOR=`awk '/^#define FC_MAJOR/ { print $3 }' $FONTCONFIG_HEADER`
-FONTCONFIG_MINOR=`awk '/^#define FC_MINOR/ { print $3 }' $FONTCONFIG_HEADER`
-FONTCONFIG_REVISION=`awk '/^#define FC_REVISION/ { print $3 }' $FONTCONFIG_HEADER`
-FONTCONFIG_VERSION="$FONTCONFIG_MAJOR.$FONTCONFIG_MINOR.$FONTCONFIG_REVISION"
-
-AC_SUBST(FONTCONFIG_MAJOR)
-AC_SUBST(FONTCONFIG_MINOR)
-AC_SUBST(FONTCONFIG_REVISION)
-AC_SUBST(FONTCONFIG_VERSION)
+dnl This is the package version number, not the shared library
+dnl version.  This same version number must appear in fontconfig/fontconfig.h
+dnl Yes, it is a pain to synchronize version numbers.  Unfortunately, it's
+dnl not possible to extract the version number here from fontconfig.h
+AM_INIT_AUTOMAKE(fontconfig, 2.1.92)
 
 dnl libtool versioning
 
-LT_VERSION_NUMBER="$FONTCONFIG_MAJOR:$FONTCONFIG_MINOR:$FONTCONFIG_REVISION"
-AC_SUBST(LT_VERSION_NUMBER)
+LT_CURRENT=1
+LT_REVISION=4
+LT_AGE=0
 
-dnl ==========================================================================
+LT_VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
+AC_SUBST(LT_VERSION_INFO)
 
-AM_INIT_AUTOMAKE(fontconfig, $FONTCONFIG_VERSION)
+dnl ==========================================================================
 
 AM_CONFIG_HEADER(config.h)
 
@@ -75,7 +71,7 @@ AC_CHECK_FUNCS([memmove memset strchr strrchr strtol getopt getopt_long])
 # Checks for FreeType
 #
 
-AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
+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)
@@ -106,8 +102,8 @@ LIBS=$fontconfig_save_libs
 #
 
 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)
+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)
 
 case "$expat" in
 no)
@@ -201,7 +197,7 @@ esac
 # Set default font directory
 #
 
-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(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)
@@ -219,42 +215,56 @@ esac
 AC_SUBST(FC_DEFAULT_FONTS)
 
 #
-# Add X fonts if available
+# 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(x_fonts,           [  --with-x-fonts=DIR            Find X fonts in DIR ], x_fonts="$withval", x_fonts=yes)
+AC_ARG_WITH(add-fonts,        [  --with-add-fonts=DIR1,DIR2,...Find additional fonts in DIR1,DIR2,... ], add_fonts="$withval", add_fonts=yes)
 
-case "$x_fonts" in
+case "$add_fonts" in
 yes)
-       FC_X_FONTS=""
-       for dir in /usr/X11R6/lib /usr/X11/lib /usr/lib/X11; do
-               case x"$FC_X_FONTS" in
+       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
-                               FC_X_FONTS="$dir/fonts"
+                               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_X_FONTS,"$x_fonts",[X font directory])
+       AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])
        ;;
 no)
-       FC_X_FONTS=""
+       FC_ADD_FONTS=""
        ;;
 *)
-       FC_X_FONTS="$x_fonts"
-       AC_DEFINE_UNQUOTED(FC_X_FONTS,"$x_fonts",[X font directory])
+       FC_ADD_FONTS="$add_fonts"
+       AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])
        ;;
 esac
 
-AC_SUBST(FC_X_FONTS)
+AC_SUBST(FC_ADD_FONTS)
 
 FC_FONTPATH=""
 
-case "$FC_X_FONTS" in
+case "$FC_ADD_FONTS" in
 "")
        ;;
 *)
-       FC_FONTPATH="<dir>$FC_X_FONTS</dir>"
+       FC_FONTPATH=`echo $FC_ADD_FONTS | 
+                       sed -e 's/^/<dir>/' -e 's/$/<\/dir>/' -e 's/,/<\/dir> <dir>/g'`
        ;;
 esac
 
@@ -272,13 +282,13 @@ AC_ARG_WITH(confdir,           [  --with-confdir=DIR            Use DIR to store
 
 case "$confdir" in
 no|yes)
-       confdir=/etc/fonts
+       confdir='${sysconfdir}'/fonts
        ;;
 *)
        ;;
 esac
 AC_SUBST(confdir)
-CONFDIR='${confdir}'
+CONFDIR=${confdir}
 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR",[Font configuration directory])
 AC_SUBST(CONFDIR)
 
@@ -295,7 +305,7 @@ AC_SUBST(ORTH_FILES)
 
 AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
 
-AC_ARG_ENABLE(docs,           [  --disable-docs               Don't build and install documentation],,enable_docs=yes)
+AC_ARG_ENABLE(docs,           [  --disable-docs                Don't build and install documentation],,enable_docs=yes)
 
 if test "x$enable_docs" = xyes; then
   if test "x$HASDOCBOOK" != xyes; then
@@ -309,7 +319,7 @@ AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = xyes)
 # Figure out where to install documentation
 #
 
-AC_ARG_WITH(docdir,           [  --with-docdir=DIR            Use DIR to store documentation files (default ${datadir}/doc/fontconfig)], confdir="$withval")
+AC_ARG_WITH(docdir,           [  --with-docdir=DIR             Use DIR to store documentation files (default ${datadir}/doc/fontconfig)], confdir="$withval")
 
 if test "x$with_docdir" = "x" ; then
   DOCDIR='${datadir}/doc/fontconfig'
@@ -327,6 +337,7 @@ src/Makefile
 fc-cache/Makefile
 fc-list/Makefile
 doc/Makefile
+doc/version.sgml
 test/Makefile
 fontconfig.spec
 fontconfig.pc