AC_INIT(rsvg.h) dnl =========================================================================== GDK_PIXBUF_REQUIRED=1.3.7 GLIB_REQUIRED=2.0.0 LIBART_REQUIRED=2.3.10 LIBXML_REQUIRED=2.4.7 PANGOFT2_REQUIRED=1.0.0 POPT_REQUIRED=1.5 AC_SUBST(GDK_PIXBUF_REQUIRED) AC_SUBST(GLIB_REQUIRED) AC_SUBST(LIBART_REQUIRED) AC_SUBST(LIBXML_REQUIRED) AC_SUBST(PANGOFT2_REQUIRED) AC_SUBST(POPT_REQUIRED) dnl =========================================================================== LIBRSVG_MAJOR_VERSION=2 LIBRSVG_MINOR_VERSION=2 LIBRSVG_MICRO_VERSION=3 AC_SUBST(LIBRSVG_MAJOR_VERSION) AC_SUBST(LIBRSVG_MINOR_VERSION) AC_SUBST(LIBRSVG_MICRO_VERSION) LIBRSVG_VERSION=$LIBRSVG_MAJOR_VERSION.$LIBRSVG_MINOR_VERSION.$LIBRSVG_MICRO_VERSION VERSION_INFO=`expr $LIBRSVG_MAJOR_VERSION + $LIBRSVG_MINOR_VERSION`:$LIBRSVG_MICRO_VERSION:$LIBRSVG_MINOR_VERSION AC_SUBST(VERSION_INFO) dnl =========================================================================== AM_INIT_AUTOMAKE(librsvg, $LIBRSVG_VERSION) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_ISC_POSIX AC_PROG_CC AC_PROG_CPP AC_PROG_AWK AM_PROG_LIBTOOL AC_STDC_HEADERS AC_C_BIGENDIAN GNOME_REQUIRE_PKGCONFIG dnl =========================================================================== PKG_CHECK_MODULES(LIBRSVG, \ gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED \ glib-2.0 >= $GLIB_REQUIRED \ libart-2.0 >= $LIBART_REQUIRED \ libxml-2.0 >= $LIBXML_REQUIRED \ pangoft2 >= $PANGOFT2_REQUIRED) AC_SUBST(LIBRSVG_LIBS) AC_SUBST(LIBRSVG_CFLAGS) dnl =========================================================================== AC_CHECK_LIB(popt, poptParseArgvString, [POPT_LIBS="-lpopt"], AC_MSG_ERROR([popt 1.5 or newer is required to build librsvg. You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])) AC_SUBST(POPT_LIBS) dnl =========================================================================== LIBGSF_CFLAGS="" LIBGSF_LIBS="" LIBGSFPKG="" test_gsf=true AC_ARG_WITH(svgz,[ --with-svgz Use libgsf for run-time decompression],[ if test "x$withval" = "xno"; then test_gsf=false fi ]) if test "x$test_gsf" = "xtrue"; then PKG_CHECK_MODULES(LIBGSF,[libgsf-1 >= 1.6.0], test_gsf=true, test_gsf=false) fi if test "x$test_gsf" = "xtrue"; then LIBGSF_CFLAGS="$LIBGSF_CFLAGS -DHAVE_SVGZ=1" LIBGSFPKG="libgsf-1" else AC_MSG_WARN([SVGZ support disabled, as requested (Use --with-svgz to enable)]) fi AM_CONDITIONAL(WITH_LIBGSF,[test "$LIBGSFPKG" != ""]) AC_SUBST(LIBGSFPKG) AC_SUBST(LIBGSF_CFLAGS) AC_SUBST(LIBGSF_LIBS) dnl =========================================================================== dnl Turn on the additional warnings last, so -Werror doesn't affect other tests. AC_ARG_ENABLE(more-warnings, [ --enable-more-warnings Maximum compiler warnings], set_more_warnings="$enableval",[ if test -f $srcdir/CVSVERSION; then is_cvs_version=true set_more_warnings=yes else set_more_warnings=no fi ]) AC_MSG_CHECKING(for more warnings, including -Werror) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then AC_MSG_RESULT(yes) CFLAGS="\ -Wall \ -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ -Wnested-externs -Wpointer-arith \ -Wcast-align -Wsign-compare \ -Werror \ $CFLAGS" for option in -Wsign-promo -Wno-sign-compare; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$option $CFLAGS" AC_MSG_CHECKING([whether gcc understands $option]) AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" fi AC_MSG_RESULT($has_option) unset has_option unset SAVE_CFLAGS done unset option else AC_MSG_RESULT(no) fi AC_ARG_ENABLE(gtk-theme, [ --enable-gtk-theme Enable a RSVG based GTK+ theme engine [default=auto]],, enable_gtk_theme=yes) if test "x$enable_gtk_theme" = "xyes"; then AC_MSG_CHECKING([for gtk+ engine support]) PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 1.3.12, enable_gtk_theme=yes, enable_gtk_theme=no) AC_MSG_RESULT([$enable_gtk_theme]) GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0` AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GTK_VERSION) fi AM_CONDITIONAL(ENABLE_GTK_ENGINE, test "x$enable_gtk_theme" = "xyes") AC_PATH_PROG(QUERYLOADERS, gdk-pixbuf-query-loaders, true) AC_ARG_ENABLE(pixbuf-loader, [ --enable-pixbuf-loader Enable a RSVG based GdkPixbuf loader [default=auto]], enable_pixbuf_loader="$enableval", enable_pixbuf_loader=auto) if test "x$enable_pixbuf_loader" = xauto ; then if test x$QUERYLOADERS != x ; then enable_pixbuf_loader=yes else enable_pixbuf_loader=no fi fi AM_CONDITIONAL(ENABLE_PIXBUF_LOADER, test x$enable_pixbuf_loader = xyes) ################################################## # Checks for gtk-doc and docbook-tools ################################################## AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) if test "x$with_html_dir" = "x" ; then HTML_DIR='${datadir}/doc/librsvg/html' else HTML_DIR=$with_html_dir fi AC_SUBST(HTML_DIR) AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) gtk_doc_min_version=0.9 if $GTKDOC ; then gtk_doc_version=`gtkdoc-mkdb --version` AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version]) IFS="${IFS= }"; gtk_save_IFS="$IFS"; IFS="." set $gtk_doc_version for min in $gtk_doc_min_version ; do cur=$1; shift if test -z $min ; then break; fi if test -z $cur ; then GTKDOC=false; break; fi if test $cur -gt $min ; then break ; fi if test $cur -lt $min ; then GTKDOC=false; break ; fi done IFS="$gtk_save_IFS" if $GTKDOC ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi AC_CHECK_PROG(DB2HTML, db2html, true, false) AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) dnl Make people enable the gtk-doc stuff explicitely. AC_ARG_ENABLE(gtk-doc, [ --disable-gtk-doc use gtk-doc to build documentation [default=yes]], enable_gtk_doc="$enableval", enable_gtk_doc=yes) if test x$enable_gtk_doc = xyes ; then if test x$GTKDOC != xtrue ; then enable_gtk_doc=no fi fi dnl NOTE: We need to use a separate automake conditional for this dnl to make this work with the tarballs. AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) dnl =========================================================================== AC_OUTPUT([ librsvg.spec librsvg-features.h Makefile librsvg-2.0.pc doc/Makefile gtk-engine/Makefile gtk-engine/examples/Makefile gtk-engine/examples/bubble/Makefile gtk-engine/examples/bubble/gtk-2.0/Makefile gdk-pixbuf-loader/Makefile ])