X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=configure.ac;h=bd497e91251c5824024b4fc76e10a46f0843651c;hb=24f710b85e9001862a4a9f54859ac6ba98a04ffb;hp=3f079d89aa0ad87f7706f1fc42b242eaed315b04;hpb=d36ff4dd1ef174555c4be4228a0e684721ad37d1;p=hildon diff --git a/configure.ac b/configure.ac index 3f079d8..bd497e9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,41 +1,53 @@ -AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE(hildon-libs, 0.10.0) -AM_CONFIG_HEADER(config.h) +AC_INIT([Hildon gtk widgets], [2.2.0], [hildon@projects.maemo.org], [hildon]) +AC_CANONICAL_SYSTEM -AC_CANONICAL_HOST +AM_CONFIG_HEADER(config.h) +AC_CONFIG_SRCDIR([hildon/hildon-window.h]) +AC_CONFIG_MACRO_DIR([m4]) +AM_MAINTAINER_MODE + +# 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, 7, 18) +AM_INIT_AUTOMAKE AC_PROG_CC -AC_PROG_CPP +AM_PROG_CC_C_O +AM_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_AWK -AC_PROG_LIBTOOL AC_HEADER_STDC -PKG_CHECK_MODULES(OUTO, outo >= 0.1.1) -AC_SUBST(OUTO_CFLAGS) - -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.6.4 +GTK_VERSION=2.14.3 -PKG_CHECK_MODULES(GTK, hildon-lgpl >= 0.9.1 hildon-fm >= 0.8.6) +PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VERSION) AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_VERSION) -# ESD is needed for the hildon-note sounds. +# libcanberra is needed for the hildon-note sounds. -PKG_CHECK_MODULES(ESD, esound) -AC_SUBST(ESD_LIBS) -AC_SUBST(ESD_CFLAGS) - -# Needed to demonstrate how mime-types can be handled with gnome-vfs -PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.6 gnome-vfs-module-2.0 >= 2.6) -AC_SUBST(GNOME_VFS_CFLAGS) -AC_SUBST(GNOME_VFS_LIBS) +PKG_CHECK_MODULES(CANBERRA, libcanberra) +AC_SUBST(CANBERRA_LIBS) +AC_SUBST(CANBERRA_CFLAGS) PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6) AC_SUBST(GCONF_CFLAGS) @@ -45,74 +57,173 @@ ALL_LINGUAS="en_GB" AC_SUBST(ALL_LINGUAS) AM_GLIB_GNU_GETTEXT -################################################## -# Check for gtk-doc. -################################################## +GTK_DOC_CHECK([1.3]) -AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) +localedir=${datadir}/locale -if test "x$with_html_dir" = "x" ; then - HTML_DIR='${datadir}/gtk-doc/html' -else - HTML_DIR=$with_html_dir -fi +AC_SUBST(localedir) -AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) - -gtk_doc_min_version=0.10 -if $GTKDOC ; then - gtk_doc_version=`gtkdoc-mkdb --version` - AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version] -) - if perl <= "$gtk_doc_min_version") ? 0 : 1); -EOF - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - GTKDOC=false - fi -fi +# Disable rebuild of glib-mkenum -generated source code: +AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes) -# Let people disable the gtk-doc stuff. -AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc use gtk-doc to build documenta -tion [default=yes]], enable_gtk_doc="$enableval", enable_gtk_doc=yes) +# define a MAINT-like variable REBUILD which is set if Perl +# is found, so autogenerated sources can be rebuilt +AC_CHECK_PROGS(PERL, perl5 perl) -if test x$enable_gtk_doc = xauto ; then - if test x$GTKDOC = xtrue ; then - enable_gtk_doc=yes - else - enable_gtk_doc=no - fi +REBUILD=\# +if test "x$enable_rebuilds" = "xyes" && \ + test -n "$PERL" && \ + $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then + REBUILD= +fi +AC_SUBST(REBUILD) + +# 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 -AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) - -AC_CHECK_PROG(DOXYGEN_FOUND, doxygen, yes, no) -AM_CONDITIONAL(HAVE_DOXYGEN, [test "$DOXYGEN_FOUND" = "yes"]) +# 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) + MAEMO_GTK="-DMAEMO_GTK" + AC_SUBST(MAEMO_GTK) + MAEMO_CHANGES="-DMAEMO_CHANGES" + AC_SUBST(MAEMO_CHANGES) +else + AC_MSG_NOTICE(Will not use Maemo GTK+ specific API) +fi -localedir=${datadir}/locale -outomoduledir=${libdir}/outo +# 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 -AC_ARG_ENABLE(doc-dir, [ --with-doc-dir=PATH path to installed docs ]) -if test "x$with_doc_dir" = "x" ; then - docdir='${datadir}/doc' +# 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 - docdir=$with_doc_dir + AC_MSG_NOTICE(Will build with non-fatal warnings) + FATAL_CFLAGS="" fi -HTML_DIR=${docdir}/html +# disable deprecated symbols +AC_ARG_ENABLE(deprecated, + [AC_HELP_STRING([--enable-deprecated], + [enable use of deprecated symbols [default=yes]])],, + [enable_deprecated="yes"]) -AC_SUBST(docdir) -AC_SUBST(localedir) -AC_SUBST(outomoduledir) -AC_SUBST(HTML_DIR) - -AC_OUTPUT(Makefile \ - hildon-widgets/Makefile \ - ut/Makefile \ - po/Makefile \ - po/porules.mk \ - doc/Makefile \ - hildon-libs.pc) +if test x$enable_deprecated = xno; then + DISABLE_DEPRECATED="-DHILDON_DISABLE_DEPRECATED" +fi + +AM_CONDITIONAL([HILDON_DISABLE_DEPRECATED], test "x$enable_deprecated" = "xno") + +# 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_CFLAGS}" +# -Wno-format due to way translation string are done + +### disable deprecated symbols +EXTRA_CFLAGS="$DISABLE_DEPRECATED" +AC_SUBST(EXTRA_CFLAGS) + +### enable MAEMO platform extensions +CFLAGS="$CFLAGS $MAEMO_CHANGES $MAEMO_GTK" + +# 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)/hildon/" +HILDON_OBJ_LIBS="\$(top_builddir)/hildon/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 \ + hildon/Makefile \ + hildon/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} +- Enable deprecated..: ${enable_deprecated} +- 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} + +"