1 AC_INIT([Hildon gtk widgets], [2.1.7], [hildon@projects.maemo.org], [hildon])
4 AM_CONFIG_HEADER(config.h)
5 AC_CONFIG_SRCDIR([src/hildon-window.h])
6 AC_CONFIG_MACRO_DIR([m4])
9 # define PACKAGE_VERSION_* variables
12 #define API_VERSION_MAJOR
14 AC_SUBST(API_VERSION_MAJOR)
16 # set the libtool versioning
17 # Quick guide into libtool versioning:
18 # 1. Start with version information of `0:0:0' for each libtool library.
19 # 2. Update the version information only immediately before a public release of your software.
20 # More frequent updates are unnecessary, and only guarantee that the current interface number
22 # 3. If the library source code has changed at all since the last update, then increment revision
23 # (`c:r:a' becomes `c:r+1:a').
24 # 4. If any interfaces have been added, removed, or changed since the last update,
25 # increment current, and set revision to 0.
26 # 5. If any interfaces have been added since the last public release, then increment age.
27 # 6. If any interfaces have been removed since the last public release, then set age to 0.
28 AS_LIBTOOL(HILDON, 19, 0, 0)
40 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VERSION)
45 # libcanberra is needed for the hildon-note sounds.
47 PKG_CHECK_MODULES(CANBERRA, libcanberra)
48 AC_SUBST(CANBERRA_LIBS)
49 AC_SUBST(CANBERRA_CFLAGS)
51 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6)
52 AC_SUBST(GCONF_CFLAGS)
61 localedir=${datadir}/locale
65 # Disable rebuild of glib-mkenum -generated source code:
66 AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
68 # define a MAINT-like variable REBUILD which is set if Perl
69 # is found, so autogenerated sources can be rebuilt
70 AC_CHECK_PROGS(PERL, perl5 perl)
73 if test "x$enable_rebuilds" = "xyes" && \
75 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
80 # build examples (or not)
82 AC_HELP_STRING([--with-examples], [Build the examples]),
85 yes) BUILD_EXAMPLES=yes ;;
86 no) BUILD_EXAMPLES=no ;;
87 *) AC_MSG_ERROR(bad value ${withval} for --with-examples) ;;
91 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
93 # just print out our status
94 if test x$BUILD_EXAMPLES = xyes; then
95 AC_MSG_NOTICE(Will locally build example programs)
97 AC_MSG_NOTICE(Will not build examples )
100 # use maemo gtk+ specific api (or not)
101 AC_ARG_WITH(maemo-gtk,
102 AC_HELP_STRING([--with-maemo-gtk], [Use Maemo GTK+ API]),
105 yes) USE_MAEMO_GTK=yes ;;
106 no) USE_MAEMO_GTK=no ;;
107 *) AC_MSG_ERROR(bad value ${withval} for --with-maemo-gtk) ;;
111 AM_CONDITIONAL(USE_MAEMO_GTK, test "x$USE_MAEMO_GTK" = "xyes")
113 # just print out our status
114 if test x$USE_MAEMO_GTK = xyes; then
115 AC_MSG_NOTICE(Will use Maemo GTK+ specific API)
116 AC_DEFINE(MAEMO_GTK, [], [Whether to use Maemo GTK+ specific API])
117 MAEMO_CHANGES="-DMAEMO_CHANGES"
118 AC_SUBST(MAEMO_CHANGES)
120 AC_MSG_NOTICE(Will not use Maemo GTK+ specific API)
123 # build with assertion checks (or not)
125 AC_HELP_STRING([--with-asserts], [Build with the assertion checks]),
128 yes) BUILD_WITH_ASSERTS=yes ;;
129 no) BUILD_WITH_ASSERTS=no ;;
130 *) AC_MSG_ERROR(bad value ${withval} for --with-asserts) ;;
132 [BUILD_WITH_ASSERTS=no])
134 # just print out our status
135 if test x$BUILD_WITH_ASSERTS = xyes; then
136 AC_MSG_NOTICE(Will build with assertion checks)
139 AC_MSG_NOTICE(Will not build with assertion checks)
140 ASSERT_CFLAGS="-DG_DISABLE_ASSERT"
143 # build with relaxed flags or not
145 AC_HELP_STRING([--enable-fatal], [Build with fatal warnings]),
147 case "${enableval}" in
148 yes) BUILD_WITH_FATAL=yes ;;
149 no) BUILD_WITH_FATAL=no ;;
150 *) AC_MSG_ERROR(bad value ${enableval} for --enable-fatal) ;;
152 [BUILD_WITH_FATAL=no])
154 # just print out our status
155 if test x$BUILD_WITH_FATAL = xyes; then
156 AC_MSG_NOTICE(Will build with fatal warnings)
157 FATAL_CFLAGS="-Werror"
159 AC_MSG_NOTICE(Will build with non-fatal warnings)
163 # Check support (c unit test)
164 PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"])
165 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
167 CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-format ${FATAL_FLAGS}"
168 # -Wno-format due to way translation string are done
170 ### enable MAEMO platform extensions
171 CFLAGS="$CFLAGS $MAEMO_CHANGES"
174 # default vars for the examples
175 # includes all the low-level flags
176 # FIXME Add esd and gconf flags
177 HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/src/"
178 HILDON_OBJ_LIBS="\$(top_builddir)/src/libhildon-\$(API_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS) `pkg-config --libs gthread-2.0`"
179 AC_SUBST(HILDON_OBJ_CFLAGS)
180 AC_SUBST(HILDON_OBJ_LIBS)
182 AC_CONFIG_FILES([Makefile \
184 src/hildon-version.h \
187 pkgconfig/hildon.pc \
200 - Package:...........: ${PACKAGE}
201 - Version............: ${VERSION}
202 - Api................: ${PACKAGE}-${API_VERSION_MAJOR}
203 - Compiler...........: ${CC}
204 - gtk-doc support....: ${enable_gtk_doc}
205 - Build examples.....: ${BUILD_EXAMPLES}
206 - Build with asserts.: ${BUILD_WITH_ASSERTS}
207 - Build unit tests...: ${BUILD_TESTS}
208 - Fatal warnings.....: ${BUILD_WITH_FATAL}