configure.ac 11.6 KB
Newer Older
1
AC_INIT([telepathy-account-widgets],
2
        [0.1], dnl Version doesn't really make sense for a submodule
3
        [http://bugzilla.gnome.org/browse.cgi?product=empathy])
4

5
AC_PREREQ([2.64])
6 7
AC_COPYRIGHT([
  Copyright (C) 2003-2007 Imendio AB
8
  Copyright (C) 2007-2013 Collabora Ltd.
9
])
10

11
# Minimal version required
Guillaume Desmottes's avatar
Guillaume Desmottes committed
12

13
# Hard deps
14
GLIB_REQUIRED=2.33.3
15
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_30, [Ignore post 2.30 deprecations])
16
AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_34, [Prevent post 2.34 APIs])
17

18
GTK_REQUIRED=3.5.1
Guillaume Desmottes's avatar
Guillaume Desmottes committed
19
AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_3_4, [Ignore post 3.4 deprecations])
20
AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_3_4, [Prevent post 3.4 APIs])
21

22
TELEPATHY_GLIB_REQUIRED=0.19.9
23
AC_DEFINE(TP_VERSION_MIN_REQUIRED, TP_VERSION_0_20, [Ignore post 0.20 deprecations])
24
AC_DEFINE(TP_VERSION_MAX_ALLOWED, TP_VERSION_0_20, [Prevent post 0.20 APIs])
25
AC_DEFINE(TP_SEAL_ENABLE, 1, [Prevent to use sealed variables])
26
AC_DEFINE(TP_DISABLE_SINGLE_INCLUDE, 1, [Disable single include header])
27

28
LIBSECRET_REQUIRED=0.5
29

Xavier Claessens's avatar
Xavier Claessens committed
30 31 32 33 34
# Optional deps
LIBACCOUNTS_REQUIRED=1.4
LIBSIGNON_REQUIRED=1.1
MC_PLUGINS_REQUIRED=5.13.1

35 36 37 38 39 40
# Enable extra flags for warnings if this is an unreleased version.
AC_ARG_ENABLE(unreleased_checks,
            AS_HELP_STRING([--enable-unreleased-checks=@<:@no/yes@:>@],
            [enable extra checks for unreleased versions]),,
            [enable_unreleased_checks=no])

41
# Use --enable-maintainer-mode to disable deprecated symbols,
42 43
# disable single include and enable GSEAL.
# If this is not a released tp-account-widgets, maintainer mode is forced.
44
# FIXME: don't disable deprecated symbols until bgo #636654 has been fixed
45 46 47
#if test "x$enable_unreleased_checks" = "xyes" ; then
#    enable_maintainer_mode="yes"
#fi
48
#GNOME_MAINTAINER_MODE_DEFINES
49

50
AC_CONFIG_MACRO_DIR([m4])
51 52
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])
53
AC_CONFIG_AUX_DIR(.)
54

55
AM_INIT_AUTOMAKE([1.11 no-define -Wno-portability tar-ustar no-dist-gzip dist-xz])
56

57
# Support silent build rules. Disable
58 59
# by either passing --disable-silent-rules to configure or passing V=1
# to make
60
AM_SILENT_RULES([yes])
61

62
# Check for programs
63 64
AC_PROG_CC
AC_HEADER_STDC
65
AM_PROG_MKDIR_P
66 67
AM_PATH_GLIB_2_0
AC_PATH_XTRA
68 69 70 71 72

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT

73
GLIB_GSETTINGS
74 75 76

GLIB_COMPILE_RESOURCES=`$PKG_CONFIG gio-2.0 --variable=glib_compile_resources`
AC_SUBST(GLIB_COMPILE_RESOURCES)
77 78 79
GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
AC_SUBST(GLIB_GENMARSHAL)

80
TPAW_ARG_VALGRIND
81

82 83 84 85 86 87 88 89

# -----------------------------------------------------------
# Error flags
# -----------------------------------------------------------
AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)

AC_ARG_ENABLE(Werror,
90 91
  AS_HELP_STRING([--disable-Werror],
                 [compile without -Werror (normally enabled in development builds)]),
92 93 94 95 96 97 98 99 100 101
    werror=$enableval, :)

AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
AS_COMPILER_FLAG(-Wno-missing-field-initializers,
        wno_missing_field_initializers=yes,
        wno_missing_field_initializers=no)
AS_COMPILER_FLAG(-Wno-unused-parameter,
        wno_unused_parameter=yes,
        wno_unused_parameter=no)

102 103 104 105 106 107 108 109 110 111
if test "x$enable_unreleased_checks" = "xyes"; then
    if test x$werror = xyes; then
        ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
    fi
    if test x$wextra = xyes -a \
        x$wno_missing_field_initializers = xyes -a \
        x$wno_unused_parameter = xyes; then
        ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
    fi
fi
112 113 114 115 116

AS_COMPILER_FLAG(-Wdeclaration-after-statement, ERROR_CFLAGS="$ERROR_CFLAGS -Wdeclaration-after-statement")
AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
117
AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
118 119 120

AC_SUBST(ERROR_CFLAGS)

121 122 123 124 125 126 127 128 129 130 131
AC_ARG_ENABLE(gprof,
            AS_HELP_STRING([--enable-gprof=@<:@no/yes@:>@],
            [build with support for gprof]),,
            [enable_gprof=no])
if test "x$enable_gprof" != "xno" ; then
    CFLAGS="$CFLAGS -pg"
    LDFLAGS="$LDFLAGS -pg"
fi

AC_SUBST(LDFLAGS)

132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
# -----------------------------------------------------------
# Allow to overwrite where to install icons and other data
# files
# -----------------------------------------------------------
AC_ARG_WITH([pkgdatadir],
            AS_HELP_STRING([--with-pkgdatadir],
                           [set a different directory where to install the icon]),,
            with_pkgdatadir=)

if test x"$with_pkgdatadir" != x"" ; then
    real_pkgdatadir="${with_pkgdatadir}"
else
    real_pkgdatadir="${datarootdir}/${PACKAGE_NAME}"
fi
AC_SUBST(real_pkgdatadir)

148 149 150
# -----------------------------------------------------------
# Pkg-Config dependency checks
# -----------------------------------------------------------
151

152
PKG_CHECK_MODULES(TPAW,
153
[
154
   dbus-glib-1
Emilio Pozuelo Monfort's avatar
Emilio Pozuelo Monfort committed
155
   glib-2.0 >= $GLIB_REQUIRED
156
   gio-2.0 >= $GLIB_REQUIRED
157
   libsecret-1 >= $LIBSECRET_REQUIRED
158
   gobject-2.0
159
   libxml-2.0
160
   telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
161
   x11
162
   gtk+-3.0 >= $GTK_REQUIRED
163 164
])

165 166 167 168 169
# -----------------------------------------------------------
# UOA configuration bits
# -----------------------------------------------------------
TPAW_UOA_PROVIDER="im.telepathy.Account.Storage.UOA"
AC_DEFINE_UNQUOTED(TPAW_UOA_PROVIDER, "$TPAW_UOA_PROVIDER",
170
   [Name of provider for accounts imported from libaccounts])
171
AC_SUBST(TPAW_UOA_PROVIDER)
172

173
# -----------------------------------------------------------
174 175 176 177
# Enable debug
# -----------------------------------------------------------

AC_ARG_ENABLE(debug,
178 179
  AS_HELP_STRING([--disable-debug],
                 [compile without debug code]),
180 181 182 183 184 185 186
    enable_debug=$enableval, enable_debug=yes )

if test x$enable_debug = xyes; then
  AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
fi

# -----------------------------------------------------------
187 188
# Language Support
# -----------------------------------------------------------
189
IT_PROG_INTLTOOL([0.50.0])
190

191
GETTEXT_PACKAGE=tpaw
192 193 194
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])

195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
# -----------------------------------------------------------
# gudev
# -----------------------------------------------------------
AC_ARG_ENABLE(gudev,
              AS_HELP_STRING([--enable-gudev=@<:@no/yes/auto@:>@],
                             [build with gudev support]), ,
                             enable_gudev=auto)

if test "x$enable_gudev" != "xno"; then

   PKG_CHECK_MODULES(UDEV, [gudev-1.0],
        have_gudev="yes", have_gudev="no")

   if test "x$have_gudev" = "xyes"; then
      AC_DEFINE(HAVE_UDEV, 1, [Define if you have gudev])
   fi
else
   have_gudev=no
fi

if test "x$enable_gudev" = "xyes" -a "x$have_gudev" != "xyes"; then
216 217 218
   AC_MSG_ERROR([Could not find gudev dependencies:

$UDEV_PKG_ERRORS])
219 220 221
fi
AM_CONDITIONAL(HAVE_UDEV, test "x$have_gudev" = "xyes")

222
# -----------------------------------------------------------
223
# Cheese (optional dependency for avatar selection)
224
# -----------------------------------------------------------
225
AC_ARG_WITH([cheese],
226 227
            AS_HELP_STRING([--with-cheese],
                           [enable cheese webcam support]),,
228 229 230
            with_cheese=auto)

if test x"$with_cheese" != x"no" ; then
231
   PKG_CHECK_MODULES(CHEESE, cheese-gtk >= CHEESE_GTK_REQUIRED, [have_cheese=yes], [have_cheese=no])
232 233 234 235
   if test x${have_cheese} = xyes; then
     AC_DEFINE(HAVE_CHEESE, 1, [Define to 1 to enable cheese webcam support])
   fi
   if test x${with_cheese} = xyes && test x${have_cheese} = xno; then
236 237 238
     AC_MSG_ERROR([Cheese configured but not found:

$CHEESE_PKG_ERRORS])
239 240 241 242 243 244
   fi
else
   have_cheese=no
fi
AM_CONDITIONAL(BUILD_CHEESE, test x${have_cheese} = xyes)

245 246 247 248 249 250 251 252 253 254 255 256
# -----------------------------------------------------------
# ubuntu-online-accounts support
# -----------------------------------------------------------
AC_ARG_ENABLE(ubuntu-online-accounts,
              AS_HELP_STRING([--enable-ubuntu-online-accounts=@<:@no/yes/auto@:>@],
                             [build Ubuntu Online Accounts plugins]), ,
                             enable_ubuntu_online_accounts=auto)

if test "x$enable_ubuntu_online_accounts" != "xno"; then
   PKG_CHECK_MODULES(UOA,
    [
       account-plugin
257
       mission-control-plugins >= $MC_PLUGINS_REQUIRED
258
       libaccounts-glib >= $LIBACCOUNTS_REQUIRED
259
       libsignon-glib >= $LIBSIGNON_REQUIRED
260
    ], have_uoa="yes", have_uoa="no")
261 262 263 264 265 266 267 268

   # provider plugin dir
   AC_MSG_CHECKING([Accounts provider plugin dir])
   ACCOUNTS_PROVIDER_PLUGIN_DIR=`pkg-config --variable=provider_plugindir account-plugin`

   AC_MSG_RESULT([$ACCOUNTS_PROVIDER_PLUGIN_DIR])
   AC_SUBST(ACCOUNTS_PROVIDER_PLUGIN_DIR)

269 270 271 272 273 274 275
   # app plugin dir
   AC_MSG_CHECKING([Accounts provider app plugin dir])
   ACCOUNTS_APP_PLUGIN_DIR=`pkg-config --variable=application_plugindir account-plugin`

   AC_MSG_RESULT([$ACCOUNTS_APP_PLUGIN_DIR])
   AC_SUBST(ACCOUNTS_APP_PLUGIN_DIR)

276 277 278 279 280 281 282 283 284 285 286 287 288
   # provider files dir
   AC_MSG_CHECKING([Accounts provider files dir])
   ACCOUNTS_PROVIDER_FILES_DIR=`pkg-config --variable=providerfilesdir libaccounts-glib`

   AC_MSG_RESULT([$ACCOUNTS_PROVIDER_FILES_DIR])
   AC_SUBST(ACCOUNTS_PROVIDER_FILES_DIR)

   # service files dir
   AC_MSG_CHECKING([Accounts service files dir])
   ACCOUNTS_SERVICE_FILES_DIR=`pkg-config --variable=servicefilesdir libaccounts-glib`

   AC_MSG_RESULT([$ACCOUNTS_SERVICE_FILES_DIR])
   AC_SUBST(ACCOUNTS_SERVICE_FILES_DIR)
289 290 291 292 293 294 295 296

   # application files dir
   AC_MSG_CHECKING([Accounts applications files dir])
   ACCOUNTS_APPLICATION_FILES_DIR=`pkg-config --variable=applicationfilesdir libaccounts-glib`

   AC_MSG_RESULT([$ACCOUNTS_APPLICATION_FILES_DIR])
   AC_SUBST(ACCOUNTS_APPLICATION_FILES_DIR)

297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
else
   have_uoa=no
fi

if test "x$enable_ubuntu_online_accounts" = "xyes" -a "x$have_uoa" != "xyes"; then
   AC_MSG_ERROR([Could not find Ubuntu Online Accounts dependencies:

$UOA_PKG_ERRORS])
fi

if test "x$have_uoa" = "xyes"; then
   AC_DEFINE(HAVE_UOA, 1, [Define to 1 to build Ubuntu Online Accounts plugins])
fi

AM_CONDITIONAL(HAVE_UOA, test "x$have_uoa" = "xyes")

313 314 315 316 317 318 319 320
if test "x$have_uoa" = "xyes" -o "x$have_goa" = "xyes"; then
   AC_MSG_CHECKING([Mission Control plugins dir])
   MISSION_CONTROL_PLUGINS_DIR=${libdir}/mission-control-plugins.`pkg-config --variable=MCP_ABI_VERSION mission-control-plugins`

   AC_MSG_RESULT([$MISSION_CONTROL_PLUGINS_DIR])
   AC_SUBST(MISSION_CONTROL_PLUGINS_DIR)
fi

321 322 323 324
# -----------------------------------------------------------
# Coding style checks
# -----------------------------------------------------------
AC_ARG_ENABLE(coding-style-checks,
325
  AS_HELP_STRING([--disable-coding-style-checks],
326
                 [do not check coding style using grep]),
327 328
    [ENABLE_CODING_STYLE_CHECKS=$enableval],
    [ENABLE_CODING_STYLE_CHECKS=yes])
329 330

AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
331
# -----------------------------------------------------------
332

333
AC_CONFIG_FILES([
334
   Makefile
Marco Barisione's avatar
Marco Barisione committed
335
   telepathy-account-widgets-uninstalled.pc
336
   data/Makefile
337
   data/icons/Makefile
338
   po/Makefile.in
339
   tp-account-widgets/Makefile
340
   tools/Makefile
341
])
342
AC_OUTPUT
343 344 345 346 347

echo "
Configure summary:

	Compiler....................:  ${CC}
348
	Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
349
	Linker Flags................:  ${LDFLAGS}
350
	Prefix......................:  ${prefix}
351
	Data directory .............:  ${real_pkgdatadir}
352
	Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
353
	Unreleased version checks...:  ${enable_unreleased_checks}
354

355
    Features:
356
	Cheese webcam support ......:  ${have_cheese}
357
	Camera monitoring...........:  ${have_gudev}
358
	Ubuntu Online plugins.......:  ${have_uoa}
359
"