configure.ac 8.04 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.30    
Jonh Wendell committed
4
AC_INIT([vinagre],[2.30.0],[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
40
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_CXX_WARNINGS([yes])
GNOME_MAINTAINER_MODE_DEFINES
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
41

42
43
44
VINAGRE_API_VERSION=1.0
AC_SUBST(VINAGRE_API_VERSION)

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

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

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

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

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

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

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

76
77
GLIB_REQUIRED=2.17.0
GTK_REQUIRED=2.13.1
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
78
GCONF_REQUIRED=2.16.0
79
GTHREAD_REQUIRED=2.0.0
80
GTK_VNC_REQUIRED=0.3.10
81
AVAHI_REQUIRED=0.6.22
Jonh Wendell's avatar
Jonh Wendell committed
82
PANEL_REQUIRED_VERSION=2.0.0
83
TELEPATHY_GLIB_REQUIRED=0.7.31
84
XML_REQUIRED=2.6.31
85
VTE_REQUIRED=0.20
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
86

87
88
# Check for avahi
AC_ARG_ENABLE(avahi,
Jonh Wendell's avatar
Jonh Wendell committed
89
              AS_HELP_STRING([--disable-avahi],[Do not use avahi for auto-discover machines [default=no]]),
90
              enable_avahi=${enableval},
91
92
93
94
95
96
97
98
99
100
101
102
              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
103
104
PKG_CHECK_MODULES(VINAGRE, \ 
  glib-2.0 >= $GLIB_REQUIRED \
105
  gio-2.0 >= $GLIB_REQUIRED \
106
  gio-unix-2.0 >= $GLIB_REQUIRED \
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
107
  gtk+-2.0 >= $GTK_REQUIRED \ 
Jonh Wendell S. Santana's avatar
Stuff    
Jonh Wendell S. Santana committed
108
  gconf-2.0 >= $GCONF_REQUIRED \
109
  gthread-2.0 >= $GTHREAD_REQUIRED \
110
  gnome-keyring-1 \
111
112
113
  libxml-2.0 >= $XML_REQUIRED \
  dbus-glib-1 \
  x11
114
)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
115
116
117
AC_SUBST(VINAGRE_CFLAGS)
AC_SUBST(VINAGRE_LIBS)

118
119
PKG_CHECK_MODULES(VNC, \
  gtk-vnc-1.0 >= $GTK_VNC_REQUIRED \
120
  libxml-2.0 >= $XML_REQUIRED
121
122
123
124
)
AC_SUBST(VNC_CFLAGS)
AC_SUBST(VNC_LIBS)

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

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

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

186
187
188
189
190
191
192
193
194
195
196
197
# 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
198

Jonh Wendell's avatar
Jonh Wendell committed
199
200
201
202
203
204
205
dnl ================================================================
dnl GConf related settings
dnl ================================================================

AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

206
207
dnl Check for bind in libsocket (needed on Solaris)
AC_CHECK_LIB(socket, bind)
Jonh Wendell's avatar
Jonh Wendell committed
208

209
210
211
212
213
214
215
216
217
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
218
fi
219
AC_SUBST(REBUILD)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
220

Jorge Pereira's avatar
Jorge Pereira committed
221
# Plugins
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
222
#*******************************************************************************
Jorge Pereira's avatar
Jorge Pereira committed
223
#
224
225
226
227
dnl ****************************
dnl *** Checks for ifaddrs.h ***
dnl ****************************
AC_CHECK_HEADER(ifaddrs.h)
Jonh Wendell's avatar
Jonh Wendell committed
228
AM_CONDITIONAL(SELF_IFADDRS, test "x$ac_cv_header_ifaddrs_h" != "xyes")
229

Jorge Pereira's avatar
Jorge Pereira committed
230
dnl active plugins for vinagre.schemas
Jonh Wendell's avatar
Jonh Wendell committed
231
ACTIVE_PLUGINS="vnc"
232
233
234
if test "x$enable_ssh" = "xyes" ; then
ACTIVE_PLUGINS="$ACTIVE_PLUGINS,ssh"
fi
Jorge Pereira's avatar
Jorge Pereira committed
235
AC_SUBST(ACTIVE_PLUGINS)
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
236

237
VINAGRE_IMPLIB="-lvinagre-${VINAGRE_API_VERSION}"
Jorge Pereira's avatar
Jorge Pereira committed
238
239
240
241
242
243
244
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)

245
VINAGRE_PLUGINS_DATA_DIR="$datadir/vinagre-1/plugins"
Jorge Pereira's avatar
Jorge Pereira committed
246
247
AC_SUBST(VINAGRE_PLUGINS_DATA_DIR)

248
VINAGRE_PLUGINS_LIBS_DIR="$libdir/vinagre-1/plugins"
Jorge Pereira's avatar
Jorge Pereira committed
249
250
251
AC_SUBST(VINAGRE_PLUGINS_LIBS_DIR)

#*******************************************************************************
Jonh Wendell's avatar
Jonh Wendell committed
252
AC_CONFIG_FILES([
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
253
254
255
Makefile
data/Makefile
data/vinagre.desktop.in
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
256
data/vinagre-file.desktop.in
257
data/vinagre.pc
Jonh Wendell's avatar
Jonh Wendell committed
258
data/vinagre.schemas.in
259
data/icons/Makefile
260
help/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
261
po/Makefile.in
Jorge Pereira's avatar
Jorge Pereira committed
262
263
264
plugin-loaders/Makefile
plugin-loaders/c/Makefile
plugins/Makefile
Jonh Wendell's avatar
Jonh Wendell committed
265
plugins/vnc/Makefile
266
plugins/ssh/Makefile
Jorge Pereira's avatar
Jorge Pereira committed
267
268
vinagre/Makefile
vinagre/view/Makefile
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
269
])
Jonh Wendell's avatar
Jonh Wendell committed
270
AC_OUTPUT
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
271
272
273
274

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

echo "
275
276
277

This is vinagre version AC_PACKAGE_VERSION

Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
278
279
280
281
Configure summary:

	Compiler ...................:  ${CC} 
	Compiler Flags .............:  ${CFLAGS}
282
283

	Avahi enabled ..............:  ${enable_avahi}
284
	GNOME Panel applet..........:  ${enable_applet}
285
	Telepathy support ..........:  ${have_telepathy}
286
	SSH plugin .................:  ${enable_ssh}
Jonh Wendell S. Santana's avatar
Jonh Wendell S. Santana committed
287
"