-AC_INIT([Hildon gtk widgets], [0.14.8], [michael.kostrzewa@nokia.com], [hildon-widgets])
+AC_INIT([Hildon gtk widgets], [2.1.2], [karl.lattimer@nokia.com], [hildon])
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
-dnl set the libtool versioning
-AS_LIBTOOL(HILDON_WIDGETS, 0, 0, 0)
+# define PACKAGE_VERSION_* variables
+AS_VERSION
+
+#define API_VERSION_MAJOR
+API_VERSION_MAJOR=1
+AC_SUBST(API_VERSION_MAJOR)
+
+# set the libtool versioning
+# Quick guide into libtool versioning:
+# 1. Start with version information of `0:0:0' for each libtool library.
+# 2. Update the version information only immediately before a public release of your software.
+# More frequent updates are unnecessary, and only guarantee that the current interface number
+# gets larger faster.
+# 3. If the library source code has changed at all since the last update, then increment revision
+# (`c:r:a' becomes `c:r+1:a').
+# 4. If any interfaces have been added, removed, or changed since the last update,
+# increment current, and set revision to 0.
+# 5. If any interfaces have been added since the last public release, then increment age.
+# 6. If any interfaces have been removed since the last public release, then set age to 0.
+AS_LIBTOOL(HILDON, 18, 1, 18)
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_HEADER_STDC
-CFLAGS="$CFLAGS -std=c99 -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations"
-# -Werror disabled due to the flaw in glib-2.0
-# See http://bugzilla.gnome.org/show_bug.cgi?id=310175 and
-# http://bugzilla.gnome.org/show_bug.cgi?id=310216
+GTK_VERSION=2.10
-GTK_VERSION=2.6.10
-
-PKG_CHECK_MODULES(GTK, gtk+-2.0)
+PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_VERSION)
AC_SUBST(GCONF_CFLAGS)
AC_SUBST(GCONF_LIBS)
-PKG_CHECK_MODULES(LIBMB, libmb >= 1.3)
-AC_SUBST(LIBMB_CFLAGS)
-AC_SUBST(LIBMB_LIBS)
-
ALL_LINGUAS="en_GB"
AC_SUBST(ALL_LINGUAS)
AM_GLIB_GNU_GETTEXT
-##################################################
-# Check for gtk-doc.
-##################################################
-#ifdef(GTK_DOC_CHECK, GTK_DOC_CHECK([1.0]))
-#GTK_DOC_CHECK([1.0])
-
-#AC_CHECK_PROG(DOXYGEN_FOUND, doxygen, yes, no)
-#AM_CONDITIONAL(HAVE_DOXYGEN, [test "$DOXYGEN_FOUND" = "yes"])
+GTK_DOC_CHECK([1.3])
localedir=${datadir}/locale
fi
AC_SUBST(REBUILD)
-AC_CONFIG_FILES([Makefile src/Makefile \
- po/Makefile po/porules.mk \
- pkgconfig/Makefile])
+# build examples (or not)
+AC_ARG_WITH(examples,
+ AC_HELP_STRING([--with-examples], [Build the examples]),
+ [
+ case "${withval}" in
+ yes) BUILD_EXAMPLES=yes ;;
+ no) BUILD_EXAMPLES=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-examples) ;;
+ esac],
+ [BUILD_EXAMPLES=no])
+
+AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
+
+# just print out our status
+if test x$BUILD_EXAMPLES = xyes; then
+ AC_MSG_NOTICE(Will locally build example programs)
+else
+ AC_MSG_NOTICE(Will not build examples )
+fi
+
+# use maemo gtk+ specific api (or not)
+AC_ARG_WITH(maemo-gtk,
+ AC_HELP_STRING([--with-maemo-gtk], [Use Maemo GTK+ API]),
+ [
+ case "${withval}" in
+ yes) USE_MAEMO_GTK=yes ;;
+ no) USE_MAEMO_GTK=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-maemo-gtk) ;;
+ esac],
+ [USE_MAEMO_GTK=yes])
+
+AM_CONDITIONAL(USE_MAEMO_GTK, test "x$USE_MAEMO_GTK" = "xyes")
+
+# just print out our status
+if test x$USE_MAEMO_GTK = xyes; then
+ AC_MSG_NOTICE(Will use Maemo GTK+ specific API)
+ AC_DEFINE(MAEMO_GTK, [], [Whether to use Maemo GTK+ specific API])
+ MAEMO_CHANGES="-DMAEMO_CHANGES"
+ AC_SUBST(MAEMO_CHANGES)
+else
+ AC_MSG_NOTICE(Will not use Maemo GTK+ specific API)
+fi
+
+# build with assertion checks (or not)
+AC_ARG_WITH(asserts,
+ AC_HELP_STRING([--with-asserts], [Build with the assertion checks]),
+ [
+ case "${withval}" in
+ yes) BUILD_WITH_ASSERTS=yes ;;
+ no) BUILD_WITH_ASSERTS=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-asserts) ;;
+ esac],
+ [BUILD_WITH_ASSERTS=no])
+
+# just print out our status
+if test x$BUILD_WITH_ASSERTS = xyes; then
+ AC_MSG_NOTICE(Will build with assertion checks)
+ ASSERT_CFLAGS=""
+else
+ AC_MSG_NOTICE(Will not build with assertion checks)
+ ASSERT_CFLAGS="-DG_DISABLE_ASSERT"
+fi
+
+# build with relaxed flags or not
+AC_ARG_ENABLE(fatal,
+ AC_HELP_STRING([--enable-fatal], [Build with fatal warnings]),
+ [
+ case "${enableval}" in
+ yes) BUILD_WITH_FATAL=yes ;;
+ no) BUILD_WITH_FATAL=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-fatal) ;;
+ esac],
+ [BUILD_WITH_FATAL=no])
+
+# just print out our status
+if test x$BUILD_WITH_FATAL = xyes; then
+ AC_MSG_NOTICE(Will build with fatal warnings)
+ FATAL_CFLAGS="-Werror"
+else
+ AC_MSG_NOTICE(Will build with non-fatal warnings)
+ FATAL_CFLAGS=""
+fi
+
+# Check support (c unit test)
+PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"])
+AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
+
+CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-format ${FATAL_FLAGS}"
+# -Wno-format due to way translation string are done
+
+### enable MAEMO platform extensions
+CFLAGS="$CFLAGS $MAEMO_CHANGES"
+
+# HILDON_OBJ_*
+# default vars for the examples
+# includes all the low-level flags
+# FIXME Add esd and gconf flags
+HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/src/"
+HILDON_OBJ_LIBS="\$(top_builddir)/src/libhildon-\$(API_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS) `pkg-config --libs gthread-2.0`"
+AC_SUBST(HILDON_OBJ_CFLAGS)
+AC_SUBST(HILDON_OBJ_LIBS)
+
+AC_CONFIG_FILES([Makefile \
+ src/Makefile \
+ src/hildon-version.h \
+ pkgconfig/Makefile \
+ examples/Makefile \
+ pkgconfig/hildon.pc \
+ tests/Makefile \
+ doc/Makefile \
+ po/POTFILES \
+ po/porules.mk \
+ po/Makefile])
AC_OUTPUT
echo "
-######################################
+
Configuration:
+- Package:...........: ${PACKAGE}
- Version............: ${VERSION}
+- Api................: ${PACKAGE}-${API_VERSION_MAJOR}
- Compiler...........: ${CC}
- gtk-doc support....: ${enable_gtk_doc}
+- Build examples.....: ${BUILD_EXAMPLES}
+- Build with asserts.: ${BUILD_WITH_ASSERTS}
+- Build unit tests...: ${BUILD_TESTS}
+- Fatal warnings.....: ${BUILD_WITH_FATAL}
-######################################
"