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], [10])
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(DBUS_GLIB, dbus-glib-1)
101 AC_SUBST(DBUS_GLIB_CFLAGS)
102 AC_SUBST(DBUS_GLIB_LIBS)
104 PKG_CHECK_MODULES(GEE, gee-1.0)
108 PKG_CHECK_MODULES(TP_VALA, telepathy-vala >= $TP_VALA_REQUIRED)
109 AC_SUBST(TP_VALA_CFLAGS)
110 AC_SUBST(TP_VALA_LIBS)
112 TP_VALA_VALAFLAGS=`$PKG_CONFIG --variable=valaflags telepathy-vala`
113 AC_SUBST(TP_VALA_VALAFLAGS)
115 PKG_CHECK_MODULES(TP_GLIB, telepathy-glib >= $TP_GLIB_REQUIRED)
116 AC_SUBST(TP_GLIB_CFLAGS)
117 AC_SUBST(TP_GLIB_LIBS)
119 # -----------------------------------------------------------
121 # -----------------------------------------------------------
123 AC_HELP_STRING([--enable-docs],[Enable documentation generation]),
124 enable_docs=$enableval, enable_docs=no)
125 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs = xyes)
127 AS_IF([test "x$enable_docs" != xno],
128 [AC_PATH_PROG(VALADOC, valadoc, :)
130 AS_IF([test "$VALADOC" = :],
131 [AC_MSG_ERROR([valadoc not found])])])
133 # -----------------------------------------------------------
135 # -----------------------------------------------------------
136 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
137 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
140 AC_HELP_STRING([--disable-debug],[compile without debug code]),
141 enable_debug=$enableval, enable_debug=yes)
143 AC_ARG_ENABLE(Werror,
144 AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
145 werror=$enableval, werror=yes)
147 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
148 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
149 wno_missing_field_initializers=yes,
150 wno_missing_field_initializers=no)
151 AS_COMPILER_FLAG(-Wno-unused-parameter,
152 wno_unused_parameter=yes,
153 wno_unused_parameter=no)
155 ifelse(folks_released, 1, [],
157 if test x$werror = xyes; then
158 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
160 if test x$wextra = xyes -a \
161 x$wno_missing_field_initializers = xyes -a \
162 x$wno_unused_parameter = xyes; then
163 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
167 AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
168 AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
169 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
170 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
171 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
172 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
174 AC_SUBST(ERROR_CFLAGS)
176 # -----------------------------------------------------------
178 # -----------------------------------------------------------
181 backends/telepathy/folks-telepathy.pc
182 backends/telepathy/folks-telepathy-uninstalled.pc
184 folks/folks-uninstalled.pc
187 backends/telepathy/Makefile
197 Compiler....................: ${VALAC}
198 Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
199 Prefix......................: ${prefix}
200 Bugreporting URL............: ${PACKAGE_BUGREPORT}
201 Documentation...............: ${enable_docs}