dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) # Initialization and versioning AC_INIT(gtksourceview, 1.8.5, http://bugzilla.gnome.org/enter_bug.cgi?product=gtksourceview) AC_CONFIG_SRCDIR([gtksourceview/gtksourcebuffer.h]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS") AM_MAINTAINER_MODE # Check for programs AC_PROG_CC AC_PROG_INSTALL AM_DISABLE_STATIC AM_PROG_LIBTOOL IT_PROG_INTLTOOL([0.35.0]) # Check for headers and functions AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h]) AC_CHECK_FUNCS([memset]) # Dependencies GTK_REQUIRED_VERSION=2.8.0 GNOME_VFS_REQUIRED_VERSION=2.2.0 LIBXML_REQUIRED_VERSION=2.5.0 GNOME_PRINT_REQUIRED_VERSION=2.8.0 AC_SUBST(GTK_REQUIRED_VERSION) AC_SUBST(GNOME_VFS_REQUIRED_VERSION) AC_SUBST(LIBXML_REQUIRED_VERSION) AC_SUBST(GNOME_PRINT_REQUIRED_VERSION) # Pull glib-genmarshal & co. AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums) # Environment GNOME_COMMON_INIT if test x$MAINT = x; then GNOME_COMPILE_WARNINGS(error) DEPRECATED_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" else GNOME_COMPILE_WARNINGS(maximum) DEPRECATED_FLAGS="" fi AC_SUBST(DEPRECATED_FLAGS) PKG_CHECK_MODULES(DEP, gtk+-2.0 >= $GTK_REQUIRED_VERSION libxml-2.0 >= $LIBXML_REQUIRED_VERSION) AC_SUBST(DEP_CFLAGS) AC_SUBST(DEP_LIBS) # Check for gnomeprint support AC_ARG_ENABLE(gnomeprint, AC_HELP_STRING([--disable-gnomeprint], [disable gnomeprint support. Do this only if you are using gtksourceview in a custom application.]), [case "${enableval}" in yes) enable_gnomeprint=true ;; no) enable_gnomeprint=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-gnomeprint) ;; esac], [enable_gnomeprint=true]) dnl default msg_gnomeprint=no AM_CONDITIONAL(HAVE_GNOMEPRINT, false) if test "$enable_gnomeprint" = "true"; then PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 >= $GNOME_PRINT_REQUIRED_VERSION, [AM_CONDITIONAL(HAVE_GNOMEPRINT, true) AC_DEFINE(HAVE_GNOMEPRINT, [], [using gnomeprint]) msg_gnomeprint=yes], [AM_CONDITIONAL(HAVE_GNOMEPRINT, false)]) AC_SUBST(GNOMEPRINT_CFLAGS) AC_SUBST(GNOMEPRINT_LIBS) fi # Check for GNU regex functions AH_TEMPLATE(NATIVE_GNU_REGEX, [Define if the C library implements the GNU regular expressions API]) BUILD_GNU_REGEX=false AC_CHECK_FUNCS([re_compile_pattern re_compile_fastmap re_search re_match], [ AC_DEFINE(NATIVE_GNU_REGEX) ], [ BUILD_GNU_REGEX=true ]) AM_CONDITIONAL(BUILD_GNU_REGEX,$BUILD_GNU_REGEX) # Do we build optional tests? (they require gnome-vfs and gnomeprintui support) AC_ARG_ENABLE(build_tests,AC_HELP_STRING([--disable-build-tests], [disable building of the test programs]), [case "${enableval}" in yes) build_tests=true ;; no) build_tests=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-build-tests) ;; esac], [build_tests=true]) # disable tests if gnomeprint is not enabled if test x$msg_gnomeprint != xyes; then build_tests=false fi msg_tests=no AM_CONDITIONAL(BUILD_TESTS, false) if test x$build_tests = xtrue; then PKG_CHECK_MODULES(TESTS, libgnomeprintui-2.2 >= $GNOME_PRINT_REQUIRED_VERSION gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION, [AM_CONDITIONAL(BUILD_TESTS, true) AC_DEFINE(BUILD_TESTS, [], [build test suite]) msg_tests=yes], [AM_CONDITIONAL(BUILD_TESTS, false)]) AC_SUBST(TESTS_CFLAGS) AC_SUBST(TESTS_LIBS) fi # I18N stuff GETTEXT_PACKAGE=gtksourceview-1.0 AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) AM_GLIB_GNU_GETTEXT AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR) # gtk-doc GTK_DOC_CHECK([1.0]) # Output files AC_CONFIG_FILES([ gtksourceview-1.0.pc Makefile gtksourceview-zip po/Makefile.in gtksourceview/Makefile gtksourceview/gnu-regex/Makefile gtksourceview/language-specs/Makefile docs/Makefile docs/reference/Makefile docs/reference/version.xml tests/Makefile ]) AC_OUTPUT echo " Configuration: Source code location: ${srcdir} Compiler: ${CC} gnome-print support: $msg_gnomeprint build tests: $msg_tests "