# This script follows # http://www.gnu.org/software/autoconf/manual/html_node/Autoconf-Input-Layout.html#Autoconf-Input-Layout # Please keep it like that. # Guessing some version. AC_PREREQ(2.54) m4_define([ccss_version_major], [0]) m4_define([ccss_version_minor], [6]) m4_define([ccss_version_micro], [0]) m4_define([ccss_version_extra], []) m4_define([ccss_version], [ccss_version_major.ccss_version_minor.ccss_version_micro[]ccss_version_extra]) m4_define([ccss_cairo_appearance_module_interface_version], [0.4]) AC_INIT([ccss], [ccss_version]) AC_CONFIG_AUX_DIR([build]) AC_CONFIG_MACRO_DIR([build]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([ccss/ccss-stylesheet.c]) AM_INIT_AUTOMAKE dnl Version info for libraries = CURRENT:REVISION:AGE dnl dnl Within each x.y.*, ABI is maintained backward and _forward_ compatible. dnl (As a consequence, no exported function may be added.) dnl So it's enough to have one interface number per each x.y.* branch. dnl dnl OTOH, we are not able to keep ABI strictly backward compatible throughout dnl the whole x.*.*. dnl The easiest way is to declare no ABI compatibility, ie. AGE is always 0. dnl m4_define([version_iface], m4_eval(100 * ccss_version_major + ccss_version_minor)) AC_SUBST([VERSION_INFO], [version_iface:ccss_version_micro:0]) AC_SUBST([CCSS_VERSION_MAJOR], [ccss_version_major]) AC_SUBST([CCSS_VERSION_MINOR], [ccss_version_minor]) AC_SUBST([CCSS_VERSION_MICRO], [ccss_version_micro]) ### Checks for configure arguments. ############################################ AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [enable debug code])], [ enable_debug="$enableval" ],[ enable_debug="no" ]) if test "$enable_debug" == "yes"; then AC_DEFINE([CCSS_DEBUG], [1], [enable debug code]) CFLAGS="-g -O0 ${CFLAGS}" fi AM_CONDITIONAL([CCSS_DEBUG], test "$enable_debug" == "yes") # So usually one just sets CFLAGS for this, but a configure # arguments lets us force this when running `make distcheck'. AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [bail on warnings])], [ if test "$enableval" == "yes"; then CFLAGS="$CFLAGS -Werror" fi ]) ### Checks for programs. ####################################################### AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET # Should be replaced by LT_INIT, which apparently doesn't work. # Try again some time. AC_DISABLE_STATIC AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL # gtk-doc gtk_doc_installed=true #ifdef([GTK_DOC_CHECK],[GTK_DOC_CHECK([1.0])],[gtk_doc_installed=false]) # I would have liked to conditionalize this, but # that appears to break other things http://bugzilla.gnome.org/show_bug.cgi?id=156399 GTK_DOC_CHECK([1.0]) AM_CONDITIONAL(GTK_DOC_INSTALLED, $gtk_doc_installed) # hardwire-enable testing enable_glibtest="yes" AM_CONDITIONAL(ENABLE_GLIB_TEST, test "$enable_glibtest" = "yes") ### Checks for libraries. ###################################################### ### ccss ### ccss_reqs='glib-2.0 libcroco-0.6' ccss_pkgs= # See http://bugzilla.gnome.org/show_bug.cgi?id=553937 . PKG_CHECK_EXISTS([ libcroco-0.6 >= 0.6.2 ], [ enable_libcroco_workaround="no" ],[ enable_libcroco_workaround="yes" ]) if test "$enable_libcroco_workaround" = "yes"; then AC_DEFINE([CCSS_ENABLE_LIBCROCO_WORKAROUND], [1], [Work around libcroco issue #553937]) fi # Unconditional requirement. ccss_pkgs=${ccss_reqs} PKG_CHECK_MODULES([CCSS], $ccss_pkgs) # AC_SUBST([CCSS_CFLAGS]) # set further down AC_SUBST([CCSS_LIBS]) AC_SUBST([CCSS_DEPS], $ccss_pkgs) ### ccss-cairo ### ccss_cairo_reqs='cairo >= 1.4' ccss_cairo_pkgs= AC_ARG_ENABLE([ccss-cairo], [AS_HELP_STRING([--disable-ccss-cairo], [disable the build of ccss-cairo.])], [ want_cairo="$enableval" ], [ want_cairo="yes" ]) if test "$want_cairo" = "yes"; then ccss_cairo_pkgs="$ccss_pkgs $ccss_cairo_reqs" AC_DEFINE([CCSS_WITH_CAIRO], [1], [Cairo drawing support]) fi AM_CONDITIONAL([CCSS_WITH_CAIRO], [test "$want_cairo" = "yes"]) AC_SUBST([ccss_with_cairo], [$want_cairo]) ### use librsvg? ccss_cairo_rsvg_reqs='librsvg-2.0 >= 2.16' AC_ARG_WITH([rsvg], [AS_HELP_STRING([--without-rsvg], [ccss-cairo: do not build SVG image support.])], [ want_rsvg="$withval" ], [ want_rsvg="yes" ]) if test "$want_rsvg" = "yes"; then ccss_cairo_pkgs="$ccss_cairo_pkgs $ccss_cairo_rsvg_reqs" AC_DEFINE([CCSS_WITH_RSVG], [1], [SVG support through librsvg]) fi AM_CONDITIONAL([CCSS_WITH_RSVG], [test "$want_rsvg" = "yes"]) AC_SUBST([ccss_with_rsvg], [$want_rsvg]) ### use libsoup? want_soup="no" if test "$want_rsvg" = "yes"; then ccss_cairo_soup_reqs='libsoup-2.4 librsvg-2.0 >= 2.22.4' AC_ARG_WITH([soup], [AS_HELP_STRING([--without-soup], [ccss-cairo: do not build SVG fragment support.])], [ want_soup="$withval" ], [ want_soup="yes" ]) fi if test "$want_soup" = "yes"; then ccss_cairo_pkgs="$ccss_cairo_pkgs $ccss_cairo_soup_reqs" AC_DEFINE([CCSS_WITH_SOUP], [1], [SVG fragment support through libsoup and librsvg-2.0 >= 2.22.4]) fi AM_CONDITIONAL([CCSS_WITH_SOUP], [test "$want_soup" = "yes"]) AC_SUBST([ccss_with_soup], [$want_soup]) ### check if test "$want_cairo" = "yes"; then PKG_CHECK_MODULES([CCSS_CAIRO], $ccss_cairo_pkgs) fi # AC_SUBST([CCSS_CAIRO_CFLAGS]) # set further down CCSS_CAIRO_LIBS="${CCSS_CAIRO_LIBS} "'$(top_builddir)/ccss/libccss-1.la' AC_SUBST([CCSS_CAIRO_LIBS]) AC_SUBST([CCSS_CAIRO_DEPS], "$ccss_cairo_pkgs ccss-1") CCSS_CAIRO_APPEARANCE_MODULE_INTERFACE_VERSION=ccss_cairo_appearance_module_interface_version AC_SUBST([CCSS_CAIRO_APPEARANCE_MODULE_INTERFACE_VERSION]) CCSS_CAIRO_APPEARANCE_MODULE_PATH="${libdir}/ccss-1/$CCSS_CAIRO_APPEARANCE_MODULE_INTERFACE_VERSION" AC_SUBST([CCSS_CAIRO_APPEARANCE_MODULE_PATH]) ### ccss-gtk ### ccss_gtk_reqs='gtk+-2.0 >= 2.10' ccss_gtk_pkgs= AC_ARG_ENABLE([ccss-gtk], [AS_HELP_STRING([--disable-ccss-gtk], [disable the build of ccss-gtk.])], [ want_gtk="$enableval" ], [ want_gtk="yes" ]) if test "$want_gtk" = "yes"; then ccss_gtk_pkgs="$ccss_cairo_pkgs $ccss_gtk_reqs" AC_DEFINE([CCSS_WITH_GTK], [1], [Gtk+ toolkit support]) fi AM_CONDITIONAL([CCSS_WITH_GTK], [test "$want_gtk" = "yes"]) AC_SUBST([ccss_with_gtk], [$want_gtk]) ### check if test "$want_gtk" = "yes"; then PKG_CHECK_MODULES([CCSS_GTK], $ccss_gtk_pkgs) fi # AC_SUBST([CCSS_GTK_CFLAGS]) # set further down CCSS_GTK_LIBS="${CCSS_GTK_LIBS} "'$(top_builddir)/ccss/libccss-1.la $(top_builddir)/ccss-cairo/libccss-cairo-1.la' AC_SUBST([CCSS_GTK_LIBS]) AC_SUBST([CCSS_GTK_DEPS], "$ccss_gtk_reqs ccss-cairo-1") ### examples ### ccss_examples_reqs='gtk+-2.0 >= 2.10 librsvg-2.0' ccss_examples_pkgs= AC_ARG_ENABLE([examples], [AS_HELP_STRING([--disable-examples], [disable the build of examples.])], [ want_examples="$enableval" ], [ want_examples="yes" ]) if test "$want_examples" = "yes"; then ccss_examples_pkgs="$ccss_cairo_pkgs $ccss_examples_reqs" AC_DEFINE([CCSS_WITH_EXAMPLES], [1], [Build examples.]) fi AM_CONDITIONAL([CCSS_WITH_EXAMPLES], [test "$want_examples" = "yes"]) AC_SUBST([ccss_with_examples], [$want_examples]) ### check if test "$want_examples" = "yes"; then PKG_CHECK_MODULES([CCSS_EXAMPLES], $ccss_examples_pkgs) fi # AC_SUBST([CCSS_EXAMPLES_CFLAGS]) # set further down AC_SUBST([CCSS_EXAMPLES_LIBS]) AC_SUBST([CCSS_EXAMPLES_DEPS], $ccss_examples_pkgs) ### Checks for header files. ################################################### AC_HEADER_STDC AC_CHECK_HEADERS([stdbool.h stddef.h stdint.h stdio.h stdlib.h string.h]) ### Checks for typedefs, structures, and compiler characteristics. ############# AC_C_CONST extra_cflags= if test "$GCC" = "yes"; then orig_cflags=${CFLAGS} for option in -std=c99 -pedantic -Wall -Wbitwise -Wcast-to-as \ -Wchar-subscripts -Wdeclaration-after-statement -Wdefault-bitfield-sign \ -Wdo-while -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes \ -Wnested-externs -Wno-pointer-sign -Wparen-string -Wpointer-arith \ -Wptr-subtraction-blows -Wreturn-void -Wsign-compare -Wstrict-prototypes \ -Wtypesign -Wwrite-strings ; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[has_option=yes],[has_option=no]) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" else extra_cflags="${extra_cflags} $option" fi AC_MSG_RESULT($has_option) unset has_option unset SAVE_CFLAGS done unset option CFLAGS=${orig_cflags} fi CCSS_CFLAGS="${CCSS_CFLAGS} ${extra_cflags}" AC_SUBST([CCSS_CFLAGS]) CCSS_CAIRO_CFLAGS="${CCSS_CAIRO_CFLAGS} ${extra_cflags}" AC_SUBST([CCSS_CAIRO_CFLAGS]) CCSS_GTK_CFLAGS="${CCSS_GTK_CFLAGS} ${extra_cflags}" AC_SUBST([CCSS_GTK_CFLAGS]) CCSS_EXAMPLES_CFLAGS="${CCSS_EXAMPLES_CFLAGS} ${extra_cflags}" AC_SUBST([CCSS_EXAMPLES_CFLAGS]) SHAVE_INIT([build]) AC_CONFIG_FILES([ Makefile build/Makefile build/shave build/shave-libtool ccss-1.pc ccss/Makefile ccss-doc/Makefile ccss-doc/version.xml ccss-tests/Makefile ccss-cairo-1.pc ccss-cairo/Makefile ccss-cairo-doc/Makefile ccss-cairo-doc/version.xml ccss-gtk-1.pc ccss-gtk/Makefile ccss-gtk-doc/Makefile ccss-gtk-doc/version.xml examples/Makefile ]) AC_OUTPUT echo " Configuration ------------- Configuration: Build debugging code $enable_debug ccss: yes Workaround for #553937 $enable_libcroco_workaround (see bugzilla.gnome.org) ccss-cairo: $want_cairo (requires $ccss_cairo_reqs) Support for SVG images $want_rsvg (requires $ccss_cairo_rsvg_reqs) Support for SVG fragments $want_soup (requires $ccss_cairo_soup_reqs) Appearance module path $CCSS_CAIRO_APPEARANCE_MODULE_PATH ccss-gtk: $want_gtk (requires $ccss_gtk_reqs) examples: $want_examples (requires $ccss_examples_reqs) "