configure.ac 9.98 KB
Newer Older
Jonh Wendell's avatar
Jonh Wendell committed
1
# Vinagre autoconf
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
2

Jonh Wendell's avatar
Jonh Wendell committed
3
AC_PREREQ([2.64])
4
AC_INIT([vinagre],[2.91.8],[https://bugzilla.gnome.org/enter_bug.cgi?product=vinagre],[vinagre],[http://projects.gnome.org/vinagre/])
Jonh Wendell's avatar
Jonh Wendell committed
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
AC_CONFIG_SRCDIR([vinagre/vinagre-main.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

# Checks for header files.
AC_CHECK_HEADERS([sys/uio.h sys/param.h sys/un.h arpa/inet.h stropts.h fcntl.h limits.h locale.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h termios.h unistd.h utmp.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT64_T

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([dup2 memset putenv select setlocale socket strchr strerror strstr getpt posix_openpt grantpt unlockpt ptsname ptsname_r])

AM_INIT_AUTOMAKE([1.10 -Wno-portability])
LT_PREREQ([2.2.6])
AC_CONFIG_MACRO_DIR([m4])

GNOME_COMPILE_WARNINGS([maximum])
GNOME_MAINTAINER_MODE_DEFINES
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
39

40
41
42
VINAGRE_API_VERSION=1.0
AC_SUBST(VINAGRE_API_VERSION)

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
43
44
AM_MAINTAINER_MODE

45
46
47
# Use the silent-rules feature when possible.
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
48
49
50
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")

Jonh Wendell's avatar
Jonh Wendell committed
51
AC_SEARCH_LIBS([strerror],[cposix])
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
52
53
AC_PROG_CC
AC_HEADER_STDC
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
54

Jonh Wendell's avatar
Jonh Wendell committed
55
56
LT_INIT([disable-static])
AM_PROG_CC_C_O
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
57

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
58
59
60
#*******************************************************************************
# Internationalization
#*******************************************************************************
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
61
62
63
64
GETTEXT_PACKAGE=vinagre
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])

Jonh Wendell's avatar
Jonh Wendell committed
65
IT_PROG_INTLTOOL([0.40.0])
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
66
67
AM_GLIB_GNU_GETTEXT

68
GNOME_DOC_INIT
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
69

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
70
71
72
#*******************************************************************************
# Check required GNOME libraries
#*******************************************************************************
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
73

Jonh Wendell's avatar
Jonh Wendell committed
74
GLIB_REQUIRED=2.25.11
Matthias Clasen's avatar
Matthias Clasen committed
75
GTK_REQUIRED=2.99.3
76
GTHREAD_REQUIRED=2.0.0
Matthias Clasen's avatar
Matthias Clasen committed
77
GTK_VNC_REQUIRED=0.4.3
Marc-André Lureau's avatar
Marc-André Lureau committed
78
SPICE_GTK_REQUIRED=0.5
Jonh Wendell's avatar
Jonh Wendell committed
79
AVAHI_REQUIRED=0.6.26
Jonh Wendell's avatar
Jonh Wendell committed
80
PANEL_REQUIRED_VERSION=2.0.0
81
TELEPATHY_GLIB_REQUIRED=0.11.6
82
XML_REQUIRED=2.6.31
83
VTE_REQUIRED=0.20
84
PEAS_REQUIRED=0.7.2
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
85

86
87
# Check for avahi
AC_ARG_ENABLE(avahi,
Jonh Wendell's avatar
Jonh Wendell committed
88
              AS_HELP_STRING([--disable-avahi],[Do not use avahi for auto-discover machines [default=no]]),
89
              enable_avahi=${enableval},
90
91
92
93
              enable_avahi=yes)

if test "x$enable_avahi" = "xyes" ; then
  PKG_CHECK_MODULES(AVAHI,\
Jonh Wendell's avatar
Jonh Wendell committed
94
  avahi-ui-gtk3 >= $AVAHI_REQUIRED\
95
96
97
98
99
100
101
  avahi-gobject >= $AVAHI_REQUIRED)
  AC_SUBST(AVAHI_CFLAGS)
  AC_SUBST(AVAHI_LIBS)
  AC_DEFINE([VINAGRE_ENABLE_AVAHI],[1],[We want avahi support])
fi
AM_CONDITIONAL(AVAHI, test "x$enable_avahi" = "xyes")

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
102
103
PKG_CHECK_MODULES(VINAGRE, \ 
  glib-2.0 >= $GLIB_REQUIRED \
104
  gio-2.0 >= $GLIB_REQUIRED \
105
  gio-unix-2.0 >= $GLIB_REQUIRED \
Jonh Wendell's avatar
Jonh Wendell committed
106
  gtk+-3.0 >= $GTK_REQUIRED \
107
  gthread-2.0 >= $GTHREAD_REQUIRED \
108
  gnome-keyring-1 \
109
  libxml-2.0 >= $XML_REQUIRED \
Jonh Wendell's avatar
Jonh Wendell committed
110
  libpeas-1.0 >= $PEAS_REQUIRED \
111
  libpeas-gtk-1.0 >= $PEAS_REQUIRED
112
)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
113
114
115
AC_SUBST(VINAGRE_CFLAGS)
AC_SUBST(VINAGRE_LIBS)

116
PKG_CHECK_MODULES(VNC, \
117
  gtk-vnc-2.0 >= $GTK_VNC_REQUIRED \
Jonh Wendell's avatar
Jonh Wendell committed
118
  gtk+-3.0 >= $GTK_REQUIRED \
119
  libxml-2.0 >= $XML_REQUIRED
120
121
122
123
)
AC_SUBST(VNC_CFLAGS)
AC_SUBST(VNC_LIBS)

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
dnl ****************************
dnl *** Checks for pty stuff ***
dnl ****************************

# Pull in the right libraries for various functions which might not be
# bundled into an exploded libc.
AC_CHECK_FUNC(socketpair,[have_socketpair=1],AC_CHECK_LIB(socket,socketpair,[have_socketpair=1; LIBS="$LIBS -lsocket"]))
if test x$have_socketpair = x1 ; then
	AC_DEFINE(HAVE_SOCKETPAIR,1,[Define if you have the socketpair function.])
fi

AC_SEARCH_LIBS(login_tty, util, [AC_DEFINE([HAVE_LOGIN_TTY],[],[Whether login_tty is available])])

dnl ****************************
dnl *** Checks for SSH stuff ***
dnl ****************************

AC_PATH_PROG(SSH_PROGRAM, ssh, "ssh")

143
144
145
146
147
148
149
150
AC_ARG_ENABLE(ssh,
              AS_HELP_STRING([--enable-ssh],
                             [Enable SSH plugin (default=no)]),
              enable_ssh=${enableval},
              enable_ssh=no)

if test "x$enable_ssh" = "xyes" ; then
  PKG_CHECK_MODULES(SSH,\
151
  vte-2.90 >= $VTE_REQUIRED \
152
  libxml-2.0 >= $XML_REQUIRED)
153
154
155
156
157
158
  AC_SUBST(VTE_CFLAGS)
  AC_SUBST(VTE_LIBS)
  AC_DEFINE([VINAGRE_ENABLE_SSH],[1],[We want ssh support])
fi
AM_CONDITIONAL(SSH, test "x$enable_ssh" = "xyes")

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
dnl ****************************
dnl *** Checks for RDP stuff ***
dnl ****************************

AC_ARG_ENABLE(rdp,
              AS_HELP_STRING([--enable-rdp],
                             [Enable RDP plugin (default=yes)]),
              enable_rdp=${enableval},
              enable_rdp=yes)

if test "x$enable_rdp" = "xyes" ; then
  AC_PATH_PROG(RDESKTOP_PROGRAM, rdesktop, "rdesktop")
  PKG_CHECK_MODULES(RDP,\
  libxml-2.0 >= $XML_REQUIRED)
  AC_SUBST(RDP_CFLAGS)
  AC_SUBST(RDP_LIBS)
  AC_DEFINE([VINAGRE_ENABLE_RDP],[1],[We want rdp support])
fi
AM_CONDITIONAL(RDP, test "x$enable_rdp" = "xyes")

179
180
181
182
183
184
185
186
187
# Check for telepathy
AC_ARG_ENABLE(telepathy,
              AS_HELP_STRING([--enable-telepathy=@<:@no/yes/auto@:>@],
                             [Enable telepathy checking]), ,
                             enable_telepathy=auto)

if test "x$enable_telepathy" != "xno"; then
   PKG_CHECK_MODULES(TELEPATHY,
   [
188
      dbus-glib-1 \
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
      telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
   ], have_telepathy="yes", have_telepathy="no")
   if test "x$have_telepathy" = "xyes"; then
      AC_SUBST(TELEPATHY_CFLAGS)
      AC_SUBST(TELEPATHY_LIBS)
      AC_DEFINE(HAVE_TELEPATHY, [], [Define if you have telepathy])
   fi
else
   have_telepathy=no
fi

if test "x$enable_telepathy" = "xyes" -a "x$have_telepathy" != "xyes"; then
   AC_MSG_ERROR([Couldn't find telepathy dependencies.])
fi

AM_CONDITIONAL(TELEPATHY, test "x$have_telepathy" = "xyes")

206
207
208
209
210
211
212
213
214
215
216
217
# Enable/disable gnome-panel applet
AC_ARG_ENABLE(applet,
              AS_HELP_STRING([--disable-applet], [Do not build the panel applet @<:@default=enabled@:>@]),
              enable_applet=$enableval,
              enable_applet=yes)

if test "x$enable_applet" = "xyes";then
   PKG_CHECK_MODULES(APPLET, libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION)
   AC_SUBST(APPLET_CFLAGS)
   AC_SUBST(APPLET_LIBS)
fi
AM_CONDITIONAL(APPLET, test "x$enable_applet" = "xyes")
Jonh Wendell's avatar
Jonh Wendell committed
218

Marc-André Lureau's avatar
Marc-André Lureau committed
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
AC_ARG_ENABLE(spice,
              AS_HELP_STRING([--enable-spice],
                             [Enable SPICE plugin (default=yes)]),
              enable_spice=${enableval},
              enable_spice=yes)

if test "x$enable_spice" = "xyes" ; then
  PKG_CHECK_MODULES(SPICE,\
  spice-client-gtk-3.0 >= $SPICE_GTK_REQUIRED)
  AC_SUBST(SPICE_CFLAGS)
  AC_SUBST(SPICE_LIBS)
  AC_DEFINE([VINAGRE_ENABLE_SPICE],[1],[We want spice support])
fi
AM_CONDITIONAL(SPICE, test "x$enable_spice" = "xyes")

234
235
GLIB_GSETTINGS

236
237
dnl Check for bind in libsocket (needed on Solaris)
AC_CHECK_LIB(socket, bind)
Jonh Wendell's avatar
Jonh Wendell committed
238

239
240
241
242
243
244
245
246
247
dnl define a MAINT-like variable REBUILD which is set
dnl if Perl, so autogenerated sources can be rebuilt
AC_PATH_PROGS(PERL, perl5 perl)
AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
     test -n "$PERL" && \
     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
  REBUILD=
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
248
fi
249
AC_SUBST(REBUILD)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
250

Jorge Pereira's avatar
Jorge Pereira committed
251
# Plugins
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
252
#*******************************************************************************
Jorge Pereira's avatar
Jorge Pereira committed
253
#
254
255
256
257
dnl ****************************
dnl *** Checks for ifaddrs.h ***
dnl ****************************
AC_CHECK_HEADER(ifaddrs.h)
Jonh Wendell's avatar
Jonh Wendell committed
258
AM_CONDITIONAL(SELF_IFADDRS, test "x$ac_cv_header_ifaddrs_h" != "xyes")
259
260
261

dnl RFC2553 introduce sockaddr_storage as ifa_addr member in ifaddrs structure
dnl Not all distros follow this.
262
if test "x$ac_cv_header_ifaddrs_h" = "xyes"; then
263
264
265
266
267
268
269
270
271
272
273
274
275
        AC_DEFINE(HAVE_IFADDRS_H, [1], [Define if we have system ifaddrs.h])
        AC_TRY_COMPILE([
          #include <ifaddrs.h>
          #include <net/if.h>
          ],[
          struct ifaddrs *myaddrs;
          getifaddrs (&myaddrs);
          if (myaddrs->ifa_addr->ss_family == AF_INET) {
          }
        ], have_sockaddr_storage=yes, have_sockaddr_storage=no)
        if test "x$have_sockaddr_storage" = "xyes"; then
           AC_DEFINE(RFC2553, [], [Define to if follow RFC2553 ])
        fi
276
277
fi

278

279
dnl active plugins for org.gnome.Vinagre.gschema.xml
Jonh Wendell's avatar
Jonh Wendell committed
280
ACTIVE_PLUGINS="vnc"
281
282
283
if test "x$enable_ssh" = "xyes" ; then
ACTIVE_PLUGINS="$ACTIVE_PLUGINS,ssh"
fi
Jorge Pereira's avatar
Jorge Pereira committed
284
AC_SUBST(ACTIVE_PLUGINS)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
285

286
VINAGRE_IMPLIB="-lvinagre-${VINAGRE_API_VERSION}"
Jorge Pereira's avatar
Jorge Pereira committed
287
288
289
290
291
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"

AC_SUBST(VINAGRE_IMPLIB)
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)

292
VINAGRE_PLUGINS_DATA_DIR="$datadir/vinagre-1/plugins"
Jorge Pereira's avatar
Jorge Pereira committed
293
294
AC_SUBST(VINAGRE_PLUGINS_DATA_DIR)

295
VINAGRE_PLUGINS_LIBS_DIR="$libdir/vinagre-1/plugins"
Jorge Pereira's avatar
Jorge Pereira committed
296
297
AC_SUBST(VINAGRE_PLUGINS_LIBS_DIR)

298
299
300
301
302
303
304
305
306
307
# Introspection
GOBJECT_INTROSPECTION_CHECK([0.9.3])

if test "$found_introspection" = "yes"; then
	enable_introspection=yes
	AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable GObject Introspection])
else
	enable_introspection=no
fi

Jorge Pereira's avatar
Jorge Pereira committed
308
#*******************************************************************************
Jonh Wendell's avatar
Jonh Wendell committed
309
AC_CONFIG_FILES([
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
310
311
312
Makefile
data/Makefile
data/vinagre.desktop.in
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
313
data/vinagre-file.desktop.in
314
data/vinagre.pc
315
data/icons/Makefile
316
help/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
317
po/Makefile.in
Jorge Pereira's avatar
Jorge Pereira committed
318
plugins/Makefile
Jonh Wendell's avatar
Jonh Wendell committed
319
plugins/vnc/Makefile
320
plugins/ssh/Makefile
321
plugins/rdp/Makefile
Marc-André Lureau's avatar
Marc-André Lureau committed
322
plugins/spice/Makefile
Jonh Wendell's avatar
Jonh Wendell committed
323
plugins/reverse-vnc/Makefile
Jonh Wendell's avatar
Jonh Wendell committed
324
plugins/im-status/Makefile
Jorge Pereira's avatar
Jorge Pereira committed
325
326
vinagre/Makefile
vinagre/view/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
327
])
Jonh Wendell's avatar
Jonh Wendell committed
328
AC_OUTPUT
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
329
330
331
332

#*******************************************************************************

echo "
333
334
335

This is vinagre version AC_PACKAGE_VERSION

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
336
337
338
339
Configure summary:

	Compiler ...................:  ${CC} 
	Compiler Flags .............:  ${CFLAGS}
340
	GObject Introspection.......:  $enable_introspection
341
342

	Avahi enabled ..............:  ${enable_avahi}
343
	GNOME Panel applet..........:  ${enable_applet}
344
	Telepathy support ..........:  ${have_telepathy}
345
	SSH plugin .................:  ${enable_ssh}
346
	RDP plugin .................:  ${enable_rdp}
Marc-André Lureau's avatar
Marc-André Lureau committed
347
	Spice plugin ...............:  ${enable_spice}
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
348
"