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], [9])
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)
42 AC_PATH_PROG(VALAC, valac, valac)
45 PKG_PROG_PKG_CONFIG([0.21])
46 AC_SUBST(PKG_CONFIG_PATH)
48 # require GLib >= 2.24 so GLib.Array, etc. reffing is handled automatically
49 VALACFLAGS="$VALACFLAGS --target-glib=2.24"
53 VAPIGEN=`$PKG_CONFIG --variable=vapigen vala-1.0`
56 VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect vala-1.0`
57 AC_SUBST(VALA_GEN_INTROSPECT)
59 AS_IF([test "$VAPIGEN" = "" -o "$VALA_GEN_INTROSPECT" = ""],
60 [AC_MSG_ERROR([Vala must be built with --enable-vapigen])])
67 # -----------------------------------------------------------
69 # -----------------------------------------------------------
71 TP_GLIB_REQUIRED=0.11.10
72 TP_VALA_REQUIRED=0.11.10
74 PKG_CHECK_MODULES(GLIB,
75 glib-2.0 >= $GLIB_REQUIRED
76 gobject-2.0 >= $GLIB_REQUIRED)
80 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
81 AC_SUBST(DBUS_GLIB_CFLAGS)
82 AC_SUBST(DBUS_GLIB_LIBS)
84 PKG_CHECK_MODULES(GEE, gee-1.0)
88 PKG_CHECK_MODULES(TP_VALA, telepathy-vala >= $TP_VALA_REQUIRED)
89 AC_SUBST(TP_VALA_CFLAGS)
90 AC_SUBST(TP_VALA_LIBS)
92 PKG_CHECK_MODULES(TP_GLIB, telepathy-glib >= $TP_GLIB_REQUIRED)
93 AC_SUBST(TP_GLIB_CFLAGS)
94 AC_SUBST(TP_GLIB_LIBS)
96 # -----------------------------------------------------------
98 # -----------------------------------------------------------
100 AC_HELP_STRING([--enable-docs],[Enable documentation generation]),
101 enable_docs=$enableval, enable_docs=no)
102 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs = xyes)
104 AS_IF([test "x$enable_docs" != xno],
105 [AC_PATH_PROG(VALADOC, valadoc, :)
107 AS_IF([test "$VALADOC" = :],
108 [AC_MSG_ERROR([valadoc not found])])])
110 # -----------------------------------------------------------
112 # -----------------------------------------------------------
113 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
114 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
117 AC_HELP_STRING([--disable-debug],[compile without debug code]),
118 enable_debug=$enableval, enable_debug=yes)
120 AC_ARG_ENABLE(Werror,
121 AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
122 werror=$enableval, werror=yes)
124 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
125 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
126 wno_missing_field_initializers=yes,
127 wno_missing_field_initializers=no)
128 AS_COMPILER_FLAG(-Wno-unused-parameter,
129 wno_unused_parameter=yes,
130 wno_unused_parameter=no)
132 ifelse(folks_released, 1, [],
134 if test x$werror = xyes; then
135 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
137 if test x$wextra = xyes -a \
138 x$wno_missing_field_initializers = xyes -a \
139 x$wno_unused_parameter = xyes; then
140 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
144 AS_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
145 AS_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
146 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
147 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
148 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
149 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
151 AC_SUBST(ERROR_CFLAGS)
153 # -----------------------------------------------------------
155 # -----------------------------------------------------------
158 backends/telepathy/folks-telepathy.pc
159 backends/telepathy/folks-telepathy-uninstalled.pc
161 folks/folks-uninstalled.pc
164 backends/telepathy/Makefile
174 Compiler....................: ${VALAC}
175 Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
176 Prefix......................: ${prefix}
177 Coding style checks.........: ${ENABLE_CODING_STYLE_CHECKS}
178 VAPI generation.............: ${enable_vapigen}
179 Bugreporting URL............: ${PACKAGE_BUGREPORT}
180 Documentation...............: ${enable_docs}