1AC_PREREQ([2.59])
2
3# Making releases:
4#   set the new version number:
5#     odd minor -> development series
6#     even minor -> stable series
7#     increment micro for each release within a series
8#   set tp_farstream_release to 1
9
10m4_define([tp_farstream_major_version], [0])
11m4_define([tp_farstream_minor_version], [6])
12m4_define([tp_farstream_micro_version], [2])
13m4_define([tp_farstream_nano_version], [0])
14
15dnl CURRENT, REVISION, AGE
16dnl - library source changed -> increment REVISION
17dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
18dnl - interfaces added -> increment AGE
19dnl - interfaces removed -> AGE = 0
20m4_define([tp_farstream_lt_current], [3])
21m4_define([tp_farstream_lt_revision], [1])
22m4_define([tp_farstream_lt_age], [0])
23
24
25# Some magic
26m4_define([tp_farstream_base_version],
27          [tp_farstream_major_version.tp_farstream_minor_version.tp_farstream_micro_version])
28m4_define([tp_farstream_version],
29          [m4_if(tp_farstream_nano_version, 0, [tp_farstream_base_version],
30              [tp_farstream_base_version].[tp_farstream_nano_version])])
31
32AC_INIT([Telepathy-Farstream], [tp_farstream_version],
33        [https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=tp-farstream])
34
35AC_CONFIG_MACRO_DIR([m4])
36
37AM_INIT_AUTOMAKE([1.11 -Wno-portability])
38AC_CONFIG_HEADERS(config.h)
39
40dnl use pretty build output with automake >= 1.11
41m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
42  [AM_DEFAULT_VERBOSITY=1
43   AC_SUBST(AM_DEFAULT_VERBOSITY)])
44
45dnl check for tools
46AC_PROG_CC
47AC_PROG_CC_STDC
48AC_PROG_INSTALL
49AC_PROG_LIBTOOL
50
51dnl decide error flags
52AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
53AS_COMPILER_FLAG(-Werror -Wno-error=deprecated-declarations, werror=yes, werror=no)
54
55AC_ARG_ENABLE(Werror,
56  AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
57    werror=$enableval, :)
58
59AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
60AS_COMPILER_FLAG(-Wno-missing-field-initializers,
61        wno_missing_field_initializers=yes,
62        wno_missing_field_initializers=no)
63AS_COMPILER_FLAG(-Wno-unused-parameter,
64        wno_unused_parameter=yes,
65        wno_unused_parameter=no)
66
67ifelse(tp_farstream_nano_version, 0, [],
68    [
69        AS_IF([test x$werror = xyes],
70            [ERROR_CFLAGS="$ERROR_CFLAGS -Werror -Wno-error=deprecated-declarations"])
71	AS_IF([test x$wextra = xyes -a \
72            x$wno_missing_field_initializers = xyes -a \
73            x$wno_unused_parameter = xyes].
74            [ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"])
75    ])
76
77AC_SUBST(ERROR_CFLAGS)
78
79AC_ARG_ENABLE(coverage,       [  --enable-coverage         compile with coverage info],[enable_coverage=${enableval}],enable_coverage=no)
80AS_IF([test "x$enable_coverage" = "xyes"],
81	    [CFLAGS="$CFLAGS -g -fprofile-arcs -ftest-coverage"])
82
83CFLAGS="$CFLAGS"
84
85dnl Check for Glib
86PKG_CHECK_MODULES(GLIB, gobject-2.0 >= 2.32 glib-2.0 >= 2.32 gio-2.0)
87AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_30, [Ignore post 2.30 deprecations])
88AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_32, [Prevent post 2.32 APIs])
89
90AC_SUBST(GLIB_CFLAGS)
91AC_SUBST(GLIB_LIBS)
92
93dnl Check for DBus
94PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60])
95
96AC_SUBST(DBUS_CFLAGS)
97AC_SUBST(DBUS_LIBS)
98
99dnl Check for Telepathy libraries
100PKG_CHECK_MODULES([TELEPATHY], [telepathy-glib >= 0.21])
101AC_DEFINE(TP_VERSION_MIN_REQUIRED, TP_VERSION_0_22, [Ignore post 0.22 deprecations])
102AC_DEFINE(TP_VERSION_MAX_ALLOWED, TP_VERSION_0_22, [Prevent post 0.22 APIs])
103AC_DEFINE(TP_SEAL_ENABLE, 1, [Prevent to use sealed variables])
104AC_DEFINE(TP_DISABLE_SINGLE_INCLUDE, 1, [Disable single include header])
105
106AC_SUBST(TELEPATHY_CFLAGS)
107AC_SUBST(TELEPATHY_LIBS)
108
109dnl Check for farstream
110PKG_CHECK_MODULES(FARSTREAM, [farstream-0.2])
111
112AC_SUBST(FARSTREAM_CFLAGS)
113AC_SUBST(FARSTREAM_LIBS)
114
115GOBJECT_INTROSPECTION_CHECK([1.30.0])
116
117GTK_DOC_CHECK([1.17], [--flavour no-tmpl])
118
119LT_CURRENT=tp_farstream_lt_current
120LT_REVISION=tp_farstream_lt_revision
121LT_AGE=tp_farstream_lt_age
122AC_SUBST([LT_CURRENT])
123AC_SUBST([LT_REVISION])
124AC_SUBST([LT_AGE])
125
126
127AC_OUTPUT( Makefile \
128          doc/Makefile \
129          doc/lib/Makefile \
130          m4/Makefile \
131          examples/Makefile \
132          examples/python/Makefile \
133          telepathy-farstream/Makefile  \
134          telepathy-farstream/telepathy-farstream.pc \
135          telepathy-farstream/telepathy-farstream-uninstalled.pc
136          tools/Makefile
137)
138