[1.99.1-1 release]
[hildon] / configure.ac
1 AC_INIT([Hildon gtk widgets], [1.99.1], [michael.kostrzewa@nokia.com], [hildon])
2 AC_CANONICAL_SYSTEM
3
4 AM_CONFIG_HEADER(config.h)
5 AC_CONFIG_SRCDIR([src/hildon-window.h])
6 AC_CONFIG_MACRO_DIR([m4])
7 AM_MAINTAINER_MODE
8
9 # define PACKAGE_VERSION_* variables
10 AS_VERSION
11
12 # set the libtool versioning
13 # Quick guide into libtool versioning:
14 # 1. Start with version information of `0:0:0' for each libtool library.
15 # 2. Update the version information only immediately before a public release of your software. 
16 #    More frequent updates are unnecessary, and only guarantee that the current interface number 
17 #    gets larger faster.
18 # 3. If the library source code has changed at all since the last update, then increment revision 
19 #    (`c:r:a' becomes `c:r+1:a').
20 # 4. If any interfaces have been added, removed, or changed since the last update, 
21 #    increment current, and set revision to 0.
22 # 5. If any interfaces have been added since the last public release, then increment age.
23 # 6. If any interfaces have been removed since the last public release, then set age to 0.  
24 AS_LIBTOOL(HILDON, 18, 0, 18)
25 AM_INIT_AUTOMAKE
26
27 AC_PROG_CC
28 AM_PROG_LIBTOOL
29 AC_PROG_INSTALL
30 AC_PROG_AWK
31
32 AC_HEADER_STDC
33
34 GTK_VERSION=2.10
35
36 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
37 AC_SUBST(GTK_LIBS)
38 AC_SUBST(GTK_CFLAGS)
39 AC_SUBST(GTK_VERSION)
40
41 # ESD is needed for the hildon-note sounds.
42
43 PKG_CHECK_MODULES(ESD, esound)
44 AC_SUBST(ESD_LIBS)
45 AC_SUBST(ESD_CFLAGS)
46
47 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6)
48 AC_SUBST(GCONF_CFLAGS)
49 AC_SUBST(GCONF_LIBS)
50
51 ALL_LINGUAS="en_GB"
52 AC_SUBST(ALL_LINGUAS) 
53 AM_GLIB_GNU_GETTEXT
54
55 GTK_DOC_CHECK([1.3])
56
57 localedir=${datadir}/locale
58
59 AC_SUBST(localedir)
60
61 # Disable rebuild of glib-mkenum -generated source code:
62 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
63
64 # define a MAINT-like variable REBUILD which is set if Perl
65 # is found, so autogenerated sources can be rebuilt
66 AC_CHECK_PROGS(PERL, perl5 perl)
67
68 REBUILD=\#
69 if test "x$enable_rebuilds" = "xyes" && \
70      test -n "$PERL" && \
71      $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
72   REBUILD=
73 fi
74 AC_SUBST(REBUILD)
75
76 # build examples (or not)
77 AC_ARG_WITH(examples, 
78     AC_HELP_STRING([--with-examples], [Build the examples]),
79     [
80      case "${withval}" in
81          yes) BUILD_EXAMPLES=yes ;;
82          no)  BUILD_EXAMPLES=no ;;
83          *)   AC_MSG_ERROR(bad value ${withval} for --with-examples) ;;
84      esac],
85      [BUILD_EXAMPLES=no])
86
87 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
88
89 # just print out our status
90 if test x$BUILD_EXAMPLES = xyes; then
91     AC_MSG_NOTICE(Will locally build example programs)
92 else
93     AC_MSG_NOTICE(Will not build examples )
94 fi
95
96 # use maemo gtk+ specific api (or not)
97 AC_ARG_WITH(maemo-gtk, 
98     AC_HELP_STRING([--with-maemo-gtk], [Use Maemo GTK+ API]),
99     [
100      case "${withval}" in
101          yes) USE_MAEMO_GTK=yes ;;
102          no)  USE_MAEMO_GTK=no ;;
103          *)   AC_MSG_ERROR(bad value ${withval} for --with-maemo-gtk) ;;
104      esac],
105      [USE_MAEMO_GTK=yes])
106
107 AM_CONDITIONAL(USE_MAEMO_GTK, test "x$USE_MAEMO_GTK" = "xyes")
108
109 # just print out our status
110 if test x$USE_MAEMO_GTK = xyes; then
111     AC_MSG_NOTICE(Will use Maemo GTK+ specific API)
112     AC_DEFINE(MAEMO_GTK, [], [Whether to use Maemo GTK+ specific API])
113     MAEMO_CHANGES="-DMAEMO_CHANGES"
114     AC_SUBST(MAEMO_CHANGES)
115 else
116     AC_MSG_NOTICE(Will not use Maemo GTK+ specific API)
117 fi
118
119 # build with assertion checks (or not)
120 AC_ARG_WITH(asserts, 
121     AC_HELP_STRING([--with-asserts], [Build with the assertion checks]),
122     [
123      case "${withval}" in
124          yes) BUILD_WITH_ASSERTS=yes ;;
125          no)  BUILD_WITH_ASSERTS=no ;;
126          *)   AC_MSG_ERROR(bad value ${withval} for --with-asserts) ;;
127      esac],
128      [BUILD_WITH_ASSERTS=no])
129
130 # just print out our status
131 if test x$BUILD_WITH_ASSERTS = xyes; then
132     AC_MSG_NOTICE(Will build with assertion checks)
133     ASSERT_CFLAGS=""
134 else
135     AC_MSG_NOTICE(Will not build with assertion checks)
136     ASSERT_CFLAGS="-DG_DISABLE_ASSERT"
137 fi
138
139 # build with relaxed flags or not
140 AC_ARG_ENABLE(fatal, 
141     AC_HELP_STRING([--enable-fatal], [Build with fatal warnings]),
142     [
143      case "${enableval}" in
144          yes) BUILD_WITH_FATAL=yes ;;
145          no)  BUILD_WITH_FATAL=no ;;
146          *)   AC_MSG_ERROR(bad value ${enableval} for --enable-fatal) ;;
147      esac],
148      [BUILD_WITH_FATAL=no])
149
150 # just print out our status
151 if test x$BUILD_WITH_FATAL = xyes; then
152     AC_MSG_NOTICE(Will build with fatal warnings)
153     FATAL_CFLAGS="-Werror"
154 else
155     AC_MSG_NOTICE(Will build with non-fatal warnings)
156     FATAL_CFLAGS=""
157 fi
158
159 # Check support (c unit test)
160 PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"])
161 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
162
163 CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-format ${FATAL_FLAGS}"
164 # -Wno-format due to way translation string are done
165
166 ### enable MAEMO platform extensions
167 CFLAGS="$CFLAGS $MAEMO_CHANGES"
168
169 # HILDON_OBJ_*
170 # default vars for the examples
171 # includes all the low-level flags
172 # FIXME Add esd and gconf flags
173 HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/src/"
174 HILDON_OBJ_LIBS="\$(top_builddir)/src/libhildon-\$(PACKAGE_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS) `pkg-config --libs gthread-2.0`"
175 AC_SUBST(HILDON_OBJ_CFLAGS)
176 AC_SUBST(HILDON_OBJ_LIBS)
177
178 AC_CONFIG_FILES([Makefile               \
179                  src/Makefile           \
180                  src/hildon-version.h   \
181                  pkgconfig/Makefile     \
182                  examples/Makefile      \
183                  pkgconfig/hildon.pc    \
184                  tests/Makefile         \
185                  doc/Makefile           \
186                  po/POTFILES            \
187                  po/porules.mk          \
188                  po/Makefile])
189
190 AC_OUTPUT
191
192 echo "
193
194 Configuration:
195
196 - Package:...........: ${PACKAGE}
197 - Version............: ${VERSION}
198 - Api................: ${PACKAGE}-${PACKAGE_VERSION_MAJOR}
199 - Compiler...........: ${CC}
200 - gtk-doc support....: ${enable_gtk_doc}
201 - Build examples.....: ${BUILD_EXAMPLES}
202 - Build with asserts.: ${BUILD_WITH_ASSERTS}
203 - Build unit tests...: ${BUILD_TESTS}
204 - Fatal warnings.....: ${BUILD_WITH_FATAL}
205
206 "