+# 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