[1.0.1 release]
[hildon] / configure.ac
1 AC_INIT([Hildon gtk widgets], [1.0.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, 1, 0, 1)
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 # Check support (c unit test)
138 PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"])
139 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
140
141 CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format"
142 # -Wno-format due to way translation string are done
143
144 ### enable MAEMO platform extensions
145 CFLAGS="$CFLAGS -DMAEMO_CHANGES"
146
147 # HILDON_OBJ_*
148 # default vars for the examples
149 # includes all the low-level flags
150 # FIXME Add esd and gconf flags
151 HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/src/"
152 HILDON_OBJ_LIBS="\$(top_builddir)/src/libhildon-\$(PACKAGE_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS) `pkg-config --libs gthread-2.0`"
153 AC_SUBST(HILDON_OBJ_CFLAGS)
154 AC_SUBST(HILDON_OBJ_LIBS)
155
156 AC_CONFIG_FILES([Makefile src/Makefile  \
157                  pkgconfig/Makefile     \
158                  examples/Makefile      \
159                  pkgconfig/hildon.pc    \
160                  tests/Makefile         \
161                  doc/Makefile           \
162                  po/POTFILES            \
163                  po/porules.mk          \
164                  po/Makefile])
165
166 AC_OUTPUT
167
168 echo "
169
170 Configuration:
171
172 - Package:...........: ${PACKAGE}
173 - Version............: ${VERSION}
174 - Api................: ${PACKAGE}-${PACKAGE_VERSION_MAJOR}
175 - Compiler...........: ${CC}
176 - gtk-doc support....: ${enable_gtk_doc}
177 - Build examples.....: ${BUILD_EXAMPLES}
178 - Build with asserts.: ${BUILD_WITH_ASSERTS}
179 - Build unit tests...: ${BUILD_TESTS}
180
181 "