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 dnl Display the nano_version only if it's not '0'
10 m4_define([folks_base_version],
11 [folks_major_version.folks_minor_version.folks_micro_version])
12 m4_define([folks_full_version],
13 [m4_if(folks_nano_version, 0, [folks_base_version],
14 [folks_base_version].[folks_nano_version])])
16 m4_define(folks_maybe_datestamp,
17 m4_esyscmd([if test x]folks_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
19 m4_define(folks_version, folks_full_version[]folks_maybe_datestamp)
22 AC_INIT(folks, folks_version, folks)
23 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27 Copyright (C) 2010 Collabora Ltd.
30 AC_CONFIG_MACRO_DIR([m4])
31 AC_CONFIG_SRCDIR([Makefile.am])
32 AC_CONFIG_HEADERS(config.h)
33 AC_CONFIG_SRCDIR([configure.ac])
34 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability)
46 # -----------------------------------------------------------
48 # -----------------------------------------------------------
50 TP_GLIB_REQUIRED=0.11.10
51 TP_VALA_REQUIRED=0.11.10
52 VALA_REQUIRED=0.9.2.120-5ad2f
54 PKG_CHECK_MODULES(VALA, vala-1.0 >= $VALA_REQUIRED)
58 AC_PATH_PROG(VALAC, valac, valac)
61 PKG_PROG_PKG_CONFIG([0.21])
63 # require GLib >= 2.24 so GLib.Array, etc. reffing is handled automatically
64 VALACFLAGS="$VALACFLAGS --target-glib=2.24"
68 VAPIGEN=`$PKG_CONFIG --variable=vapigen vala-1.0`
71 VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect vala-1.0`
72 AC_SUBST(VALA_GEN_INTROSPECT)
74 AS_IF([test "$VAPIGEN" = "" -o "$VALA_GEN_INTROSPECT" = ""],
75 [AC_MSG_ERROR([Vala must be built with --enable-vapigen])])
77 PKG_CHECK_MODULES(GLIB,
78 glib-2.0 >= $GLIB_REQUIRED
79 gobject-2.0 >= $GLIB_REQUIRED)
83 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
84 AC_SUBST(DBUS_GLIB_CFLAGS)
85 AC_SUBST(DBUS_GLIB_LIBS)
87 PKG_CHECK_MODULES(GEE, gee-1.0)
91 PKG_CHECK_MODULES(TP_VALA, telepathy-vala >= $TP_VALA_REQUIRED)
92 AC_SUBST(TP_VALA_CFLAGS)
93 AC_SUBST(TP_VALA_LIBS)
95 TP_VALA_VALAFLAGS=`$PKG_CONFIG --variable=valaflags telepathy-vala`
96 AC_SUBST(TP_VALA_VALAFLAGS)
98 PKG_CHECK_MODULES(TP_GLIB, telepathy-glib >= $TP_GLIB_REQUIRED)
99 AC_SUBST(TP_GLIB_CFLAGS)
100 AC_SUBST(TP_GLIB_LIBS)
102 # -----------------------------------------------------------
104 # -----------------------------------------------------------
106 AC_HELP_STRING([--enable-docs],[Enable documentation generation]),
107 enable_docs=$enableval, enable_docs=no)
108 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs = xyes)
110 AS_IF([test "x$enable_docs" != xno],
111 [AC_PATH_PROG(VALADOC, valadoc, :)
113 AS_IF([test "$VALADOC" = :],
114 [AC_MSG_ERROR([valadoc not found])])])
116 # -----------------------------------------------------------
118 # -----------------------------------------------------------
119 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
120 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
123 AC_HELP_STRING([--disable-debug],[compile without debug code]),
124 enable_debug=$enableval, enable_debug=yes)
126 AC_ARG_ENABLE(Werror,
127 AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
128 werror=$enableval, werror=yes)
130 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
131 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
132 wno_missing_field_initializers=yes,
133 wno_missing_field_initializers=no)
134 AS_COMPILER_FLAG(-Wno-unused-parameter,
135 wno_unused_parameter=yes,
136 wno_unused_parameter=no)
138 ifelse(folks_released, 1, [],
140 if test x$werror = xyes; then
141 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
143 if test x$wextra = xyes -a \
144 x$wno_missing_field_initializers = xyes -a \
145 x$wno_unused_parameter = xyes; then
146 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
150 AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
151 AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
152 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
153 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
154 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
155 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
157 AC_SUBST(ERROR_CFLAGS)
159 # -----------------------------------------------------------
161 # -----------------------------------------------------------
164 backends/telepathy/folks-telepathy.pc
165 backends/telepathy/folks-telepathy-uninstalled.pc
167 folks/folks-uninstalled.pc
170 backends/telepathy/Makefile
180 Compiler....................: ${VALAC}
181 Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
182 Prefix......................: ${prefix}
183 Bugreporting URL............: ${PACKAGE_BUGREPORT}
184 Documentation...............: ${enable_docs}