1 dnl If not 1, append datestamp to the version number
2 m4_define(folks_released, 0)
4 m4_define([folks_major_version], [0])
5 m4_define([folks_minor_version], [1])
6 m4_define([folks_micro_version], [14])
7 m4_define([folks_nano_version], [0])
9 # If library source has changed since last release, increment revision
10 # If interfaces have been added, removed or changed since last release,
11 # increment current and set revision to 0
12 # If interfaces have been added since last release, increment age
13 # If interfaces have been removed since last release, set age to 0
15 m4_define([folks_lt_current], [12])
16 m4_define([folks_lt_revision], [0])
17 m4_define([folks_lt_age], [12])
19 dnl Display the nano_version only if it's not '0'
20 m4_define([folks_base_version],
21 [folks_major_version.folks_minor_version.folks_micro_version])
22 m4_define([folks_full_version],
23 [m4_if(folks_nano_version, 0, [folks_base_version],
24 [folks_base_version].[folks_nano_version])])
26 m4_define(folks_maybe_datestamp,
27 m4_esyscmd([if test x]folks_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
29 m4_define(folks_version, folks_full_version[]folks_maybe_datestamp)
32 m4_define([folks_module_version], [folks_lt_current])
34 AC_INIT(folks, folks_version, https://bugzilla.gnome.org/browse.cgi?product=folks)
35 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 Copyright (C) 2010 Collabora Ltd.
42 AC_CONFIG_MACRO_DIR([m4])
43 AC_CONFIG_SRCDIR([Makefile.am])
44 AC_CONFIG_HEADERS(config.h)
45 AC_CONFIG_SRCDIR([configure.ac])
46 AM_INIT_AUTOMAKE(1.11 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability)
58 # -----------------------------------------------------------
60 # -----------------------------------------------------------
62 TP_GLIB_REQUIRED=0.11.11
65 AM_PROG_VALAC([$VALA_REQUIRED])
67 PKG_PROG_PKG_CONFIG([0.21])
69 LT_CURRENT=folks_lt_current
70 LT_REVISION=folks_lt_revision
72 AC_SUBST([LT_CURRENT])
73 AC_SUBST([LT_REVISION])
76 PKG_CHECK_MODULES(GLIB,
77 glib-2.0 >= $GLIB_REQUIRED
78 gobject-2.0 >= $GLIB_REQUIRED)
82 PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
86 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
87 AC_SUBST(DBUS_GLIB_CFLAGS)
88 AC_SUBST(DBUS_GLIB_LIBS)
90 # require GLib >= 2.24 so GLib.Array, etc. reffing is handled automatically
91 VALACFLAGS="$VALACFLAGS --target-glib=2.24"
96 AC_PATH_PROG(VAPIGEN, vapigen, vapigen)
99 # XXX: using this path instead of the wrapper script vala-gen-introspect is
100 # sub-optimal, but the wrapper requires that we use a pkg-config file. Once
101 # the dependencies of bgo#627046 are fixed, we should use g-ir-scanner instead
102 # of vala-gen-introspect anyway.
103 VALA_GEN_INTROSPECT='$(libdir)/vala-0.10/gen-introspect-0.10'
104 AC_SUBST(VALA_GEN_INTROSPECT)
106 AS_IF([test "$VAPIGEN" = "" -o "$VALA_GEN_INTROSPECT" = ""],
107 [AC_MSG_ERROR([Vala must be built with --enable-vapigen])])
109 PKG_CHECK_MODULES(GEE, gee-1.0)
113 PKG_CHECK_MODULES(TP_GLIB, telepathy-glib >= $TP_GLIB_REQUIRED)
114 AC_SUBST(TP_GLIB_CFLAGS)
115 AC_SUBST(TP_GLIB_LIBS)
117 # check for tp-glib vala bindings by compiling a trivial program
118 AC_MSG_CHECKING([Telepathy Vala bindings])
119 AS_IF(! [$VALAC $VALACFLAGS $VALAFLAGS --vapidir=$VAPIDIR --pkg telepathy-glib \
120 -o /dev/null "${srcdir}/telepathy-check.vala"],
121 [AC_MSG_ERROR([Missing telepathy-glib Vala bindings])])
124 # -----------------------------------------------------------
126 # -----------------------------------------------------------
128 FOLKS_MODULE_VERSION=folks_module_version()
129 AC_SUBST(FOLKS_MODULE_VERSION)
130 AC_DEFINE([MODULE_VERSION], ["folks_module_version()"],
131 [Module interface version])
133 BACKEND_DIR='$(libdir)/folks/$(FOLKS_MODULE_VERSION)/backends'
134 AC_SUBST(BACKEND_DIR)
136 # -----------------------------------------------------------
138 # -----------------------------------------------------------
140 AC_HELP_STRING([--enable-docs],[Enable documentation generation]),
141 enable_docs=$enableval, enable_docs=no)
142 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs = xyes)
144 AS_IF([test "x$enable_docs" != xno],
145 [AC_PATH_PROG(VALADOC, valadoc, :)
147 AS_IF([test "$VALADOC" = :],
148 [AC_MSG_ERROR([valadoc not found])])])
150 # -----------------------------------------------------------
152 # -----------------------------------------------------------
153 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
154 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
157 AC_HELP_STRING([--disable-debug],[compile without debug code]),
158 enable_debug=$enableval, enable_debug=yes)
160 AC_ARG_ENABLE(Werror,
161 AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
162 werror=$enableval, werror=yes)
164 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
165 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
166 wno_missing_field_initializers=yes,
167 wno_missing_field_initializers=no)
168 AS_COMPILER_FLAG(-Wno-unused-parameter,
169 wno_unused_parameter=yes,
170 wno_unused_parameter=no)
172 ifelse(folks_released, 1, [],
174 if test x$werror = xyes; then
175 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
177 if test x$wextra = xyes -a \
178 x$wno_missing_field_initializers = xyes -a \
179 x$wno_unused_parameter = xyes; then
180 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
184 AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
185 AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
186 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
187 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
188 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
189 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
191 AC_SUBST(ERROR_CFLAGS)
193 # -----------------------------------------------------------
195 # -----------------------------------------------------------
198 backends/telepathy/folks-telepathy.pc
199 backends/telepathy/folks-telepathy-uninstalled.pc
201 folks/folks-uninstalled.pc
204 backends/key-file/Makefile
205 backends/telepathy/Makefile
215 Compiler....................: ${VALAC}
216 Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
217 Prefix......................: ${prefix}
218 Bugreporting URL............: ${PACKAGE_BUGREPORT}
219 Documentation...............: ${enable_docs}