1 dnl If not 1, append datestamp to the version number
2 m4_define(folks_released, 1)
4 m4_define([folks_major_version], [0])
5 m4_define([folks_minor_version], [1])
6 m4_define([folks_micro_version], [12])
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], [11])
16 m4_define([folks_lt_revision], [1])
17 m4_define([folks_lt_age], [11])
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, 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.9 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability)
58 # -----------------------------------------------------------
60 # -----------------------------------------------------------
62 TP_GLIB_REQUIRED=0.11.10
63 TP_VALA_REQUIRED=0.11.10
66 PKG_CHECK_MODULES(VALA, vala-1.0 >= $VALA_REQUIRED)
70 AC_PATH_PROG(VALAC, valac, valac)
73 PKG_PROG_PKG_CONFIG([0.21])
75 LT_CURRENT=folks_lt_current
76 LT_REVISION=folks_lt_revision
78 AC_SUBST([LT_CURRENT])
79 AC_SUBST([LT_REVISION])
82 # require GLib >= 2.24 so GLib.Array, etc. reffing is handled automatically
83 VALACFLAGS="$VALACFLAGS --target-glib=2.24"
87 VAPIGEN=`$PKG_CONFIG --variable=vapigen vala-1.0`
90 VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect vala-1.0`
91 AC_SUBST(VALA_GEN_INTROSPECT)
93 AS_IF([test "$VAPIGEN" = "" -o "$VALA_GEN_INTROSPECT" = ""],
94 [AC_MSG_ERROR([Vala must be built with --enable-vapigen])])
96 PKG_CHECK_MODULES(GLIB,
97 glib-2.0 >= $GLIB_REQUIRED
98 gobject-2.0 >= $GLIB_REQUIRED)
102 PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
106 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
107 AC_SUBST(DBUS_GLIB_CFLAGS)
108 AC_SUBST(DBUS_GLIB_LIBS)
110 PKG_CHECK_MODULES(GEE, gee-1.0)
114 PKG_CHECK_MODULES(TP_VALA, telepathy-vala >= $TP_VALA_REQUIRED)
115 AC_SUBST(TP_VALA_CFLAGS)
116 AC_SUBST(TP_VALA_LIBS)
118 TP_VALA_VALAFLAGS=`$PKG_CONFIG --variable=valaflags telepathy-vala`
119 AC_SUBST(TP_VALA_VALAFLAGS)
121 PKG_CHECK_MODULES(TP_GLIB, telepathy-glib >= $TP_GLIB_REQUIRED)
122 AC_SUBST(TP_GLIB_CFLAGS)
123 AC_SUBST(TP_GLIB_LIBS)
125 # -----------------------------------------------------------
127 # -----------------------------------------------------------
129 FOLKS_MODULE_VERSION=folks_module_version()
130 AC_SUBST(FOLKS_MODULE_VERSION)
131 AC_DEFINE([MODULE_VERSION], ["folks_module_version()"],
132 [Module interface version])
134 BACKEND_DIR='$(libdir)/folks/$(FOLKS_MODULE_VERSION)/backends'
135 AC_SUBST(BACKEND_DIR)
137 # -----------------------------------------------------------
139 # -----------------------------------------------------------
141 AC_HELP_STRING([--enable-docs],[Enable documentation generation]),
142 enable_docs=$enableval, enable_docs=no)
143 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs = xyes)
145 AS_IF([test "x$enable_docs" != xno],
146 [AC_PATH_PROG(VALADOC, valadoc, :)
148 AS_IF([test "$VALADOC" = :],
149 [AC_MSG_ERROR([valadoc not found])])])
151 # -----------------------------------------------------------
153 # -----------------------------------------------------------
154 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
155 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
158 AC_HELP_STRING([--disable-debug],[compile without debug code]),
159 enable_debug=$enableval, enable_debug=yes)
161 AC_ARG_ENABLE(Werror,
162 AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
163 werror=$enableval, werror=yes)
165 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
166 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
167 wno_missing_field_initializers=yes,
168 wno_missing_field_initializers=no)
169 AS_COMPILER_FLAG(-Wno-unused-parameter,
170 wno_unused_parameter=yes,
171 wno_unused_parameter=no)
173 ifelse(folks_released, 1, [],
175 if test x$werror = xyes; then
176 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
178 if test x$wextra = xyes -a \
179 x$wno_missing_field_initializers = xyes -a \
180 x$wno_unused_parameter = xyes; then
181 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
185 AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
186 AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
187 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
188 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
189 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
190 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
192 AC_SUBST(ERROR_CFLAGS)
194 # -----------------------------------------------------------
196 # -----------------------------------------------------------
199 backends/telepathy/folks-telepathy.pc
200 backends/telepathy/folks-telepathy-uninstalled.pc
202 folks/folks-uninstalled.pc
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}