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], [11])
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], [10])
16 m4_define([folks_lt_revision], [0])
17 m4_define([folks_lt_age], [10])
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 AC_INIT(folks, folks_version, folks)
33 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37 Copyright (C) 2010 Collabora Ltd.
40 AC_CONFIG_MACRO_DIR([m4])
41 AC_CONFIG_SRCDIR([Makefile.am])
42 AC_CONFIG_HEADERS(config.h)
43 AC_CONFIG_SRCDIR([configure.ac])
44 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability)
56 # -----------------------------------------------------------
58 # -----------------------------------------------------------
60 TP_GLIB_REQUIRED=0.11.10
61 TP_VALA_REQUIRED=0.11.10
62 VALA_REQUIRED=0.9.2.120-5ad2f
64 PKG_CHECK_MODULES(VALA, vala-1.0 >= $VALA_REQUIRED)
68 AC_PATH_PROG(VALAC, valac, valac)
71 PKG_PROG_PKG_CONFIG([0.21])
73 LT_CURRENT=folks_lt_current
74 LT_REVISION=folks_lt_revision
76 AC_SUBST([LT_CURRENT])
77 AC_SUBST([LT_REVISION])
80 # require GLib >= 2.24 so GLib.Array, etc. reffing is handled automatically
81 VALACFLAGS="$VALACFLAGS --target-glib=2.24"
85 VAPIGEN=`$PKG_CONFIG --variable=vapigen vala-1.0`
88 VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect vala-1.0`
89 AC_SUBST(VALA_GEN_INTROSPECT)
91 AS_IF([test "$VAPIGEN" = "" -o "$VALA_GEN_INTROSPECT" = ""],
92 [AC_MSG_ERROR([Vala must be built with --enable-vapigen])])
94 PKG_CHECK_MODULES(GLIB,
95 glib-2.0 >= $GLIB_REQUIRED
96 gobject-2.0 >= $GLIB_REQUIRED)
100 PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQUIRED)
104 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
105 AC_SUBST(DBUS_GLIB_CFLAGS)
106 AC_SUBST(DBUS_GLIB_LIBS)
108 PKG_CHECK_MODULES(GEE, gee-1.0)
112 PKG_CHECK_MODULES(TP_VALA, telepathy-vala >= $TP_VALA_REQUIRED)
113 AC_SUBST(TP_VALA_CFLAGS)
114 AC_SUBST(TP_VALA_LIBS)
116 TP_VALA_VALAFLAGS=`$PKG_CONFIG --variable=valaflags telepathy-vala`
117 AC_SUBST(TP_VALA_VALAFLAGS)
119 PKG_CHECK_MODULES(TP_GLIB, telepathy-glib >= $TP_GLIB_REQUIRED)
120 AC_SUBST(TP_GLIB_CFLAGS)
121 AC_SUBST(TP_GLIB_LIBS)
123 # -----------------------------------------------------------
125 # -----------------------------------------------------------
127 AC_HELP_STRING([--enable-docs],[Enable documentation generation]),
128 enable_docs=$enableval, enable_docs=no)
129 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs = xyes)
131 AS_IF([test "x$enable_docs" != xno],
132 [AC_PATH_PROG(VALADOC, valadoc, :)
134 AS_IF([test "$VALADOC" = :],
135 [AC_MSG_ERROR([valadoc not found])])])
137 # -----------------------------------------------------------
139 # -----------------------------------------------------------
140 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
141 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
144 AC_HELP_STRING([--disable-debug],[compile without debug code]),
145 enable_debug=$enableval, enable_debug=yes)
147 AC_ARG_ENABLE(Werror,
148 AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
149 werror=$enableval, werror=yes)
151 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
152 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
153 wno_missing_field_initializers=yes,
154 wno_missing_field_initializers=no)
155 AS_COMPILER_FLAG(-Wno-unused-parameter,
156 wno_unused_parameter=yes,
157 wno_unused_parameter=no)
159 ifelse(folks_released, 1, [],
161 if test x$werror = xyes; then
162 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
164 if test x$wextra = xyes -a \
165 x$wno_missing_field_initializers = xyes -a \
166 x$wno_unused_parameter = xyes; then
167 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
171 AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
172 AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
173 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
174 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
175 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
176 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
178 AC_SUBST(ERROR_CFLAGS)
180 # -----------------------------------------------------------
182 # -----------------------------------------------------------
185 backends/telepathy/folks-telepathy.pc
186 backends/telepathy/folks-telepathy-uninstalled.pc
188 folks/folks-uninstalled.pc
191 backends/telepathy/Makefile
201 Compiler....................: ${VALAC}
202 Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
203 Prefix......................: ${prefix}
204 Bugreporting URL............: ${PACKAGE_BUGREPORT}
205 Documentation...............: ${enable_docs}