[1.0.11-1 release]
[hildon] / configure.ac
1 AC_INIT([Hildon gtk widgets], [1.0.11], [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, 10, 0, 10)
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 else
114     AC_MSG_NOTICE(Will not use Maemo GTK+ specific API)
115 fi
116
117 # build with assertion checks (or not)
118 AC_ARG_WITH(asserts, 
119     AC_HELP_STRING([--with-asserts], [Build with the assertion checks]),
120     [
121      case "${withval}" in
122          yes) BUILD_WITH_ASSERTS=yes ;;
123          no)  BUILD_WITH_ASSERTS=no ;;
124          *)   AC_MSG_ERROR(bad value ${withval} for --with-asserts) ;;
125      esac],
126      [BUILD_WITH_ASSERTS=no])
127
128 # just print out our status
129 if test x$BUILD_WITH_ASSERTS = xyes; then
130     AC_MSG_NOTICE(Will build with assertion checks)
131     ASSERT_CFLAGS=""
132 else
133     AC_MSG_NOTICE(Will not build with assertion checks)
134     ASSERT_CFLAGS="-DG_DISABLE_ASSERT"
135 fi
136
137 # build with relaxed flags or not
138 AC_ARG_ENABLE(fatal, 
139     AC_HELP_STRING([--enable-fatal], [Build with fatal warnings]),
140     [
141      case "${enableval}" in
142          yes) BUILD_WITH_FATAL=yes ;;
143          no)  BUILD_WITH_FATAL=no ;;
144          *)   AC_MSG_ERROR(bad value ${enableval} for --enable-fatal) ;;
145      esac],
146      [BUILD_WITH_FATAL=no])
147
148 # just print out our status
149 if test x$BUILD_WITH_FATAL = xyes; then
150     AC_MSG_NOTICE(Will build with fatal warnings)
151     FATAL_CFLAGS="-Werror"
152 else
153     AC_MSG_NOTICE(Will build with non-fatal warnings)
154     FATAL_CFLAGS=""
155 fi
156
157 # Check support (c unit test)
158 PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"])
159 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
160
161 CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-format ${FATAL_FLAGS}"
162 # -Wno-format due to way translation string are done
163
164 ### enable MAEMO platform extensions
165 CFLAGS="$CFLAGS -DMAEMO_CHANGES -DHILDON_ENABLE_UNSTABLE_API"
166
167 # HILDON_OBJ_*
168 # default vars for the examples
169 # includes all the low-level flags
170 # FIXME Add esd and gconf flags
171 HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/src/"
172 HILDON_OBJ_LIBS="\$(top_builddir)/src/libhildon-\$(PACKAGE_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS) `pkg-config --libs gthread-2.0`"
173 AC_SUBST(HILDON_OBJ_CFLAGS)
174 AC_SUBST(HILDON_OBJ_LIBS)
175
176 AC_CONFIG_FILES([Makefile src/Makefile  \
177                  pkgconfig/Makefile     \
178                  examples/Makefile      \
179                  pkgconfig/hildon.pc    \
180                  tests/Makefile         \
181                  doc/Makefile           \
182                  po/POTFILES            \
183                  po/porules.mk          \
184                  po/Makefile])
185
186 AC_OUTPUT
187
188 echo "
189
190 Configuration:
191
192 - Package:...........: ${PACKAGE}
193 - Version............: ${VERSION}
194 - Api................: ${PACKAGE}-${PACKAGE_VERSION_MAJOR}
195 - Compiler...........: ${CC}
196 - gtk-doc support....: ${enable_gtk_doc}
197 - Build examples.....: ${BUILD_EXAMPLES}
198 - Build with asserts.: ${BUILD_WITH_ASSERTS}
199 - Build unit tests...: ${BUILD_TESTS}
200 - Fatal warnings.....: ${BUILD_WITH_FATAL}
201
202 "