configure.ac 9.32 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])
Frederic Peters's avatar
Frederic Peters committed
4
AC_INIT([vinagre],[2.31.5],[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
75
GLIB_REQUIRED=2.25.11
GTK_REQUIRED=2.90.4
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
76
GCONF_REQUIRED=2.16.0
77
GTHREAD_REQUIRED=2.0.0
78
GTK_VNC_REQUIRED=0.4.1
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
Jonh Wendell's avatar
Jonh Wendell committed
84
PEAS_REQUIRED=0.5.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 \
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
  libxml-2.0 >= $XML_REQUIRED \
  dbus-glib-1 \
Jonh Wendell's avatar
Jonh Wendell committed
112
113
  libpeas-1.0 >= $PEAS_REQUIRED \
  libpeasui-1.0 >= $PEAS_REQUIRED
114
)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
115
116
117
AC_SUBST(VINAGRE_CFLAGS)
AC_SUBST(VINAGRE_LIBS)

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

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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")

145
146
147
148
149
150
151
152
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,\
153
  vte-2.90 >= $VTE_REQUIRED \
154
  libxml-2.0 >= $XML_REQUIRED)
155
156
157
158
159
160
  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")

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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")

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
# 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")

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

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

AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

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

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

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

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

269

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

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

AC_SUBST(VINAGRE_IMPLIB)
AC_SUBST(PLUGIN_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
plugins/Makefile
Jonh Wendell's avatar
Jonh Wendell committed
301
plugins/vnc/Makefile
302
plugins/ssh/Makefile
303
plugins/rdp/Makefile
Jorge Pereira's avatar
Jorge Pereira committed
304
305
vinagre/Makefile
vinagre/view/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
306
])
Jonh Wendell's avatar
Jonh Wendell committed
307
AC_OUTPUT
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
308
309
310
311

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

echo "
312
313
314

This is vinagre version AC_PACKAGE_VERSION

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
315
316
317
318
Configure summary:

	Compiler ...................:  ${CC} 
	Compiler Flags .............:  ${CFLAGS}
319
320

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