[vino] Overhaul configure script



commit 99d0f293b7ed2527c127a45bb6bc5b34b61bbcdb
Author: David King <davidk openismus com>
Date:   Sun Feb 27 12:11:40 2011 +0100

    Overhaul configure script
    
    Rename configure.in to configure.ac. Rearrange to recommended standard
    layout. Use M4sh where possible. Enable automake warnings, disable
    defines and disable standard includes. Switch all configure arguments
    that enable support for external libraries to use AC_ARG_WITH, and be
    automatically enabled by default. Prefix all defines from AC_DEFINE
    macros with 'VINO_'. Discover glib-genmarshal path from GLib pkg-config
    file. Drop confusing checking of both zlib and libz, and replace with
    just checking for zlib. Drop checking for Perl to decide whether to
    rebuild generated files. Drop configure summary.
    
    Additionally, make the minimum adjustments necessary in other files to
    enable the build to succeed.

 Makefile.am                              |    2 +-
 autogen.sh                               |    4 +-
 capplet/Makefile.am                      |    1 +
 configure.ac                             |  353 +++++++++++++++++++++++++
 configure.in                             |  420 ------------------------------
 server/Makefile.am                       |   31 ++-
 server/libvncserver/Makefile.am          |    9 +-
 server/libvncserver/auth.c               |    2 +-
 server/libvncserver/corre.c              |    2 +-
 server/libvncserver/cursor.c             |    4 +-
 server/libvncserver/cutpaste.c           |    2 +-
 server/libvncserver/hextile.c            |    2 +-
 server/libvncserver/ifaddr/Makefile.am   |    2 +-
 server/libvncserver/main.c               |    6 +-
 server/libvncserver/rfb/rfb.h            |   18 +-
 server/libvncserver/rfb/rfbproto.h       |    4 +-
 server/libvncserver/rfbregion.c          |    4 +-
 server/libvncserver/rfbserver.c          |   40 ++--
 server/libvncserver/rre.c                |    2 +-
 server/libvncserver/sockets.c            |    6 +-
 server/libvncserver/stats.c              |    2 +-
 server/libvncserver/tight.c              |    8 +-
 server/libvncserver/translate.c          |    4 +-
 server/libvncserver/vncauth.c            |    8 +-
 server/libvncserver/zlib.c               |    4 +-
 server/libvncserver/zrle.c               |   18 +-
 server/libvncserver/zrleencodetemplate.c |    4 +-
 server/libvncserver/zrleoutstream.c      |    2 +-
 server/libvncserver/zrleoutstream.h      |    4 +-
 server/libvncserver/zrlepalettehelper.c  |    2 +-
 server/libvncserver/zrlepalettehelper.h  |    2 +-
 server/smclient/Makefile.am              |    5 +-
 server/vino-fb.c                         |   38 ++--
 server/vino-http.c                       |    6 +-
 server/vino-input.c                      |   36 ++--
 server/vino-status-icon.c                |    2 +-
 server/vino-upnp.c                       |    4 +-
 tools/Makefile.am                        |    1 +
 tools/vino-passwd.c                      |    2 +-
 39 files changed, 501 insertions(+), 565 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0859731..711e837 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 SUBDIRS = common server capplet tools docs po
 
-DISTCHECK_CONFIGURE_FLAGS = --enable-avahi --enable-libnotify --enable-gnome-keyring --enable-http-server --enable-network-manager=yes --enable-telepathy --enable-debug
+DISTCHECK_CONFIGURE_FLAGS = --with-avahi --with-libnotify --with-gnome-keyring --with-network-manager --with-telepathy --with-gnutls --with-gcrypt --with-zlib --with-jpeg --enable-debug --enable-http-server
 
 EXTRA_DIST =                \
 	MAINTAINERS         \
diff --git a/autogen.sh b/autogen.sh
index ed32a72..54f885b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -6,7 +6,7 @@ test -z "$srcdir" && srcdir=.
 
 PKG_NAME=vino
 
-(test -f $srcdir/configure.in \
+(test -f $srcdir/configure.ac \
   && test -f $srcdir/server/vino-fb.c) || {
     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
     echo " top-level $PKG_NAME directory"
@@ -14,7 +14,7 @@ PKG_NAME=vino
 }
 
 which gnome-autogen.sh || {
-    echo "You need to install gnome-common from the GNOME CVS"
+    echo "You need to install gnome-common"
     exit 1
 }
 
diff --git a/capplet/Makefile.am b/capplet/Makefile.am
index 2d447ee..3f0a52d 100644
--- a/capplet/Makefile.am
+++ b/capplet/Makefile.am
@@ -2,6 +2,7 @@ NULL =
 
 INCLUDES = \
 	-I$(top_srcdir)/common \
+	-I$(top_builddir) \
 	-DVINO_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"  \
 	-DVINO_UIDIR=\""$(datadir)/vino"\" \
 	-DVINO_ICONDIR=\""$(datadir)/pixmaps\"" \
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a0d2b8d
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,353 @@
+AC_PREREQ([2.64])
+AC_INIT([Vino],[2.99.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=vino],[vino])
+AC_CONFIG_SRCDIR([server/vino-fb.c])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([1.10 -Wall no-define nostdinc])
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
+AC_PROG_CC
+
+# 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_httpserver=yes])
+
+AS_IF([test "x$enable_httpserver" = "xyes"],
+  [AC_DEFINE([VINO_ENABLE_HTTP_SERVER], [], [Enable HTTP server support])])
+
+AM_CONDITIONAL([VINO_ENABLE_HTTP_SERVER], [test "x$enable_httpserver" = "xyes"])
+
+# GNOME common
+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_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])])
+
+# GNOME libraries
+GTK_VERSION=3.0.0
+GLIB_VERSION=2.17.0
+GIO_VERSION=2.26
+DBUS_VERSION=1.2.3
+SOUP_VERSION=2.24.0
+TELEPATHY_GLIB_VERSION=0.11.6
+NETWORKMANAGER_VERSION=0.7
+
+PKG_CHECK_MODULES([VINO_SERVER], [glib-2.0 >= $GLIB_VERSION gio-unix-2.0 gtk+-x11-3.0 >= $GTK_VERSION])
+
+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])
+
+PKG_CHECK_MODULES([VINO_TOOLS], [glib-2.0 >= $GLIB_VERSION gio-2.0 >= $GIO_VERSION gobject-2.0 >= $GLIB_VERSION gnome-keyring-1])
+
+# EGG stuff
+PKG_CHECK_MODULES([EGG], [gtk+-3.0 >= $GTK_VERSION])
+PKG_CHECK_MODULES([EGG_SMCLIENT], [gtk+-3.0])
+
+# Check for telepathy-glib
+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_MODULES([TELEPATHY_GLIB],
+    [telepathy-glib >= $TELEPATHY_GLIB_VERSION],
+    [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])],
+  [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_VERSION=0.4.4
+
+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_MODULES([LIBNOTIFY],
+    [libnotify >= $LIBNOTIFY_VERSION],
+    [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.0],
+      [have_libnotify_0_7=yes],
+      [have_libnotify_0_7=no])
+    AS_IF([test "x$have_libnotify_0_7" = "xyes"],
+      [AC_DEFINE([VINO_HAVE_LIBNOTIFY_0_7], [], [Build with libnotify 0.7 or greater support])])],
+  [AS_IF([test "x$have_libnotify" = "xyes"],
+    [AC_MSG_ERROR([libnotify support requested but not found])])])
+
+# Check for NetworkManager
+AC_ARG_WITH([network-manager],
+  [AS_HELP_STRING([--without-network-manager],
+    [ignore the presence of NetworkManager and disable it])])
+
+AS_IF([test "x$with_networkmanager" != "xno"],
+  [PKG_CHECK_MODULES([NETWORKMANAGER],
+    [NetworkManager >= $NETWORKMANAGER_VERSION],
+    [have_networkmanager=yes],
+    [have_networkmanager=no])],
+  [have_networkmanager=no])
+
+AS_IF([test "x$have_networkmanager" = "xyes"],
+  [AC_DEFINE([VINO_HAVE_NETWORKMANAGER], [], [Build with NetworkManager support])],
+  [AS_IF([test "x$with_networkmanager" = "xyes"],
+    [AC_MSG_ERROR([NetworkManager support requested but not found])])])
+
+# Check for gnome-keyring
+AC_ARG_WITH([gnome-keyring],
+  [AS_HELP_STRING([--without-gnome-keyring],
+    [ignore the presence of gnome-keyring and disable it])])
+
+AS_IF([test "x$with_gnomekeyring" != "xno"],
+  [PKG_CHECK_MODULES([GNOME_KEYRING],
+    [gnome-keyring-1],
+    [have_gnomekeyring=yes],
+    [have_gnomekeyring=no])],
+  [have_gnomekeyring=no])
+
+AS_IF([test "x$have_gnomekeyring" != "xno"],
+  [AC_DEFINE([VINO_HAVE_GNOME_KEYRING], [], [Build with gnome-keyring support])],
+  [AS_IF([test "x$with_gnomekeyring" = "xyes"],
+    [AC_MSG_ERROR([gnome-keyring support requested but not found])])])
+
+# If Pango included the shared library dependencies from X11 in
+# the pkg-config output, then we use that (to avoid duplicates).
+# but if they were omitted to avoid binary compatibility problems
+# then we need to repeat the checks.
+PKG_CHECK_EXISTS([pangoxft],
+  [PANGO_PACKAGES="pangox pangoxft"],
+  [PANGO_PACKAGES="pangox"])
+
+AS_CASE([`$PKG_CONFIG --libs $PANGO_PACKAGES`],
+  [*-lX11*], [pango_omitted_x_deps=no],
+  [pango_omitted_x_deps=yes])
+
+AS_IF([test "x$pango_omitted_x_deps" = "xyes"],
+  [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_VERSION=1.0.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_MODULES([GNUTLS],
+    [gnutls >= $GNUTLS_VERSION],
+    [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])],
+  [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_VERSION=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_MODULES([AVAHI],
+    [avahi-client >= $AVAHI_VERSION avahi-glib >= $AVAHI_VERSION],
+    [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])],
+  [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])],
+  [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
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.17])
+AC_SUBST([GETTEXT_PACKAGE],[$PACKAGE_TARNAME])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [gettext package])
+IT_PROG_INTLTOOL([0.40.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 <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])],
+  [AS_IF([test "x$have_sockaddr_storage" = "xyes"],
+    [AC_DEFINE([RFC2553], [], [Define if RFC2553 is followed])])])
+
+AC_C_BIGENDIAN
+
+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])
+
+GLIB_GSETTINGS
+
+AC_CONFIG_FILES([
+Makefile
+common/Makefile
+server/Makefile
+server/libvncserver/Makefile
+server/libvncserver/ifaddr/Makefile
+server/libvncserver/rfb/Makefile
+server/miniupnp/Makefile
+server/smclient/Makefile
+capplet/Makefile
+capplet/vino-preferences.desktop.in
+tools/Makefile
+docs/Makefile
+po/Makefile.in
+])
+
+AC_OUTPUT
diff --git a/server/Makefile.am b/server/Makefile.am
index 33b0f12..4c6dc15 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -7,14 +7,15 @@ INCLUDES = \
 	-I$(top_srcdir)/server/libvncserver \
 	-I$(top_srcdir)/server/miniupnp \
 	-I$(top_srcdir)/server/smclient \
+	-I$(top_builddir) \
+	-I$(top_builddir)/server \
 	$(VINO_SERVER_CFLAGS) \
-	$(VINO_LIBNOTIFY_CFLAGS) \
+	$(LIBNOTIFY_CFLAGS) \
 	$(VINO_KEYRING_CFLAGS) \
-	$(VINO_HTTP_CFLAGS) \
 	$(VINO_NETWORKMANAGER_CFLAGS) \
 	$(AVAHI_CFLAGS) \
-	$(LIBGNUTLS_CFLAGS) \
-	$(LIBGCRYPT_CFLAGS) \
+	$(GNUTLS_CFLAGS) \
+	$(GCRYPT_CFLAGS) \
 	$(WARN_CFLAGS) \
 	$(DISABLE_DEPRECATED) \
 	-DVINO_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
@@ -30,16 +31,16 @@ vino_server_LDADD = \
 	$(top_builddir)/server/miniupnp/libminiupnp.la \
 	$(top_builddir)/server/smclient/libeggsmclient.la \
 	$(VINO_SERVER_LIBS) \
-	$(VINO_LIBNOTIFY_LIBS) \
-	$(VINO_KEYRING_LIBS) \
+	$(LIBNOTIFY_LIBS) \
+	$(KEYRING_LIBS) \
 	$(AVAHI_LIBS) \
-	$(VINO_NETWORKMANAGER_LIBS) \
-	$(LIBGNUTLS_LIBS) \
-	$(LIBGCRYPT_LIBS) \
+	$(NETWORKMANAGER_LIBS) \
+	$(GNUTLS_LIBS) \
+	$(GCRYPT_LIBS) \
 	$(X_LIBS) $(XTEST_LIBS) $(XSHM_LIBS) $(XDAMAGE_LIBS) \
 	$(NULL)
 
-if HTTP_SERVER
+if VINO_ENABLE_HTTP_SERVER
 VINO_HTTP_SRC = \
 	vino-http.c \
 	vino-http.h \
@@ -81,7 +82,7 @@ vino_server_SOURCES = \
 	$(CORBA_SRCLIST) \
 	$(NULL)
 
-if TELEPATHY_GLIB
+if VINO_HAVE_TELEPATHY_GLIB
 
 INCLUDES += $(TELEPATHY_GLIB_CFLAGS)
 vino_server_LDADD += $(TELEPATHY_GLIB_LIBS)
@@ -97,10 +98,10 @@ clientfile_DATA = Vino.client
 
 endif
 
-vino-marshal.h: vino-marshal.list $(GLIB_GENMARSHAL)
+vino-marshal.h: vino-marshal.list
 	$(AM_V_GEN)$(GLIB_GENMARSHAL) $< --header --prefix=vino_marshal > $@
 
-vino-marshal.c: vino-marshal.list $(GLIB_GENMARSHAL)
+vino-marshal.c: vino-marshal.list
 	$(AM_V_GEN)echo "#include \"vino-marshal.h\"" > $@ && \
 	$(GLIB_GENMARSHAL) $< --body --prefix=vino_marshal >> $@
 
@@ -111,7 +112,7 @@ vino_enum_headers = \
 	$(top_srcdir)/server/vino-status-tube-icon.h \
 	$(NULL)
 
-vino-enums.c: @REBUILD@ $(vino_enum_headers)
+vino-enums.c: $(vino_enum_headers)
 	$(AM_V_GEN)glib-mkenums    --fhead "#include <glib-object.h>\n" \
 			--fhead "#include \"vino-enums.h\"\n\n" \
 			--fprod "\n/* enumerations from \"@filename \" */" \
@@ -126,7 +127,7 @@ vino-enums.c: @REBUILD@ $(vino_enum_headers)
 			--vtail "  return type;\n}\n\n" \
 		$(vino_enum_headers) > $@
 
-vino-enums.h: @REBUILD@ $(vino_enum_headers)
+vino-enums.h: $(vino_enum_headers)
 	$(AM_V_GEN)glib-mkenums    --fhead "#ifndef __VINO_ENUMS_H__\n" \
 			--fhead "#define __VINO_ENUMS_H__ 1\n\n" \
 			--fhead "G_BEGIN_DECLS\n\n" \
diff --git a/server/libvncserver/Makefile.am b/server/libvncserver/Makefile.am
index 6a8072d..7830a7e 100644
--- a/server/libvncserver/Makefile.am
+++ b/server/libvncserver/Makefile.am
@@ -4,7 +4,7 @@ SUBDIRS = ifaddr rfb
 
 noinst_LTLIBRARIES = libvncserver.la
 
-INCLUDES = $(WARN_CFLAGS) $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
+INCLUDES = $(WARN_CFLAGS) $(GNUTLS_CFLAGS) $(GCRYPT_CFLAGS) -I$(top_builddir)
 
 libvncserver_la_SOURCES = 	\
 	auth.c 			\
@@ -33,11 +33,12 @@ libvncserver_la_SOURCES = 	\
 	$(NULL)
 
 libvncserver_la_LIBADD =	\
-	$(LIBGNUTLS_LIBS)	\
-	$(LIBGCRYPT_LIBS)	\
+	$(GNUTLS_LIBS)	\
+	$(GCRYPT_LIBS)	\
+	$(JPEG_LIBS) \
 	$(NULL)
 
-if SELF_IFADDRS
+if VINO_HAVE_SELF_IFADDRS
 libvncserver_la_LIBADD += ifaddr/libifaddrs.la
 endif
 
diff --git a/server/libvncserver/auth.c b/server/libvncserver/auth.c
index 2f3b03f..07e0b70 100644
--- a/server/libvncserver/auth.c
+++ b/server/libvncserver/auth.c
@@ -26,7 +26,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 void
 rfbAuthInitScreen(rfbScreenInfoPtr rfbScreen)
diff --git a/server/libvncserver/corre.c b/server/libvncserver/corre.c
index 3f123b0..8e47801 100644
--- a/server/libvncserver/corre.c
+++ b/server/libvncserver/corre.c
@@ -27,7 +27,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 /*
  * rreBeforeBuf contains pixel data in the client's format.
diff --git a/server/libvncserver/cursor.c b/server/libvncserver/cursor.c
index 31cc2bf..adcb9b3 100644
--- a/server/libvncserver/cursor.c
+++ b/server/libvncserver/cursor.c
@@ -22,8 +22,8 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
+#include "rfb/rfb.h"
+#include "rfb/rfbregion.h"
 
 /*
  * Send cursor shape either in X-style format or in client pixel format.
diff --git a/server/libvncserver/cutpaste.c b/server/libvncserver/cutpaste.c
index 6a9dcb9..6533fd2 100644
--- a/server/libvncserver/cutpaste.c
+++ b/server/libvncserver/cutpaste.c
@@ -23,7 +23,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 
 /*
diff --git a/server/libvncserver/hextile.c b/server/libvncserver/hextile.c
index e13021b..4be1071 100644
--- a/server/libvncserver/hextile.c
+++ b/server/libvncserver/hextile.c
@@ -25,7 +25,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 static rfbBool sendHextiles8(rfbClientPtr cl, int x, int y, int w, int h);
 static rfbBool sendHextiles16(rfbClientPtr cl, int x, int y, int w, int h);
diff --git a/server/libvncserver/ifaddr/Makefile.am b/server/libvncserver/ifaddr/Makefile.am
index b292ba8..4f3a9e2 100644
--- a/server/libvncserver/ifaddr/Makefile.am
+++ b/server/libvncserver/ifaddr/Makefile.am
@@ -1,4 +1,4 @@
-if SELF_IFADDRS
+if VINO_HAVE_SELF_IFADDRS
 noinst_LTLIBRARIES = libifaddrs.la
 libifaddrs_la_SOURCES = 	\
 	getifaddrs.c 		\
diff --git a/server/libvncserver/main.c b/server/libvncserver/main.c
index e75b7e0..9ce9bff 100644
--- a/server/libvncserver/main.c
+++ b/server/libvncserver/main.c
@@ -10,8 +10,8 @@
  *  see GPL (latest version) for full details
  */
 
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
+#include "rfb/rfb.h"
+#include "rfb/rfbregion.h"
 
 #include <stdarg.h>
 #include <errno.h>
@@ -461,7 +461,7 @@ void rfbScreenCleanup(rfbScreenInfoPtr rfbScreen)
   if(rfbScreen->desktopName)
     free(rfbScreen->desktopName);
   free(rfbScreen);
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
   rfbTightCleanup();
 #endif
 }
diff --git a/server/libvncserver/rfb/rfb.h b/server/libvncserver/rfb/rfb.h
index fb1bbcc..96d6fb6 100644
--- a/server/libvncserver/rfb/rfb.h
+++ b/server/libvncserver/rfb/rfb.h
@@ -35,9 +35,9 @@ extern "C"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <rfb/rfbproto.h>
-#include <rfb/rfbregion.h>
-#ifdef HAVE_GNUTLS
+#include "rfbproto.h"
+#include "rfbregion.h"
+#ifdef VINO_HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 #endif
 
@@ -320,14 +320,14 @@ typedef struct _rfbClientRec {
     int rfbKeyEventsRcvd;
     int rfbPointerEventsRcvd;
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
     /* zlib encoding -- necessary compression state info per client */
 
     struct z_stream_s compStream;
     rfbBool compStreamInited;
     uint32_t zlibCompressLevel;
 
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
     /* tight encoding -- preserve zlib streams' state for each client */
     z_stream zsStruct[4];
     rfbBool zsActive[4];
@@ -349,7 +349,7 @@ typedef struct _rfbClientRec {
     struct _rfbClientRec *prev;
     struct _rfbClientRec *next;
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
     void* zrleData;
 #endif
 
@@ -488,7 +488,7 @@ extern rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
                                        int h);
 
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 /* zlib.c */
 
 /* Minimum zlib rectangle size in bytes.  Anything smaller will
@@ -506,7 +506,7 @@ extern rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
 extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,
 				    int h);
 
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
 /* tight.c */
 
 #define TIGHT_DEFAULT_COMPRESSION  6
@@ -553,7 +553,7 @@ extern void rfbSetCursorPosition(rfbScreenInfoPtr rfbScreen, rfbClientPtr client
 extern void defaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl);
 
 /* zrle.c */
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,int h);
 extern void FreeZrleData(rfbClientPtr cl);
 #endif
diff --git a/server/libvncserver/rfb/rfbproto.h b/server/libvncserver/rfb/rfbproto.h
index af61bac..fe9157a 100644
--- a/server/libvncserver/rfb/rfbproto.h
+++ b/server/libvncserver/rfb/rfbproto.h
@@ -65,9 +65,9 @@
 #endif
 #endif
 #endif
-#include <rfb/keysym.h>
+#include "keysym.h"
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 #include <zlib.h>
 #endif
 
diff --git a/server/libvncserver/rfbregion.c b/server/libvncserver/rfbregion.c
index 0f917e3..506065c 100644
--- a/server/libvncserver/rfbregion.c
+++ b/server/libvncserver/rfbregion.c
@@ -5,8 +5,8 @@
  * Only deals with rectangular regions, though.
  */
 
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
+#include "rfb/rfb.h"
+#include "rfb/rfbregion.h"
 
 /* -=- Internal Span structure */
 
diff --git a/server/libvncserver/rfbserver.c b/server/libvncserver/rfbserver.c
index a0ef905..7930cfd 100644
--- a/server/libvncserver/rfbserver.c
+++ b/server/libvncserver/rfbserver.c
@@ -27,8 +27,8 @@
 #define _GNU_SOURCE 1
 
 #include <string.h>
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
+#include "rfb/rfb.h"
+#include "rfb/rfbregion.h"
 #include <netdb.h>
 
 #ifdef HAVE_FCNTL_H
@@ -213,7 +213,7 @@ rfbNewClient(rfbScreenInfoPtr rfbScreen,
       cl->preferredEncoding = rfbEncodingRaw;
       cl->correMaxWidth = 48;
       cl->correMaxHeight = 48;
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
       cl->zrleData = NULL;
 #endif
 
@@ -240,7 +240,7 @@ rfbNewClient(rfbScreenInfoPtr rfbScreen,
       rfbScreen->rfbClientHead = cl;
       UNLOCK(rfbClientListMutex);
 
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
       cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
       cl->tightQualityLevel = -1;
       for (i = 0; i < 4; i++)
@@ -252,7 +252,7 @@ rfbNewClient(rfbScreenInfoPtr rfbScreen,
       cl->enableLastRectEncoding = FALSE;
       cl->useNewFBSize = FALSE;
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
       cl->compStreamInited = FALSE;
       cl->compStream.total_in = 0;
       cl->compStream.total_out = 0;
@@ -317,7 +317,7 @@ rfbClientConnectionGone(rfbClientPtr cl)
     if(cl->sock>0)
         close(cl->sock);
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
     FreeZrleData(cl);
 #endif
 
@@ -330,13 +330,13 @@ rfbClientConnectionGone(rfbClientPtr cl)
     rfbLog("Client %s gone\n",cl->host);
     free(cl->host);
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
     /* Release the compression state structures if any. */
     if ( cl->compStreamInited ) {
 	deflateEnd( &(cl->compStream) );
     }
 
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
     for (i = 0; i < 4; i++) {
 	if (cl->zsActive[i])
 	    deflateEnd(&cl->zsStruct[i]);
@@ -666,10 +666,10 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
             case rfbEncodingRRE:
             case rfbEncodingCoRRE:
             case rfbEncodingHextile:
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 	    case rfbEncodingZlib:
             case rfbEncodingZRLE:
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
 	    case rfbEncodingTight:
 #endif
 #endif
@@ -704,11 +704,11 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
 		}
 		break;
             default:
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 		if ( enc >= (uint32_t)rfbEncodingCompressLevel0 &&
 		     enc <= (uint32_t)rfbEncodingCompressLevel9 ) {
 		    cl->zlibCompressLevel = enc & 0x0F;
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
 		    cl->tightCompressLevel = enc & 0x0F;
 		    rfbLog("Using compression level %d for client %s\n",
 			   cl->tightCompressLevel, cl->host);
@@ -1074,7 +1074,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
                                      * ((h-1) / cl->correMaxHeight + 1));
         }
 	sraRgnReleaseIterator(i);
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
     } else if (cl->preferredEncoding == rfbEncodingZlib) {
 	nUpdateRegionRects = 0;
 
@@ -1085,7 +1085,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
             int h = rect.y2 - y;
 	    nUpdateRegionRects += (((h-1) / (ZLIB_MAX_SIZE( w ) / w)) + 1);
 	}
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
     } else if (cl->preferredEncoding == rfbEncodingTight) {
 	nUpdateRegionRects = 0;
 
@@ -1113,14 +1113,14 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
 	if(cl->screen->maxRectsPerUpdate>0
 	   /* CoRRE splits the screen into smaller squares */
 	   && cl->preferredEncoding != rfbEncodingCoRRE
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 	   /* Zlib encoding splits rectangles up into smaller chunks */
 	   && cl->preferredEncoding != rfbEncodingZlib
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
 	   /* Tight encoding counts the rectangles differently */
 	   && cl->preferredEncoding != rfbEncodingTight
 #endif
-#endif /* HAVE_LIBZ */
+#endif /* VINO_HAVE_ZLIB */
 	   && nUpdateRegionRects>cl->screen->maxRectsPerUpdate) {
 	    sraRegion* newUpdateRegion = sraRgnBBox(updateRegion);
 	    sraRgnDestroy(updateRegion);
@@ -1180,19 +1180,19 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
             if (!rfbSendRectEncodingHextile(cl, x, y, w, h))
 		goto tx_error;
             break;
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 	case rfbEncodingZlib:
 	    if (!rfbSendRectEncodingZlib(cl, x, y, w, h))
 		goto tx_error;
 	    break;
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
 	case rfbEncodingTight:
 	    if (!rfbSendRectEncodingTight(cl, x, y, w, h))
 		goto tx_error;
 	    break;
 #endif
 #endif
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
        case rfbEncodingZRLE:
            if (!rfbSendRectEncodingZRLE(cl, x, y, w, h))
 	       goto tx_error;
diff --git a/server/libvncserver/rre.c b/server/libvncserver/rre.c
index 3e00c05..912d06b 100644
--- a/server/libvncserver/rre.c
+++ b/server/libvncserver/rre.c
@@ -26,7 +26,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 /*
  * rreBeforeBuf contains pixel data in the client's format.
diff --git a/server/libvncserver/sockets.c b/server/libvncserver/sockets.c
index c4275b0..1cf653d 100644
--- a/server/libvncserver/sockets.c
+++ b/server/libvncserver/sockets.c
@@ -39,7 +39,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -582,7 +582,7 @@ ListenOnTCPPort(rfbScreenInfoPtr rfbScreen, int port, const char *netIface)
 
   if(netIface == NULL || strlen(netIface) == 0)
   {
-#ifdef ENABLE_IPV6
+#ifdef VINO_ENABLE_IPV6
     struct sockaddr_in6 s6;
 
     memset(&s6, 0, sizeof(s6));
@@ -639,7 +639,7 @@ ListenOnTCPPort(rfbScreenInfoPtr rfbScreen, int port, const char *netIface)
         sock = NewSocketListenTCP((struct sockaddr*)s4, INET_ADDRSTRLEN);
       }
     }
-#ifdef ENABLE_IPV6            
+#ifdef VINO_ENABLE_IPV6
     if (ifa->ifa_addr->ADDR_FAMILY_MEMBER == AF_INET6) {
       struct sockaddr_in6 *s6 = (struct sockaddr_in6*)ifa->ifa_addr;
       s6->sin6_port           = htons(port);
diff --git a/server/libvncserver/stats.c b/server/libvncserver/stats.c
index d2ebdbf..b350d68 100644
--- a/server/libvncserver/stats.c
+++ b/server/libvncserver/stats.c
@@ -24,7 +24,7 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
 static const char* encNames[] = {
     "raw", "copyRect", "RRE", "[encoding 3]", "CoRRE", "hextile",
diff --git a/server/libvncserver/tight.c b/server/libvncserver/tight.c
index 9828f4e..71fd5b6 100644
--- a/server/libvncserver/tight.c
+++ b/server/libvncserver/tight.c
@@ -25,10 +25,9 @@
  */
 
 /*#include <stdio.h>*/
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
-#ifdef HAVE_LIBZ
-#ifdef HAVE_LIBJPEG
+#ifdef VINO_HAVE_JPEG
 
 #ifdef WIN32
 #define XMD_H
@@ -1823,5 +1822,4 @@ JpegSetDstManager(j_compress_ptr cinfo)
     cinfo->dest = &jpegDstManager;
 }
 
-#endif /* LIBJPEG */
-#endif /* LIBZ */
+#endif /* VINO_HAVE_JPEG */
diff --git a/server/libvncserver/translate.c b/server/libvncserver/translate.c
index f3d6520..56d22cd 100644
--- a/server/libvncserver/translate.c
+++ b/server/libvncserver/translate.c
@@ -23,8 +23,8 @@
  *  USA.
  */
 
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
+#include "rfb/rfb.h"
+#include "rfb/rfbregion.h"
 
 static void PrintPixelFormat(rfbPixelFormat *pf);
 static rfbBool rfbSetClientColourMapBGR233(rfbClientPtr cl);
diff --git a/server/libvncserver/vncauth.c b/server/libvncserver/vncauth.c
index 6551a1a..027f062 100644
--- a/server/libvncserver/vncauth.c
+++ b/server/libvncserver/vncauth.c
@@ -21,10 +21,10 @@
  * vncauth.c - Functions for VNC password management and authentication.
  */
 
-#include <rfb/rfbproto.h>
+#include "rfb/rfbproto.h"
 #include "d3des.h"
 
-#ifdef HAVE_GCRYPT
+#ifdef VINO_HAVE_GCRYPT
 #include <gcrypt.h>
 #endif
 #include <string.h>
@@ -44,7 +44,7 @@
 void
 vncRandomBytes(unsigned char *bytes)
 {
-#ifdef HAVE_GCRYPT
+#ifdef VINO_HAVE_GCRYPT
     static rfbBool gcrypt_init = FALSE;
 
     if (!gcrypt_init) {
@@ -68,7 +68,7 @@ vncRandomBytes(unsigned char *bytes)
     for (i = 0; i < CHALLENGESIZE; i++) {
       bytes[i] = (unsigned char)(random() & 255);
     }
-#endif /* HAVE_GCRYPT */
+#endif /* VINO_HAVE_GCRYPT */
 }
 
 
diff --git a/server/libvncserver/zlib.c b/server/libvncserver/zlib.c
index 07391a1..63792b8 100644
--- a/server/libvncserver/zlib.c
+++ b/server/libvncserver/zlib.c
@@ -30,9 +30,9 @@
  * or send email to feedback developvnc org 
  */
 
-#include <rfb/rfb.h>
+#include "rfb/rfb.h"
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 
 /*
  * zlibBeforeBuf contains pixel data in the client's format.
diff --git a/server/libvncserver/zrle.c b/server/libvncserver/zrle.c
index 624c4bf..676fb08 100644
--- a/server/libvncserver/zrle.c
+++ b/server/libvncserver/zrle.c
@@ -24,11 +24,11 @@
  * Routines to implement Zlib Run-length Encoding (ZRLE).
  */
 
-#include <rfb/rfb.h>
-#include <zrleoutstream.h>
+#include "rfb/rfb.h"
+#include "zrleoutstream.h"
 
 
-#ifdef HAVE_LIBZ
+#ifdef VINO_HAVE_ZLIB
 
 #define GET_IMAGE_INTO_BUF(tx,ty,tw,th,buf)                                \
 {  char *fbptr = (cl->screen->frameBuffer                                   \
@@ -42,18 +42,18 @@
 #define EXTRA_ARGS , rfbClientPtr cl
 
 #define BPP 8
-#include <zrleencodetemplate.c>
+#include "zrleencodetemplate.c"
 #undef BPP
 #define BPP 16
-#include <zrleencodetemplate.c>
+#include "zrleencodetemplate.c"
 #undef BPP
 #define BPP 32
-#include <zrleencodetemplate.c>
+#include "zrleencodetemplate.c"
 #define CPIXEL 24A
-#include <zrleencodetemplate.c>
+#include "zrleencodetemplate.c"
 #undef CPIXEL
 #define CPIXEL 24B
-#include <zrleencodetemplate.c>
+#include "zrleencodetemplate.c"
 #undef CPIXEL
 #undef BPP
 
@@ -183,4 +183,4 @@ void FreeZrleData(rfbClientPtr cl)
   cl->zrleData = NULL;
 }
 
-#endif  /* HAVE_LIBZ */
+#endif  /* VINO_HAVE_ZLIB */
diff --git a/server/libvncserver/zrleencodetemplate.c b/server/libvncserver/zrleencodetemplate.c
index f36ea6c..17ef0ad 100644
--- a/server/libvncserver/zrleencodetemplate.c
+++ b/server/libvncserver/zrleencodetemplate.c
@@ -31,8 +31,8 @@
  * algorithm writes to the position one past the end of the pixel data.
  */
 
-#include <zrleoutstream.h>
-#include <zrlepalettehelper.h>
+#include "zrleoutstream.h"
+#include "zrlepalettehelper.h"
 #include <assert.h>
 
 /* __RFB_CONCAT2 concatenates its two arguments.  __RFB_CONCAT2E does the same
diff --git a/server/libvncserver/zrleoutstream.c b/server/libvncserver/zrleoutstream.c
index 47cc164..d22d649 100644
--- a/server/libvncserver/zrleoutstream.c
+++ b/server/libvncserver/zrleoutstream.c
@@ -18,7 +18,7 @@
  * USA.
  */
 
-#include <zrleoutstream.h>
+#include "zrleoutstream.h"
 #include <stdlib.h>
 
 #define ZRLE_IN_BUFFER_SIZE  16384
diff --git a/server/libvncserver/zrleoutstream.h b/server/libvncserver/zrleoutstream.h
index cc8f770..9e4fe51 100644
--- a/server/libvncserver/zrleoutstream.h
+++ b/server/libvncserver/zrleoutstream.h
@@ -22,8 +22,8 @@
 #define __ZRLE_OUT_STREAM_H__
 
 #include <zlib.h>
-#include <zrletypes.h>
-#include <rfb/rfb.h>
+#include "zrletypes.h"
+#include "rfb/rfb.h"
 
 typedef struct {
   zrle_U8 *start;
diff --git a/server/libvncserver/zrlepalettehelper.c b/server/libvncserver/zrlepalettehelper.c
index 70cafb4..d758a26 100644
--- a/server/libvncserver/zrlepalettehelper.c
+++ b/server/libvncserver/zrlepalettehelper.c
@@ -18,7 +18,7 @@
  * USA.
  */
 
-#include <zrlepalettehelper.h>
+#include "zrlepalettehelper.h"
 #include <assert.h>
 #include <string.h>
 
diff --git a/server/libvncserver/zrlepalettehelper.h b/server/libvncserver/zrlepalettehelper.h
index c6723c9..e1213d1 100644
--- a/server/libvncserver/zrlepalettehelper.h
+++ b/server/libvncserver/zrlepalettehelper.h
@@ -26,7 +26,7 @@
 #ifndef __ZRLE_PALETTE_HELPER_H__
 #define __ZRLE_PALETTE_HELPER_H__
 
-#include <zrletypes.h>
+#include "zrletypes.h"
 
 #define ZRLE_PALETTE_MAX_SIZE 127
 
diff --git a/server/smclient/Makefile.am b/server/smclient/Makefile.am
index 6144b4a..d7ab5f0 100644
--- a/server/smclient/Makefile.am
+++ b/server/smclient/Makefile.am
@@ -1,12 +1,13 @@
 platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP
-platform_libs = libeggdesktopfile.la
+platform_libs = libeggdesktopfile.la -lSM -lICE
 platform_ltlibraries = libeggdesktopfile.la
 platform_sources = eggsmclient-xsmp.c
 
 INCLUDES =                               \
 	-DG_LOG_DOMAIN=\""EggSMClient"\" \
 	$(platform_defines)              \
-	$(EGG_SMCLIENT_CFLAGS)
+	$(EGG_SMCLIENT_CFLAGS)		 \
+	-I$(top_builddir)
 
 noinst_LTLIBRARIES =                     \
 	libeggsmclient.la                \
diff --git a/server/vino-fb.c b/server/vino-fb.c
index 9395fb3..68d1ae6 100644
--- a/server/vino-fb.c
+++ b/server/vino-fb.c
@@ -43,10 +43,10 @@
 #include <sys/shm.h>
 #include <gdk/gdkx.h>
 #include <X11/Xlib.h>
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
 #include <X11/extensions/XShm.h>
 #endif
-#ifdef HAVE_XDAMAGE
+#ifdef VINO_HAVE_XDAMAGE
 #include <X11/extensions/Xdamage.h>
 #endif
 
@@ -55,7 +55,7 @@
 #define TILE_WIDTH  32
 #define TILE_HEIGHT 32
 
-#ifndef HAVE_XSHM
+#ifndef VINO_HAVE_XSHM
 typedef struct { int dummy; } XShmSegmentInfo;
 #endif
 
@@ -80,7 +80,7 @@ struct _VinoFBPrivate
 
   guint            update_timeout;
 
-#ifdef HAVE_XDAMAGE
+#ifdef VINO_HAVE_XDAMAGE
   cairo_region_t  *pending_damage;
   guint            damage_idle_handler;
 
@@ -120,7 +120,7 @@ static void vino_fb_init_from_screen (VinoFB    *vfb,
 static void vino_fb_screen_size_changed (VinoFB    *vfb,
 					 GdkScreen *screen);
 
-#ifdef HAVE_XDAMAGE
+#ifdef VINO_HAVE_XDAMAGE
 static GdkFilterReturn vino_fb_xdamage_event_filter (GdkXEvent *xevent,
 						     GdkEvent  *event,
 						     VinoFB    *vfb);
@@ -162,7 +162,7 @@ vino_fb_get_image (VinoFB          *vfb,
 
   gdk_error_trap_push ();
 
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
   if (is_x_shm_segment && image->width == width && image->height == height)
     {
       XShmGetImage (vfb->priv->xdisplay,
@@ -172,7 +172,7 @@ vino_fb_get_image (VinoFB          *vfb,
 		    AllPlanes);
     }
   else
-#endif /* HAVE_XSHM */
+#endif /* VINO_HAVE_XSHM */
     {
       XGetSubImage (vfb->priv->xdisplay,
 		    xdrawable,
@@ -209,7 +209,7 @@ vino_fb_destroy_image (VinoFB          *vfb,
 		       gboolean         is_x_shm_segment,
 		       gboolean         is_attached)
 {
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
   if (is_x_shm_segment)
     {
       if (is_attached)
@@ -220,7 +220,7 @@ vino_fb_destroy_image (VinoFB          *vfb,
       x_shm_info->shmaddr = (char *)-1;
       x_shm_info->shmid = -1;
     }
-#endif /* HAVE_XSHM */
+#endif /* VINO_HAVE_XSHM */
   
   if (image)
     XDestroyImage (image);
@@ -239,7 +239,7 @@ vino_fb_create_image (VinoFB           *vfb,
 
   n_screen = gdk_screen_get_number (vfb->priv->screen);
 
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
   if (vfb->priv->use_x_shm)
     {
       *image = XShmCreateImage (vfb->priv->xdisplay,
@@ -287,7 +287,7 @@ vino_fb_create_image (VinoFB           *vfb,
       return vino_fb_create_image (vfb, image, x_shm_info, FALSE,
 				   width, height, depth);
     }
-#endif /* HAVE_XSHM */
+#endif /* VINO_HAVE_XSHM */
 
   if (!must_use_x_shm)
     {
@@ -457,7 +457,7 @@ vino_fb_poll_screen (VinoFB *vfb)
 static void
 vino_fb_finalize_xdamage (VinoFB *vfb)
 {
-#ifdef HAVE_XDAMAGE
+#ifdef VINO_HAVE_XDAMAGE
   if (vfb->priv->damage_idle_handler)
     g_source_remove (vfb->priv->damage_idle_handler);
   vfb->priv->damage_idle_handler = 0;
@@ -551,7 +551,7 @@ vino_fb_screen_size_changed (VinoFB    *vfb,
   emit_size_changed (vfb);
 }
 
-#ifdef HAVE_XDAMAGE
+#ifdef VINO_HAVE_XDAMAGE
 
 static gboolean
 vino_fb_xdamage_idle_handler (VinoFB *vfb)
@@ -689,12 +689,12 @@ vino_fb_xdamage_event_filter (GdkXEvent *xevent,
 
   return GDK_FILTER_REMOVE;
 }
-#endif /* HAVE_XDAMAGE */
+#endif /* VINO_HAVE_XDAMAGE */
 
 static void
 vino_fb_init_xdamage (VinoFB *vfb)
 {
-#ifdef HAVE_XDAMAGE
+#ifdef VINO_HAVE_XDAMAGE
   int       event_base, error_base;
   int       major, minor;
   XGCValues values;
@@ -814,7 +814,7 @@ vino_fb_init_fb_image (VinoFB *vfb)
 
   if (vfb->priv->fb_image)
     {
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
       if (vfb->priv->use_x_shm)
 	{
 	  vfb->priv->fb_pixmap = XShmCreatePixmap (vfb->priv->xdisplay,
@@ -861,7 +861,7 @@ vino_fb_init_from_screen (VinoFB    *vfb,
   vfb->priv->xdisplay    = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
   vfb->priv->root_window = gdk_screen_get_root_window (screen);
 
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
   vfb->priv->use_x_shm = XShmQueryExtension (vfb->priv->xdisplay) != False;
   if (vfb->priv->use_x_shm)
     {
@@ -962,7 +962,7 @@ vino_fb_instance_init (VinoFB *vfb)
 {
   vfb->priv = g_new0 (VinoFBPrivate, 1);
 
-#ifdef HAVE_XSHM
+#ifdef VINO_HAVE_XSHM
   vfb->priv->fb_image_x_shm_info.shmid   = -1;
   vfb->priv->fb_image_x_shm_info.shmaddr = (char *) -1;
 
@@ -971,7 +971,7 @@ vino_fb_instance_init (VinoFB *vfb)
   
   vfb->priv->tile_x_shm_info.shmid   = -1;
   vfb->priv->tile_x_shm_info.shmaddr = (char *) -1;
-#endif /* HAVE_XSHM */
+#endif /* VINO_HAVE_XSHM */
 }
 
 static void
diff --git a/server/vino-http.c b/server/vino-http.c
index 39f3f0c..fcf88e7 100644
--- a/server/vino-http.c
+++ b/server/vino-http.c
@@ -593,7 +593,7 @@ start_probing_at (int rfb_port)
 static void
 vino_http_create_listening_socket (VinoHTTP *http)
 {
-#ifdef ENABLE_IPV6
+#ifdef VINO_ENABLE_IPV6
   struct sockaddr_in6  saddr_in6;
 #endif
   struct sockaddr_in   saddr_in;
@@ -619,7 +619,7 @@ vino_http_create_listening_socket (VinoHTTP *http)
 
   sock = -1;
 
-#ifdef ENABLE_IPV6
+#ifdef VINO_ENABLE_IPV6
   sock = socket (AF_INET6, SOCK_STREAM, 0);
 
   memset (&saddr_in6, 0, sizeof (struct sockaddr_in6));
@@ -668,7 +668,7 @@ vino_http_create_listening_socket (VinoHTTP *http)
 
   while (http_port <= VINO_HTTP_MAX_PORT)
     {
-#ifdef ENABLE_IPV6
+#ifdef VINO_ENABLE_IPV6
       if (saddr->sa_family == AF_INET6)
         ((struct sockaddr_in6 *) saddr)->sin6_port = htons (http_port);
       else
diff --git a/server/vino-input.c b/server/vino-input.c
index e12becd..3e02071 100644
--- a/server/vino-input.c
+++ b/server/vino-input.c
@@ -141,10 +141,10 @@
 #include <gtk/gtk.h>
 #include <X11/Xlib.h>
 #include <X11/keysym.h>
-#ifdef HAVE_XTEST
+#ifdef VINO_HAVE_XTEST
 #include <X11/extensions/XTest.h>
 #endif
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
 #include <X11/XKBlib.h>
 #endif
 
@@ -198,7 +198,7 @@ typedef struct
 {
   guint8             button_mask;
   VinoModifierState  modifier_state;
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
   int                current_group;
 #endif
 
@@ -213,7 +213,7 @@ typedef struct
   KeySym             alt_gr_keysym;
   guint              num_lock_mod;
 
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
   int                xkb_num_groups;
   int                xkb_event_type;
 #endif
@@ -230,7 +230,7 @@ static VinoInputData global_input_data = { 0, };
 
 static gchar *cb_str = NULL;
 
-#ifdef HAVE_XTEST
+#ifdef VINO_HAVE_XTEST
 
 static struct {
   guint32 composed;
@@ -522,7 +522,7 @@ vino_input_initialize_keycodes_core (Display *xdisplay)
   XFreeModifiermap (modmap);
 }
 
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
 static void
 vino_input_initialize_keycodes_xkb (Display *xdisplay)
 {
@@ -731,7 +731,7 @@ vino_input_initialize_keycodes (Display *xdisplay)
   global_input_data.keybindings =
     g_hash_table_new_full (NULL, NULL, NULL, g_free);
 
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
   if (global_input_data.xkb_supported)
     vino_input_initialize_keycodes_xkb (xdisplay);
 #endif
@@ -744,12 +744,12 @@ vino_input_initialize_keycodes (Display *xdisplay)
   global_input_data.num_lock_keycode     = XKeysymToKeycode (xdisplay, XK_Num_Lock);
   global_input_data.alt_gr_keycode       = XKeysymToKeycode (xdisplay, global_input_data.alt_gr_keysym);
 }
-#endif /* HAVE_XTEST */
+#endif /* VINO_HAVE_XTEST */
 
 gboolean
 vino_input_init (GdkDisplay *display)
 {
-#ifdef HAVE_XTEST
+#ifdef VINO_HAVE_XTEST
   Display *xdisplay;
   int      ignore, *i = &ignore;
   int      d;
@@ -767,7 +767,7 @@ vino_input_init (GdkDisplay *display)
 
   global_input_data.n_pointer_buttons = XGetPointerMapping (xdisplay, NULL, 0);
 
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
   if (XkbQueryExtension (xdisplay, NULL, &global_input_data.xkb_event_type,
 			 NULL, NULL, NULL))
     {
@@ -809,7 +809,7 @@ vino_input_init (GdkDisplay *display)
   return global_input_data.xtest_supported;
 #else
   return global_input_data.xtest_supported = FALSE;
-#endif /* HAVE_XTEST */
+#endif /* VINO_HAVE_XTEST */
 }
 
 void
@@ -818,7 +818,7 @@ vino_input_handle_pointer_event (GdkScreen *screen,
 				 guint16    x,
 				 guint16    y)
 {
-#ifdef HAVE_XTEST
+#ifdef VINO_HAVE_XTEST
   Display *xdisplay;
   guint8   prev_mask = global_input_data.button_mask;
   int      i;
@@ -847,10 +847,10 @@ vino_input_handle_pointer_event (GdkScreen *screen,
     }
 
   global_input_data.button_mask = button_mask;
-#endif /* HAVE_XTEST */
+#endif /* VINO_HAVE_XTEST */
 }
 
-#ifdef HAVE_XTEST
+#ifdef VINO_HAVE_XTEST
 static inline void
 vino_input_update_modifier_state (VinoInputData    *input_data,
 				  VinoModifierState state,
@@ -968,7 +968,7 @@ vino_input_fake_keypress (Display *xdisplay, guint32 keysym)
     {
       int group;
 
-#ifdef HAVE_XKB
+#ifdef VINO_HAVE_XKB
       if (global_input_data.xkb_supported)
 	{
 	  if (binding[global_input_data.current_group].keycode)
@@ -1031,14 +1031,14 @@ vino_input_fake_keypress (Display *xdisplay, guint32 keysym)
 
   return FALSE;
 }
-#endif /* HAVE_XTEST */
+#endif /* VINO_HAVE_XTEST */
 
 void
 vino_input_handle_key_event (GdkScreen *screen,
 			     guint32    keysym,
 			     gboolean   key_press)
 {
-#ifdef HAVE_XTEST
+#ifdef VINO_HAVE_XTEST
   Display *xdisplay;
 
   dprintf (INPUT, "Got key %s for %s\n", key_press ? "press" : "release",
@@ -1114,7 +1114,7 @@ vino_input_handle_key_event (GdkScreen *screen,
 
   XFlush (xdisplay);
 
-#endif /* HAVE_XTEST */
+#endif /* VINO_HAVE_XTEST */
 }
 
 /* text was actually requested */
diff --git a/server/vino-status-icon.c b/server/vino-status-icon.c
index 109e0f5..790cdb4 100644
--- a/server/vino-status-icon.c
+++ b/server/vino-status-icon.c
@@ -280,7 +280,7 @@ vino_status_icon_about (VinoStatusIcon *icon)
 
   gtk_show_about_dialog (NULL,
                          "comments",           _("Share your desktop with other users"),
-                         "version",            VERSION,
+                         "version",            PACKAGE_VERSION,
                          "license",            license,
                          "authors",            authors,
                          "translator-credits", translators,
diff --git a/server/vino-upnp.c b/server/vino-upnp.c
index 8739be7..3f085e2 100644
--- a/server/vino-upnp.c
+++ b/server/vino-upnp.c
@@ -27,8 +27,8 @@
 #endif
 
 #include <string.h>
-#include <miniupnp/miniupnpc.h>
-#include <miniupnp/upnpcommands.h>
+#include "miniupnp/miniupnpc.h"
+#include "miniupnp/upnpcommands.h"
 
 #ifdef VINO_ENABLE_NETWORKMANAGER
 #include <NetworkManager/NetworkManager.h>
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 4d39eaa..a8243ec 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,6 +1,7 @@
 NULL =
 
 INCLUDES = \
+	-I$(top_builddir) \
 	-DVINO_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
 	$(VINO_TOOLS_CFLAGS) \
 	$(WARN_CFLAGS) \
diff --git a/tools/vino-passwd.c b/tools/vino-passwd.c
index 91f5f48..78d07e5 100644
--- a/tools/vino-passwd.c
+++ b/tools/vino-passwd.c
@@ -212,7 +212,7 @@ main(int argc, char *argv[])
 
   if (opt_version)
    {
-     g_print (_("VINO Version %s\n"), VERSION);
+     g_print (_("VINO Version %s\n"), PACKAGE_VERSION);
      return 0;
    }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]