configure.ac 9.34 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])
Jonh Wendell's avatar
2.31.4    
Jonh Wendell committed
4
AC_INIT([vinagre],[2.31.4],[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
39
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_PATH_X
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
40

41
42
43
VINAGRE_API_VERSION=1.0
AC_SUBST(VINAGRE_API_VERSION)

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

46
47
48
# 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
49
50
51
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
52
AC_SEARCH_LIBS([strerror],[cposix])
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
53
54
AC_PROG_CC
AC_HEADER_STDC
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
55

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

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

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

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

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

75
GLIB_REQUIRED=2.17.0
76
GTK_REQUIRED=2.21.3
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
77
GCONF_REQUIRED=2.16.0
78
GTHREAD_REQUIRED=2.0.0
79
GTK_VNC_REQUIRED=0.3.10
80
AVAHI_REQUIRED=0.6.22
Jonh Wendell's avatar
Jonh Wendell committed
81
PANEL_REQUIRED_VERSION=2.0.0
82
TELEPATHY_GLIB_REQUIRED=0.11.6
83
XML_REQUIRED=2.6.31
84
VTE_REQUIRED=0.20
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
94
95
96
97
98
99
100
101
              enable_avahi=yes)

if test "x$enable_avahi" = "xyes" ; then
  PKG_CHECK_MODULES(AVAHI,\
  avahi-ui >= $AVAHI_REQUIRED\
  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. Santana's avatar
Jonh Wendell S. Santana committed
106
  gtk+-2.0 >= $GTK_REQUIRED \ 
Jonh Wendell S. Santana's avatar
Stuff    
Jonh Wendell S. Santana committed
107
  gconf-2.0 >= $GCONF_REQUIRED \
108
  gthread-2.0 >= $GTHREAD_REQUIRED \
109
  gnome-keyring-1 \
110
111
112
  libxml-2.0 >= $XML_REQUIRED \
  dbus-glib-1 \
  x11
113
)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
114
115
116
AC_SUBST(VINAGRE_CFLAGS)
AC_SUBST(VINAGRE_LIBS)

117
118
PKG_CHECK_MODULES(VNC, \
  gtk-vnc-1.0 >= $GTK_VNC_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
152
  vte >= $VTE_REQUIRED \
  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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# 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,
   [
      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")

205
206
207
208
209
210
211
212
213
214
215
216
# 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
217

Jonh Wendell's avatar
Jonh Wendell committed
218
219
220
221
222
223
224
dnl ================================================================
dnl GConf related settings
dnl ================================================================

AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

225
226
dnl Check for bind in libsocket (needed on Solaris)
AC_CHECK_LIB(socket, bind)
Jonh Wendell's avatar
Jonh Wendell committed
227

228
229
230
231
232
233
234
235
236
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
237
fi
238
AC_SUBST(REBUILD)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
239

Jorge Pereira's avatar
Jorge Pereira committed
240
# Plugins
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
241
#*******************************************************************************
Jorge Pereira's avatar
Jorge Pereira committed
242
#
243
244
245
246
dnl ****************************
dnl *** Checks for ifaddrs.h ***
dnl ****************************
AC_CHECK_HEADER(ifaddrs.h)
Jonh Wendell's avatar
Jonh Wendell committed
247
AM_CONDITIONAL(SELF_IFADDRS, test "x$ac_cv_header_ifaddrs_h" != "xyes")
248
249
250

dnl RFC2553 introduce sockaddr_storage as ifa_addr member in ifaddrs structure
dnl Not all distros follow this.
251
if test "x$ac_cv_header_ifaddrs_h" = "xyes"; then
252
253
254
255
256
257
258
259
260
261
262
263
264
        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
265
266
fi

267

Jorge Pereira's avatar
Jorge Pereira committed
268
dnl active plugins for vinagre.schemas
Jonh Wendell's avatar
Jonh Wendell committed
269
ACTIVE_PLUGINS="vnc"
270
271
272
if test "x$enable_ssh" = "xyes" ; then
ACTIVE_PLUGINS="$ACTIVE_PLUGINS,ssh"
fi
Jorge Pereira's avatar
Jorge Pereira committed
273
AC_SUBST(ACTIVE_PLUGINS)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
274

275
VINAGRE_IMPLIB="-lvinagre-${VINAGRE_API_VERSION}"
Jorge Pereira's avatar
Jorge Pereira committed
276
277
278
279
280
281
282
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
LOADER_LIBTOOL_FLAGS="-module -avoid-version"

AC_SUBST(VINAGRE_IMPLIB)
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
AC_SUBST(LOADER_LIBTOOL_FLAGS)

283
VINAGRE_PLUGINS_DATA_DIR="$datadir/vinagre-1/plugins"
Jorge Pereira's avatar
Jorge Pereira committed
284
285
AC_SUBST(VINAGRE_PLUGINS_DATA_DIR)

286
VINAGRE_PLUGINS_LIBS_DIR="$libdir/vinagre-1/plugins"
Jorge Pereira's avatar
Jorge Pereira committed
287
288
289
AC_SUBST(VINAGRE_PLUGINS_LIBS_DIR)

#*******************************************************************************
Jonh Wendell's avatar
Jonh Wendell committed
290
AC_CONFIG_FILES([
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
291
292
293
Makefile
data/Makefile
data/vinagre.desktop.in
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
294
data/vinagre-file.desktop.in
295
data/vinagre.pc
Jonh Wendell's avatar
Jonh Wendell committed
296
data/vinagre.schemas.in
297
data/icons/Makefile
298
help/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
299
po/Makefile.in
Jorge Pereira's avatar
Jorge Pereira committed
300
301
302
plugin-loaders/Makefile
plugin-loaders/c/Makefile
plugins/Makefile
Jonh Wendell's avatar
Jonh Wendell committed
303
plugins/vnc/Makefile
304
plugins/ssh/Makefile
305
plugins/rdp/Makefile
Jorge Pereira's avatar
Jorge Pereira committed
306
307
vinagre/Makefile
vinagre/view/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
308
])
Jonh Wendell's avatar
Jonh Wendell committed
309
AC_OUTPUT
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
310
311
312
313

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

echo "
314
315
316

This is vinagre version AC_PACKAGE_VERSION

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
317
318
319
320
Configure summary:

	Compiler ...................:  ${CC} 
	Compiler Flags .............:  ${CFLAGS}
321
322

	Avahi enabled ..............:  ${enable_avahi}
323
	GNOME Panel applet..........:  ${enable_applet}
324
	Telepathy support ..........:  ${have_telepathy}
325
	SSH plugin .................:  ${enable_ssh}
326
	RDP plugin .................:  ${enable_rdp}
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
327
"