aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: 7e74209907fa7f59033504c77c5eb525c8db98cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
AC_INIT([Hildon gtk widgets], [3.0.0], [cordia-dev@lists.xiaoka.com], [hildon])
AC_CANONICAL_SYSTEM

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

# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_AWK

AC_HEADER_STDC

GTK_VERSION=3.2
X11_VERSION=1.4.3

PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_VERSION)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_VERSION)

PKG_CHECK_MODULES(X11, x11 >= $X11_VERSION)
AC_SUBST(X11_LIBS)
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_VERSION)

# libcanberra is needed for the hildon-note sounds.

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)
AC_SUBST(GCONF_LIBS)

ALL_LINGUAS="en_GB"
AC_SUBST(ALL_LINGUAS) 
AM_GLIB_GNU_GETTEXT

GTK_DOC_CHECK([1.3])

localedir=${datadir}/locale

AC_SUBST(localedir)

# Disable rebuild of glib-mkenum -generated source code:
AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=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)

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

# 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

# build with debug (or not)
AC_ARG_ENABLE(debug,
    AC_HELP_STRING([--enable-debug], [turn on debugging]),
    [
     case "${enableval}" in
         yes) BUILD_WITH_DEBUG=yes ;;
         no)  BUILD_WITH_DEBUG=no ;;
         *)   AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
     esac],
     [BUILD_WITH_DEBUG=no])

# just print out our status
if test x$BUILD_WITH_DEBUG = xyes; then
    AC_MSG_NOTICE(Will build with debugging info)
    DEBUG_CFLAGS=""
else
    AC_MSG_NOTICE(Will not build with debugging info)
    DEBUG_CFLAGS="-DG_DISABLE_CAST_CHECKS"
fi

# 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
    AC_MSG_NOTICE(Will build with non-fatal warnings)
    FATAL_CFLAGS=""
fi

# 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} ${DEBUG_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-format ${FATAL_CFLAGS}"
# -Wno-format due to way translation string are done

# 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) \$(X11_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/hildon/"
HILDON_OBJ_LIBS="\$(top_builddir)/hildon/libhildon-\$(API_VERSION_MAJOR).la \$(GTK_LIBS) \$(X11_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}
- gtk-doc support....: ${enable_gtk_doc}
- Build examples.....: ${BUILD_EXAMPLES}
- Build with asserts.: ${BUILD_WITH_ASSERTS}
- Build with debug...: ${BUILD_WITH_DEBUG}
- Build unit tests...: ${BUILD_TESTS}
- Fatal warnings.....: ${BUILD_WITH_FATAL}

"