~ubuntu-branches/ubuntu/raring/vino/raring-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
AC_PREREQ([2.64])
AC_INIT([Vino], [3.5.90], [http://bugzilla.gnome.org/enter_bug.cgi?product=vino], [vino], [http://live.gnome.org/Vino])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([server/vino-fb.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.11.1 -Wall check-news dist-xz no-define no-dist-gzip nostdinc subdir-objects])
AM_SILENT_RULES([yes])

AC_PROG_CC
AM_PROG_CC_C_O

# Check whether to enable HTTP server support
AC_ARG_ENABLE([http-server],
  [AS_HELP_STRING([--disable-http-server],
   [build with an HTTP server for serving a Java applet client @<:@default=yes@:>@])],
   [],
   [enable_http_server=yes])

AS_IF([test "x$enable_http_server" = "xyes"],
  [AC_DEFINE([VINO_ENABLE_HTTP_SERVER], [], [Enable HTTP server support])])

AM_CONDITIONAL([VINO_ENABLE_HTTP_SERVER], [test "x$enable_http_server" = "xyes"])

# GNOME common
AM_MAINTAINER_MODE([enable])
GNOME_MAINTAINER_MODE_DEFINES
GNOME_COMPILE_WARNINGS([maximum])
GNOME_DEBUG_CHECK

LT_PREREQ([2.2.6])
LT_INIT([disable-static])

PKG_PROG_PKG_CONFIG([0.16])

AC_PROG_SED

AC_MSG_CHECKING([for glib-genmarshal script])
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AS_IF([test "x$GLIB_GENMARSHAL" = "x"],
  [AC_MSG_ERROR([glib-genmarshal not listed in glib-2.0 pkg-config file])],
  [AC_SUBST([GLIB_GENMARSHAL])
    AC_MSG_RESULT([$GLIB_GENMARSHAL])])

AC_MSG_CHECKING([for glib-mkenums script])
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AS_IF([test "x$GLIB_MKENUMS" = "x"],
  [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
  [AC_SUBST([GLIB_MKENUMS])
    AC_MSG_RESULT([$GLIB_MKENUMS])])

# Check for telepathy-glib
TELEPATHY_GLIB_DEPS="dbus-glib-1 telepathy-glib >= 0.18.0"

AC_ARG_WITH([telepathy],
  [AS_HELP_STRING([--without-telepathy],
    [ignore the presence of telepathy and disable it])])

AS_IF([test "x$with_telepathy" != "xno"],
  [PKG_CHECK_EXISTS([$TELEPATHY_GLIB_DEPS],
    [have_telepathy=yes],
    [have_telepathy=no])],
  [have_telepathy=no])

AS_IF([test "x$have_telepathy" = "xyes"],
  [AC_DEFINE([VINO_HAVE_TELEPATHY_GLIB], [], [Build with telepathy support])],
  [TELEPATHY_GLIB_DEPS=""
    AS_IF([test "x$with_telepathy" = "xyes"],
    [AC_MSG_ERROR([telepathy support requested but not found])])])

AM_CONDITIONAL([VINO_HAVE_TELEPATHY_GLIB], [test "x$have_telepathy" = "xyes"])

# Check for libnotify
LIBNOTIFY_DEPS="libnotify >= 0.4.4"
LIBNOTIFY_0_7_DEPS="libnotify >= 0.7.0"

AC_ARG_WITH([libnotify],
  [AS_HELP_STRING([--without-libnotify],
    [ignore the presence of libnotify and disable it])])

AS_IF([test "x$with_libnotify" != "xno"],
  [PKG_CHECK_EXISTS([$LIBNOTIFY_DEPS],
    [have_libnotify=yes],
    [have_libnotify=no])],
  [have_libnotify=no])

AS_IF([test "x$have_libnotify" = "xyes"],
  [AC_DEFINE([VINO_HAVE_LIBNOTIFY], [], [Build with libnotify support])
    PKG_CHECK_EXISTS([$LIBNOTIFY_0_7_DEPS],
      [have_libnotify_0_7=yes],
      [have_libnotify_0_7=no])
    AS_IF([test "x$have_libnotify_0_7" = "xyes"],
      [LIBNOTIFY_DEPS="$LIBNOTIFY_0_7_DEPS"
        AC_DEFINE([VINO_HAVE_LIBNOTIFY_0_7], [], [Build with libnotify 0.7 or greater support])])],
  [LIBNOTIFY_DEPS=""
    AS_IF([test "x$have_libnotify" = "xyes"],
    [AC_MSG_ERROR([libnotify support requested but not found])])])

dnl -- check for application indicators ---------------------------------------
APPINDICATOR_VERSION=0.0.7

AC_ARG_ENABLE(appindicator,
			AS_HELP_STRING([--enable-appindicator],[Build support for application indicators [[default=yes]]]),
			[enable_appindicator=$enableval],
			[enable_appindicator="yes"])

if test x$enable_appindicator = xyes ; then
	PKG_CHECK_MODULES(APP_INDICATOR,
			appindicator3-0.1 >= $APPINDICATOR_VERSION)
	AC_SUBST(APP_INDICATOR_CFLAGS)
	AC_SUBST(APP_INDICATOR_LIBS)
	AC_DEFINE(VINO_ENABLE_APP_INDICATOR, 1, [Have AppIndicator])
fi
AM_CONDITIONAL(VINO_ENABLE_APP_INDICATOR, test x"$enable_appindicator" = xyes)

# Check for NetworkManager
NETWORKMANAGER_DEPS="NetworkManager >= 0.7"

AC_ARG_WITH([network-manager],
  [AS_HELP_STRING([--without-network-manager],
    [ignore the presence of NetworkManager and disable it])])

AS_IF([test "x$with_network_manager" != "xno"],
  [PKG_CHECK_EXISTS([$NETWORKMANAGER_DEPS],
    [have_network_manager=yes],
    [have_network_manager=no])],
  [have_network_manager=no])

AS_IF([test "x$have_network_manager" = "xyes"],
  [AC_DEFINE([VINO_HAVE_NETWORKMANAGER], [], [Build with NetworkManager support])],
  [NETWORKMANAGER_DEPS=""
    AS_IF([test "x$with_network_manager" = "xyes"],
    [AC_MSG_ERROR([NetworkManager support requested but not found])])])

# Check for secret
SECRET_DEPS="libsecret-1"

AC_ARG_WITH([secret],
  [AS_HELP_STRING([--without-secret],
    [ignore the presence of secret and disable it])])

AS_IF([test "x$with_secret" != "xno"],
  [PKG_CHECK_EXISTS([$LIBSECRET_DEPS],
    [have_secret=yes],
    [have_secret=no])],
  [have_secret=no])

AS_IF([test "x$have_secret" != "xno"],
  [AC_DEFINE([VINO_HAVE_SECRET], [], [Build with secret support])],
  [SECRET_DEPS=""
    AS_IF([test "x$with_secret" = "xyes"],
    [AC_MSG_ERROR([secret support requested but not found])])])

# Check for X11
AC_PATH_XTRA

AS_IF([test "x$no_x" = "xyes"],
  [AC_MSG_ERROR([X development libraries not found])],
  [AC_SUBST([X_LIBS], ["$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"])])

# Check for gnutls
GNUTLS_DEPS="gnutls >= 2.2.0"

AC_ARG_WITH([gnutls],
  [AS_HELP_STRING([--without-gnutls],
    [ignore gnutls support and disable it])])

AS_IF([test "x$with_gnutls" != "xno"],
  [PKG_CHECK_EXISTS([$GNUTLS_DEPS],
    [have_gnutls=yes],
    [have_gnutls=no])],
  [have_gnutls=no
    AC_MSG_WARN([gnutls was not found. You may want to get it from ftp://ftp.gnutls.org/pub/gnutls/])])

AS_IF([test "x$have_gnutls" = "xyes"],
  [AC_DEFINE([VINO_HAVE_GNUTLS], [], [Build with gnutls support])],
  [GNUTLS_DEPS=""
    AS_IF([test "x$with_gnutls" = "xyes"],
    [AC_MSG_ERROR([gnutls support was requested but not found])])])

# Check for gcrypt
GCRYPT_VERSION=1.1.90

AC_ARG_WITH([gcrypt],
  [AS_HELP_STRING([--without-gcrypt],
    [ignore gcrypt support and disable it])])

AS_IF([test "x$with_gcrypt" != "xno"],
  [AM_PATH_LIBGCRYPT([$GCRYPT_VERSION],
    [have_gcrypt=yes],
    [have_gcrypt=no])],
  [have_gcrypt=no
    AC_MSG_WARN([gcrypt was not found. You may want to get it from ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/])])

AS_IF([test "x$have_gcrypt" = "xyes"],
  [AC_DEFINE([VINO_HAVE_GCRYPT], [], [Build with gcrypt support])],
  [AS_IF([test "x$with_gcrypt" = "xyes"],
    [AC_MSG_ERROR([gcrypt support requested but not found])])])

# Check for Avahi
AVAHI_DEPS="avahi-client >= 0.6 avahi-glib >= 0.6"

AC_ARG_WITH([avahi],
  [AS_HELP_STRING([--without-avahi],
    [ignore avahi support and disable it])])

AS_IF([test "x$with_avahi" != "xno"],
  [PKG_CHECK_EXISTS([$AVAHI_DEPS],
    [have_avahi=yes],
    [have_avahi=no])],
  [have_avahi=no])

AS_IF([test "x$have_avahi" = "xyes"],
  [AC_DEFINE([VINO_HAVE_AVAHI], [], [Build with avahi support])],
  [AVAHI_DEPS=""
    AS_IF([test "x$with_avahi" = "xyes"],
    [AC_MSG_ERROR([avahi support requested but not found])])])

# Check for zlib
# TODO: Use pkg-config file installed by newer zlib releases
AC_ARG_WITH([zlib],
  [AS_HELP_STRING([--without-zlib],
    [ignore zlib support and disable it])])

AS_IF([test "x$with_zlib" != "xno"],
  [AC_CHECK_HEADER([zlib.h],
    [AC_CHECK_LIB([z], [deflate], [have_zlib=yes], [have_zlib=no])],
    [have_zlib=no])],
  [have_zlib=no])

AS_IF([test "x$have_zlib" = "xyes"],
  [AC_DEFINE([VINO_HAVE_ZLIB], [], [Build with zlib support])
    AC_SUBST([ZLIB_LIBS], [-lz])],
  [AS_IF([test "x$with_zlib" = "xyes"],
    [AC_MSG_ERROR([zlib support requested but not found])])])

# Check for jpeg, with deflate support
AC_ARG_WITH([jpeg],
  [AS_HELP_STRING([--without-jpeg],
    [ignore jpeg support and disable it])])

AS_IF([test "x$with_jpeg" != "xno"],
  [AC_CHECK_HEADER([jpeglib.h],
    [AC_CHECK_LIB([jpeg], [jpeg_CreateCompress], [have_jpeg=yes], [have_jpeg=no])],
    [have_jpeg=no])],
  [have_jpeg=no])

AS_IF([test "x$have_jpeg" = "xyes"],
  [AC_DEFINE([VINO_HAVE_JPEG], [], [Build with jpeg support])
    AC_SUBST([JPEG_LIBS], [-ljpeg])],
  [AS_IF([test "x$with_jpeg" = "xyes"],
    [AC_MSG_ERROR([jpeg support requested but not found])])])

# Internationalization
AC_SUBST([GETTEXT_PACKAGE],[$PACKAGE_TARNAME])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [gettext package])
IT_PROG_INTLTOOL([0.50.0])

# Check for XDAMAGE extension
AC_CHECK_HEADER([X11/extensions/Xdamage.h],
  [AC_CHECK_LIB([Xdamage], [XDamageQueryExtension],
    [AC_DEFINE([VINO_HAVE_XDAMAGE], [], [Defined if the DAMAGE X extension is present])
      AC_SUBST([XDAMAGE_LIBS], ["-lXdamage -lXfixes"])],
    [], [$X_LIBS])],
  [], [#include <X11/Xlib.h>])

# Check for MIT-SHM extension
AC_CHECK_HEADER([X11/extensions/XShm.h],
  [AC_CHECK_LIB([Xext], [XShmQueryExtension],
    [AC_DEFINE([VINO_HAVE_XSHM], [], [Defined if the MIT-SHM X extension is present])
      AC_SUBST([XSHM_LIBS], [-lXext])],
    [], [$X_LIBS])],
  [], [#include <X11/Xlib.h>])

# Check for XTest extension
AC_CHECK_HEADER([X11/extensions/XTest.h],
  [AC_CHECK_LIB([Xtst], [XTestQueryExtension],
    [AC_DEFINE([VINO_HAVE_XTEST], [], [Defined if the XTEST X extension is present])
      AC_SUBST([XTEST_LIBS], [-lXtst])],
    [], [$X_LIBS])])

# Check for XKB extension
AC_CHECK_HEADER([X11/XKBlib.h],
  [AC_CHECK_LIB([X11], [XkbQueryExtension],
    [AC_DEFINE([VINO_HAVE_XKB], [], [Defined if the XKB X extension is present])],
  [], [$X_LIBS])])

AC_CHECK_HEADERS([netinet/in.h sys/time.h fcntl.h unistd.h sys/socket.h ifaddrs.h])

# Check for getifaddrs
AM_CONDITIONAL([VINO_HAVE_SELF_IFADDRS], [test "x$ac_cv_header_ifaddrs_h" != "xyes"])

# RFC2553 introduce sockaddr_storage as ifa_addr member in ifaddrs structure
# Not all distros follow this.
AS_IF([test "x$ac_cv_header_ifaddrs_h" = "xyes"],
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    #include <net/if.h>
    #include <ifaddrs.h>
    ]], [[
    struct ifaddrs *myaddrs;
    getifaddrs (&myaddrs);
    if (myaddrs->ifa_addr->ss_family == AF_INET) {
    }
    ]])],
    [have_sockaddr_storage=yes],
    [have_sockaddr_storage=no])],
  [AS_IF([test "x$have_sockaddr_storage" = "xyes"],
    [AC_DEFINE([RFC2553], [], [Define if RFC2553 is followed])])])

AC_C_BIGENDIAN
AC_C_INLINE

AC_CHECK_LIB([resolv], [herror])
AC_SEARCH_LIBS([strerror],[cposix])
AC_CHECK_FUNCS([gettimeofday])

# Check for IPv6 support
AC_MSG_CHECKING([checking for IPv6 support])
AC_ARG_ENABLE([ipv6],
  [AS_HELP_STRING([--disable-ipv6],
    [ignore the presence of IPv6 support and disable it])],
    [],
    [enable_ipv6=yes])

AS_IF([test "x$enable_ipv6" != "xno"],
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    #include <sys/types.h>
    #include <sys/socket.h>
    ]], [[
      socket(AF_INET6, SOCK_STREAM, 0);
    ]])],
    [have_ipv6=yes],
    [have_ipv6=no])])

AS_IF([test "x$have_ipv6" = "xyes"],
  [AC_DEFINE([VINO_ENABLE_IPV6], [], [Define to enable IPv6 support])],
  [AS_IF([test "x$enable_ipv6" = "xyes"],
    [AC_MSG_ERROR([IPv6 support requested but not found])])])
AC_MSG_RESULT([$have_ipv6])

dnl ----------------------------------------------------------------------------
dnl
dnl Allow use of system miniupnp library

LIBUPNP_LIBS="-lminiupnpc"
AC_SUBST(LIBUPNP_LIBS)

# GNOME libraries
GTK_VERSION=3.0.0
GLIB_VERSION=2.17.0
GIO_VERSION=2.26
SOUP_VERSION=2.24.0

PKG_CHECK_MODULES([VINO_SERVER], [glib-2.0 >= $GLIB_VERSION gio-unix-2.0 gtk+-x11-3.0 >= $GTK_VERSION $TELEPATHY_GLIB_DEPS $LIBNOTIFY_DEPS $LIBSECRET_DEPS $NETWORKMANAGER_DEPS $GNUTLS_DEPS $AVAHI_DEPS])

PKG_CHECK_MODULES([VINO_CAPPLET], [glib-2.0 >= $GLIB_VERSION gio-2.0 >= $GIO_VERSION gtk+-3.0 >= $GTK_VERSION libsoup-2.4 >= $SOUP_VERSION $LIBSECRET_DEPS])

PKG_CHECK_MODULES([VINO_TOOLS], [glib-2.0 >= $GLIB_VERSION gio-2.0 >= $GIO_VERSION gobject-2.0 >= $GLIB_VERSION $LIBSECRET_DEPS])

# EGG stuff
PKG_CHECK_MODULES([EGG_SMCLIENT], [gtk+-3.0])

GLIB_GSETTINGS

AC_CONFIG_FILES([
Makefile
capplet/vino-preferences.desktop.in
po/Makefile.in
])

AC_OUTPUT