Adding the --with-examples and --with-asserts configure options (defaulting to no...
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 11 Jan 2007 10:41:27 +0000 (10:41 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 11 Jan 2007 10:41:27 +0000 (10:41 +0000)
ChangeLog
configure.ac
examples/Makefile.am

index f2696a1..13ff62a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-11  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
+       * configure.ac:
+       * examples/Makefile.am: Adding the --with-examples and --with-asserts
+       configure options (defaulting to no ; no respectively).
+
 2007-01-10  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
        * examples/Makefile.am:
index f2e945e..9f9432d 100644 (file)
@@ -20,9 +20,6 @@ AC_PROG_AWK
 
 AC_HEADER_STDC
 
-CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format"
-# -Wno-format due to way translation string are done
-
 GTK_VERSION=2.6.10
 
 PKG_CHECK_MODULES(GTK, gtk+-2.0)
@@ -85,6 +82,49 @@ HILDON_WIDGETS_OBJ_LIBS="\$(top_builddir)/src/libhildon_\$(PACKAGE_VERSION_MAJOR
 AC_SUBST(HILDON_WIDGETS_OBJ_CFLAGS)
 AC_SUBST(HILDON_WIDGETS_OBJ_LIBS)
 
+# 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
+
+# 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
+
+CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format"
+# -Wno-format due to way translation string are done
+
 
 AC_CONFIG_FILES([Makefile src/Makefile  \
                  pkgconfig/Makefile \
@@ -101,6 +141,8 @@ Configuration:
 - Compiler...........: ${CC}
 - gtk-doc support....: ${enable_gtk_doc}
 - Api................: ${PACKAGE}-${PACKAGE_VERSION_MAJOR}
+- Build examples.....: ${BUILD_EXAMPLES}
+- Build with asserts.: ${BUILD_WITH_ASSERTS}
 
 ######################################
 
index 223fdbf..2af0037 100644 (file)
@@ -1,5 +1,6 @@
 MAINTAINERCLEANFILES                   = Makefile.in
 
+if BUILD_EXAMPLES
 noinst_PROGRAMS                                = hildon-window-example         \
                                          hildon-banner-example         \
                                          hildon-caption-example        \
@@ -43,3 +44,4 @@ hildon_note_example_LDADD             = $(HILDON_WIDGETS_OBJ_LIBS)
 hildon_note_example_CFLAGS             = $(HILDON_WIDGETS_OBJ_CFLAGS)
 hildon_note_example_SOURCES            = hildon-note/hildon-note-example.c
 
+endif