From e0d09d4be86c95304bd5a6084f2387131b732fd9 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 4 Jun 2013 20:19:33 -0700 Subject: [PATCH] Convert RDP and VNC to new build system. --- Makefile.am | 2 +- configure.ac | 2 +- protocols/rdp/Makefile.am | 5 ++- protocols/rdp/{configure.in => configure.ac} | 42 +++++++++++++------ .../spice/{configure.in => configure.ac} | 0 protocols/ssh/{configure.in => configure.ac} | 0 protocols/vnc/Makefile.am | 3 +- protocols/vnc/{configure.in => configure.ac} | 37 ++++++++++++---- 8 files changed, 65 insertions(+), 26 deletions(-) rename protocols/rdp/{configure.in => configure.ac} (83%) rename protocols/spice/{configure.in => configure.ac} (100%) rename protocols/ssh/{configure.in => configure.ac} (100%) rename protocols/vnc/{configure.in => configure.ac} (74%) diff --git a/Makefile.am b/Makefile.am index ba196cc9..88880608 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,5 +37,5 @@ ACLOCAL_AMFLAGS = -I m4 # Subprojects -SUBDIRS = libguac guacd +SUBDIRS = libguac guacd protocols/vnc protocols/rdp diff --git a/configure.ac b/configure.ac index 3d0c795a..10c81e95 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ LT_PREREQ([2.2]) LT_INIT([dlopen]) AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SUBDIRS([libguac guacd]) +AC_CONFIG_SUBDIRS([libguac guacd protocols/vnc protocols/rdp]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/protocols/rdp/Makefile.am b/protocols/rdp/Makefile.am index 595691f8..a4864469 100644 --- a/protocols/rdp/Makefile.am +++ b/protocols/rdp/Makefile.am @@ -37,7 +37,7 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -AM_CFLAGS = -Werror -Wall -Iinclude +AM_CFLAGS = -Werror -Wall -Iinclude $(LIBGUAC_INCLUDE) lib_LTLIBRARIES = libguac-client-rdp.la freerdp_LTLIBRARIES = guac_rdpsnd.la @@ -93,6 +93,9 @@ endif libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0 guac_rdpsnd_la_LDFLAGS = -module -avoid-version -shared +libguac_client_rdp_la_LIBADD = $(LIBGUAC_LTLIB) +guac_rdpsnd_la_LIBADD = $(LIBGUAC_LTLIB) + freerdpdir = ${libdir}/freerdp/ EXTRA_DIST = LICENSE diff --git a/protocols/rdp/configure.in b/protocols/rdp/configure.ac similarity index 83% rename from protocols/rdp/configure.in rename to protocols/rdp/configure.ac index e21c6713..937b675f 100644 --- a/protocols/rdp/configure.in +++ b/protocols/rdp/configure.ac @@ -34,26 +34,39 @@ # # ***** END LICENSE BLOCK ***** -AC_INIT(src/client.c) -AM_INIT_AUTOMAKE([libguac-client-rdp], 0.7.4) -AC_CONFIG_MACRO_DIR([m4]) +AC_PREREQ([2.61]) +AC_INIT([libguac-client-rdp], [0.7.4]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -# Checks for programs. +LT_PREREQ([2.2]) +LT_INIT([dlopen]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([src/client.c]) + +# Programs AC_PROG_CC AC_PROG_CC_C99 AC_PROG_LIBTOOL -# Checks for libraries. -AC_CHECK_LIB([guac], [guac_client_plugin_open],, AC_MSG_ERROR("libguac must be installed first")) +# Libraries +AC_CHECK_LIB([pthread], [pthread_mutex_init],, AC_MSG_ERROR("libpthread is required")) AC_CHECK_LIB([cairo], [cairo_create],, AC_MSG_ERROR("cairo is required for drawing instructions")) AC_CHECK_LIB([freerdp-cache], [glyph_cache_register_callbacks],, AC_MSG_ERROR("libfreerdp-cache is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-core], [freerdp_new],, AC_MSG_ERROR("libfreerdp-core is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-channels], [freerdp_channels_new],, AC_MSG_ERROR("libfreerdp-channels is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-utils], [xzalloc],, AC_MSG_ERROR("libfreerdp-utils is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-codec], [freerdp_image_convert],, AC_MSG_ERROR("libfreerdp-codec is required (part of FreeRDP)")) -AC_CHECK_LIB([pthread], [pthread_mutex_init],, AC_MSG_ERROR("libpthread is required")) -# Check for libvorbisenc + +# If bundled copy of libguac found, use that +if test -d "$srcdir/../../libguac" +then + AC_SUBST([LIBGUAC_LTLIB], '$(top_builddir)/../../libguac/src/libguac.la') + AC_SUBST([LIBGUAC_INCLUDE], '-I$(top_srcdir)/../../libguac/include') +else + AC_CHECK_LIB([guac], [guac_client_plugin_open]) +fi have_vorbisenc=yes AC_CHECK_HEADER(vorbis/vorbisenc.h,, [have_vorbisenc=no]) @@ -71,16 +84,19 @@ else AC_DEFINE([ENABLE_OGG]) fi -# Checks for header files. -AC_CHECK_HEADERS([guacamole/client.h guacamole/guacio.h guacamole/protocol.h freerdp/locale/keyboard.h freerdp/kbd/layouts.h]) +# Functions +AC_FUNC_MALLOC +AC_CHECK_FUNCS([memset socket strerror fork]) + +# Headers +AC_CHECK_HEADERS([freerdp/locale/keyboard.h freerdp/kbd/layouts.h]) # Check for FreeRDP version-specific features AC_CHECK_MEMBERS([rdpPointer.SetDefault, rdpPointer.SetNull], [], [], [[#include ]]) -# Checks for library functions. -AC_FUNC_MALLOC - +# Done AC_CONFIG_FILES([Makefile]) AC_OUTPUT + diff --git a/protocols/spice/configure.in b/protocols/spice/configure.ac similarity index 100% rename from protocols/spice/configure.in rename to protocols/spice/configure.ac diff --git a/protocols/ssh/configure.in b/protocols/ssh/configure.ac similarity index 100% rename from protocols/ssh/configure.in rename to protocols/ssh/configure.ac diff --git a/protocols/vnc/Makefile.am b/protocols/vnc/Makefile.am index 9180cc13..e71b89bf 100644 --- a/protocols/vnc/Makefile.am +++ b/protocols/vnc/Makefile.am @@ -37,7 +37,7 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -AM_CFLAGS = -Werror -Wall -pedantic -Iinclude +AM_CFLAGS = -Werror -Wall -pedantic -Iinclude $(LIBGUAC_INCLUDE) lib_LTLIBRARIES = libguac-client-vnc.la @@ -45,6 +45,7 @@ libguac_client_vnc_la_SOURCES = src/client.c src/vnc_handlers.c src/guac_handler noinst_HEADERS = include/client.h include/vnc_handlers.h include/guac_handlers.h include/convert.h libguac_client_vnc_la_LDFLAGS = -version-info 0:0:0 +libguac_client_vnc_la_LIBADD = $(LIBGUAC_LTLIB) EXTRA_DIST = LICENSE diff --git a/protocols/vnc/configure.in b/protocols/vnc/configure.ac similarity index 74% rename from protocols/vnc/configure.in rename to protocols/vnc/configure.ac index eb3b005c..e9e5e299 100644 --- a/protocols/vnc/configure.in +++ b/protocols/vnc/configure.ac @@ -34,24 +34,43 @@ # # ***** END LICENSE BLOCK ***** -AC_INIT(src/client.c) -AM_INIT_AUTOMAKE([libguac-client-vnc], 0.7.2) -AC_CONFIG_MACRO_DIR([m4]) +AC_PREREQ([2.61]) +AC_INIT([libguac-client-vnc], [0.7.2]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -# Checks for programs. +LT_PREREQ([2.2]) +LT_INIT([dlopen]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([src/client.c]) + +# Programs AC_PROG_CC +AC_PROG_CC_C99 AC_PROG_LIBTOOL -# Checks for libraries. -AC_CHECK_LIB([guac], [guac_client_plugin_open],, AC_MSG_ERROR("libguac must be installed first")) +# Libraries +AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([cairo], [cairo_create],, AC_MSG_ERROR("cairo is required for drawing instructions")) AC_CHECK_LIB([vncclient], [rfbInitClient],, AC_MSG_ERROR("libvncclient is required")) -# Checks for header files. -AC_CHECK_HEADERS([stdlib.h string.h syslog.h guacamole/client.h guacamole/socket.h guacamole/protocol.h iconv.h]) +# If bundled copy of libguac found, use that +if test -d "$srcdir/../../libguac" +then + AC_SUBST([LIBGUAC_LTLIB], '$(top_builddir)/../../libguac/src/libguac.la') + AC_SUBST([LIBGUAC_INCLUDE], '-I$(top_srcdir)/../../libguac/include') +else + AC_CHECK_LIB([guac], [guac_client_plugin_open]) +fi -# Checks for library functions. +# Functions AC_FUNC_MALLOC +AC_CHECK_FUNCS([memset socket strerror fork]) +# Headers +AC_CHECK_HEADERS([stdlib.h string.h syslog.h iconv.h]) + +# Done AC_CONFIG_FILES([Makefile]) AC_OUTPUT +