dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.5) AC_INIT(src/cr-input.c) PACKAGE=libcroco LIBCROCO_MAJOR_VERSION=0 LIBCROCO_MINOR_VERSION=1 LIBCROCO_MICRO_VERSION=0 LIBCROCO_VERSION=$LIBCROCO_MAJOR_VERSION.$LIBCROCO_MINOR_VERSION.$LIBCROCO_MICRO_VERSION LIBCROCO_VERSION_INFO=$LIBCROCO_MAJOR_VERSION:$LIBCROCO_MINOR_VERSION:$LIBCROCO_MICRO_VERSION LIBCROCO_VERSION_NUMBER=`expr "$LIBCROCO_MAJOR_VERSION \* 10000 +$LIBCROCO_MINOR_VERSION \* 100 + $LIBCROCO_MICRO_VERSION"` VERSION=$LIBCROCO_VERSION AC_SUBST(LIBCROCO_MAJOR_VERSION) AC_SUBST(LIBCROCO_MINOR_VERSION) AC_SUBST(LIBCROCO_MICRO_VERSION) AC_SUBST(LIBCROCO_VERSION) AC_SUBST(LIBCROCO_VERSION_INFO) AC_SUBST(LIBCROCO_VERSION_NUMBER) AC_SUBST(VERSION) AM_INIT_AUTOMAKE($PACKAGE, $LIBCROCO_VERSION) AM_CONFIG_HEADER(libcroco-config.h) AM_MAINTAINER_MODE dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_CPP dnl Make sure we have an ANSI compiler AM_C_PROTOTYPES test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) dnl Checks for libraries. dnl Checks for header files. AC_STDC_HEADERS AC_ISC_POSIX AM_PROG_LIBTOOL dnl ************************************************************** dnl check for the different --enable-option=val dnl messages issued by the user dnl *************************************************************** AC_ARG_ENABLE(checks, AC_HELP_STRING([--enable-checks=yes|no], [enables runtime safety checks. Default=yes]), WITH_CHECKS=$enableval, WITH_CHECKS="yes") if test "$WITH_CHECKS" = "no" ; then AC_DEFINE(G_DISABLE_CHECKS, 1, [disable runtime asserts]) fi dnl ************************************************ dnl end of check of the different --enable-feature options dnl ************************************************* dnl dnl Find pkg-config dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG = xno ; then AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/]) fi dnl check libxml2 version have_libxml2=no PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= 2.5.1], [have_libxml2=yes AC_DEFINE(HAVE_LIBXML2, 1, [use libxml2])], have_libxml2=no) dnl --enable-test dnl this option enables compilation of the unit tests built in to .c files dnl and also some stuff in the test/ subdir WITH_TESTS=no AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test=yes|no|auto], [Enables unit test code, Default=no]), WITH_TESTS=$enableval, WITH_TESTS="no") if test "$WITH_TESTS" != no ; then if test "$have_libxml2" != no; then AC_DEFINE(WITH_TESTS, 1, [enable the unit tests]) else WITH_TESTS=no fi fi AC_SUBST(WITH_TESTS) AM_CONDITIONAL(HAVE_TESTS, test $WITH_TESTS != no) dnl --enable-seleng dnl this option enables compilation of the selection engine WITH_SELENG=no AC_ARG_ENABLE(seleng, AC_HELP_STRING([--enable-seleng=yes|no|auto], [Enables the css2 selector engine based on libxml2. Default=auto]), WITH_SELENG=$enableval, WITH_SELENG="auto") if test "$WITH_SELENG" != no ; then if test "$have_libxml2" != no; then AC_DEFINE(WITH_SELENG, 1, [use css2 selection engine]) else WITH_SELENG=no fi fi AC_SUBST(WITH_SELENG) AM_CONDITIONAL(HAVE_SELENG, test $WITH_SELENG != no) dnl By default compile in debug mode CFLAGS="-g -Wunused -Wimplicit -Wreturn-type -Wswitch \ -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts \ -Wparentheses -Wpointer-arith -Wcast-align \ -Wwrite-strings -Waggregate-return -Wstrict-prototypes \ -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls " #-pedantic -Wshadow -0 -Wuninitialized CROCO_LIBS="-L${libdir} -lcroco `pkg-config --libs glib-2.0`" CROCO_CFLAGS="-I${includedir}/libcroco `pkg-config --cflags glib-2.0`" if test "$USE_LIBXML2" = "yes" ; then LIBXML2_LIBS=`pkg-config --libs libxml-2.0` CROCO_LIBS="$CROCO_LIBS $LIBXML2_LIBS" LIBXML2_CFLAGS=`pkg-config --cflags libxml-2.0` CROCO_CFLAGS="$CROCO_CFLAGS $LIBXML2_CFLAGS" REQUIRE_LIBXML2=libxml-2.0 else REQUIRE_LIBXML2= fi AC_SUBST(LIBXML2_LIBS) AC_SUBST(LIBXML2_CFLAGS) AC_SUBST(REQUIRE_LIBXML2) AC_SUBST(CROCO_CFLAGS) AC_SUBST(CROCO_LIBS) AC_SUBST(LDFLAGS) AC_SUBST(CFLAGS) AC_PROG_MAKE_SET AC_OUTPUT([ Makefile libcroco.pc croco-config src/Makefile tests/Makefile ]) dnl ============================================================================================= echo " ========================================================= LIBCROCO, GNOME CSS2 PARSING TOOLKIT $VERSION ========================================================= prefix: : ${prefix} source code location: : ${srcdir} compiler: : ${CC} cflags: : ${CFLAGS} Maintainer mode: : ${USE_MAINTAINER_MODE} Building unit tests: : ${WITH_TESTS} Building with selection engine: : ${WITH_SELENG} "