configure.ac (39032B)
1# 2# Licensed to the Apache Software Foundation (ASF) under one 3# or more contributor license agreements. See the NOTICE file 4# distributed with this work for additional information 5# regarding copyright ownership. The ASF licenses this file 6# to you under the Apache License, Version 2.0 (the 7# "License"); you may not use this file except in compliance 8# with the License. You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, 13# software distributed under the License is distributed on an 14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15# KIND, either express or implied. See the License for the 16# specific language governing permissions and limitations 17# under the License. 18# 19 20AC_PREREQ([2.61]) 21AC_INIT([guacamole-server], [1.5.4]) 22AC_CONFIG_AUX_DIR([build-aux]) 23AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) 24AM_SILENT_RULES([yes]) 25 26LT_PREREQ([2.2]) 27LT_INIT([dlopen]) 28 29AC_CONFIG_HEADER([config.h]) 30AC_CONFIG_MACRO_DIR([m4]) 31 32# Use TAP test driver for tests (part of automake) 33AC_REQUIRE_AUX_FILE([tap-driver.sh]) 34 35# Programs 36AC_PROG_CC 37AC_PROG_CC_C99 38AC_PROG_LIBTOOL 39 40# Headers 41AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h time.h sys/time.h syslog.h unistd.h cairo/cairo.h pngstruct.h]) 42 43# Source characteristics 44AC_DEFINE([_XOPEN_SOURCE], [700], [Uses X/Open and POSIX APIs]) 45AC_DEFINE([__BSD_VISIBLE], [1], [Uses BSD-specific APIs (if available)]) 46 47# Check for whether math library is required 48AC_CHECK_LIB([m], [cos], 49 [MATH_LIBS=-lm], 50 [AC_CHECK_DECL([cos],, 51 AC_MSG_ERROR("Complex math functions are missing and no libm was found") 52 [#include <math.h>])]) 53 54# libpng 55AC_CHECK_LIB([png], [png_write_png], [PNG_LIBS=-lpng], 56 AC_MSG_ERROR("libpng is required for writing png messages")) 57 58# libjpeg 59AC_CHECK_LIB([jpeg], [jpeg_start_compress], [JPEG_LIBS=-ljpeg], 60 AC_MSG_ERROR("libjpeg is required for writing jpeg messages")) 61 62# Cairo 63AC_CHECK_LIB([cairo], [cairo_create], [CAIRO_LIBS=-lcairo], 64 AC_MSG_ERROR("Cairo is required for drawing instructions")) 65 66# libpthread 67AC_CHECK_LIB([pthread], [pthread_create], [PTHREAD_LIBS=-lpthread 68 AC_DEFINE([HAVE_LIBPTHREAD],, 69 [Whether libpthread was found])]) 70 71# Include libdl for dlopen() if necessary 72AC_CHECK_LIB([dl], [dlopen], 73 [DL_LIBS=-ldl], 74 [AC_CHECK_DECL([dlopen],, 75 AC_MSG_ERROR("libdl is required on systems which do not otherwise provide dlopen()"), 76 [#include <dlfcn.h>])]) 77 78# 79# libuuid 80# 81 82have_libuuid=disabled 83AC_ARG_WITH([libuuid], 84 [AS_HELP_STRING([--with-libuuid], 85 [use libuuid to generate unique identifiers @<:@default=check@:>@])], 86 [], 87 [with_libuuid=check]) 88 89if test "x$with_libuuid" != "xno" 90then 91 have_libuuid=yes 92 AC_CHECK_LIB([uuid], [uuid_generate], 93 [UUID_LIBS=-luuid] 94 [AC_DEFINE([HAVE_LIBUUID],, [Whether libuuid is available])], 95 [have_libuuid=no]) 96fi 97 98# OSSP UUID (if libuuid is unavilable) 99if test "x${have_libuuid}" != "xyes" 100then 101 102 AC_CHECK_LIB([ossp-uuid], [uuid_make], [UUID_LIBS=-lossp-uuid], 103 AC_CHECK_LIB([uuid], [uuid_make], [UUID_LIBS=-luuid], 104 AC_MSG_ERROR([ 105 -------------------------------------------- 106 Unable to find libuuid or the OSSP UUID library. 107 Either libuuid (from util-linux) or the OSSP UUID library is required for 108 guacamole-server to be built. 109 --------------------------------------------]))) 110 111 # Check for and validate OSSP uuid.h header 112 AC_CHECK_HEADERS([ossp/uuid.h]) 113 AC_CHECK_DECL([uuid_make],, 114 AC_MSG_ERROR("No OSSP uuid.h found in include path"), 115 [#ifdef HAVE_OSSP_UUID_H 116 #include <ossp/uuid.h> 117 #else 118 #include <uuid.h> 119 #endif 120 ]) 121fi 122 123# cunit 124AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit]) 125 126AC_SUBST(DL_LIBS) 127AC_SUBST(MATH_LIBS) 128AC_SUBST(PNG_LIBS) 129AC_SUBST(JPEG_LIBS) 130AC_SUBST(CAIRO_LIBS) 131AC_SUBST(PTHREAD_LIBS) 132AC_SUBST(UUID_LIBS) 133AC_SUBST(CUNIT_LIBS) 134 135# Library functions 136AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup nanosleep]) 137 138AC_CHECK_DECL([png_get_io_ptr], 139 [AC_DEFINE([HAVE_PNG_GET_IO_PTR],, 140 [Whether png_get_io_ptr() is defined])],, 141 [#include <png.h>]) 142 143AC_CHECK_DECL([cairo_format_stride_for_width], 144 [AC_DEFINE([HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH],, 145 [Whether cairo_format_stride_for_width() is defined])],, 146 [#include <cairo/cairo.h>]) 147 148AC_CHECK_DECL([poll], 149 [AC_DEFINE([HAVE_POLL],, 150 [Whether poll() is defined])],, 151 [#include <poll.h>]) 152 153AC_CHECK_DECL([strlcpy], 154 [AC_DEFINE([HAVE_STRLCPY],, 155 [Whether strlcpy() is defined])],, 156 [#include <string.h>]) 157 158AC_CHECK_DECL([strlcat], 159 [AC_DEFINE([HAVE_STRLCAT],, 160 [Whether strlcat() is defined])],, 161 [#include <string.h>]) 162 163AC_CHECK_DECL([strnstr], 164 [AC_DEFINE([HAVE_STRNSTR],, 165 [Whether strnstr() is defined])],, 166 [#include <string.h>]) 167 168# Typedefs 169AC_TYPE_SIZE_T 170AC_TYPE_SSIZE_T 171 172# Bundled libguac 173AC_SUBST([LIBGUAC_LTLIB], '$(top_builddir)/src/libguac/libguac.la') 174AC_SUBST([LIBGUAC_INCLUDE], '-I$(top_srcdir)/src/libguac') 175 176# Common non-libguac utility library 177AC_SUBST([COMMON_LTLIB], '$(top_builddir)/src/common/libguac_common.la') 178AC_SUBST([COMMON_INCLUDE], '-I$(top_srcdir)/src/common') 179 180# Common PulseAudio utility library 181AC_SUBST([PULSE_LTLIB], '$(top_builddir)/src/pulse/libguac_pulse.la') 182AC_SUBST([PULSE_INCLUDE], '-I$(top_srcdir)/src/pulse') 183 184# Common base SSH client 185AC_SUBST([COMMON_SSH_LTLIB], '$(top_builddir)/src/common-ssh/libguac_common_ssh.la') 186AC_SUBST([COMMON_SSH_INCLUDE], '-I$(top_srcdir)/src/common-ssh') 187 188# Kubernetes support 189AC_SUBST([LIBGUAC_CLIENT_KUBERNETES_LTLIB], '$(top_builddir)/src/protocols/kubernetes/libguac-client-kubernetes.la') 190AC_SUBST([LIBGUAC_CLIENT_KUBERNETES_INCLUDE], '-I$(top_srcdir)/src/protocols/kubernetes') 191 192# RDP support 193AC_SUBST([LIBGUAC_CLIENT_RDP_LTLIB], '$(top_builddir)/src/protocols/rdp/libguac-client-rdp.la') 194AC_SUBST([LIBGUAC_CLIENT_RDP_INCLUDE], '-I$(top_srcdir)/src/protocols/rdp') 195 196# Terminal emulator 197AC_SUBST([TERMINAL_LTLIB], '$(top_builddir)/src/terminal/libguac-terminal.la') 198AC_SUBST([TERMINAL_INCLUDE], '-I$(top_srcdir)/src/terminal $(PANGO_CFLAGS) $(PANGOCAIRO_CFLAGS) $(COMMON_INCLUDE)') 199 200# Init directory 201AC_ARG_WITH(init_dir, 202 [AS_HELP_STRING([--with-init-dir=<path>], 203 [install init scripts to the given directory]) 204 ],init_dir=$withval) 205AM_CONDITIONAL([ENABLE_INIT], [test "x${init_dir}" != "x"]) 206AC_SUBST(init_dir) 207 208# Systemd directory 209AC_ARG_WITH(systemd_dir, 210 [AS_HELP_STRING([--with-systemd-dir=<path>], 211 [install systemd units to the given directory]) 212 ],systemd_dir=$withval) 213AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x${systemd_dir}" != "x"]) 214AC_SUBST(systemd_dir) 215 216# guacd config file 217AC_ARG_WITH(guacd_conf, 218 [AS_HELP_STRING([--with-guacd-conf=<path>], 219 [the full path to the guacd config file @<:@default=/etc/guacamole/guacd.conf@:>@])], 220 [guacd_conf=$withval], 221 [guacd_conf=/etc/guacamole/guacd.conf]) 222AC_DEFINE_UNQUOTED([GUACD_CONF_FILE], ["$guacd_conf"], [The full path to the guacd config file]) 223 224# 225# libavcodec 226# 227 228have_libavcodec=disabled 229AC_ARG_WITH([libavcodec], 230 [AS_HELP_STRING([--with-libavcodec], 231 [use libavcodec when encoding video @<:@default=check@:>@])], 232 [], 233 [with_libavcodec=check]) 234 235if test "x$with_libavcodec" != "xno" 236then 237 have_libavcodec=yes 238 PKG_CHECK_MODULES([AVCODEC], [libavcodec],, [have_libavcodec=no]); 239fi 240 241AM_CONDITIONAL([ENABLE_AVCODEC], [test "x${have_libavcodec}" = "xyes"]) 242 243# 244# libavformat 245# 246 247have_libavformat=disabled 248AC_ARG_WITH([libavformat], 249 [AS_HELP_STRING([--with-libavformat], 250 [use libavformat when encoding video @<:@default=check@:>@])], 251 []. 252 [with_libavformat=check]) 253if test "x$with_libavformat" != "xno" 254then 255 have_libavformat=yes 256 PKG_CHECK_MODULES([AVFORMAT], [libavformat],, [have_libavformat=no]); 257fi 258 259AM_CONDITIONAL([ENABLE_AVFORMAT], [test "x${have_libavformat}" = "xyes"]) 260 261# 262# libavutil 263# 264 265have_libavutil=disabled 266AC_ARG_WITH([libavutil], 267 [AS_HELP_STRING([--with-libavutil], 268 [use libavutil when encoding video @<:@default=check@:>@])], 269 [], 270 [with_libavutil=check]) 271 272if test "x$with_libavutil" != "xno" 273then 274 have_libavutil=yes 275 PKG_CHECK_MODULES([AVUTIL], [libavutil],, [have_libavutil=no]); 276fi 277 278AM_CONDITIONAL([ENABLE_AVUTIL], [test "x${have_libavutil}" = "xyes"]) 279 280# 281# libswscale 282# 283 284have_libswscale=disabled 285AC_ARG_WITH([libswscale], 286 [AS_HELP_STRING([--with-libswscale], 287 [use libswscale when encoding video @<:@default=check@:>@])], 288 [], 289 [with_libswscale=check]) 290 291if test "x$with_libswscale" != "xno" 292then 293 have_libswscale=yes 294 PKG_CHECK_MODULES([SWSCALE], [libswscale],, [have_libswscale=no]); 295fi 296 297AM_CONDITIONAL([ENABLE_SWSCALE], [test "x${have_libswscale}" = "xyes"]) 298 299# 300# libssl 301# 302 303have_ssl=disabled 304SSL_LIBS= 305AC_ARG_WITH([ssl], 306 [AS_HELP_STRING([--with-ssl], 307 [support SSL encryption @<:@default=check@:>@])], 308 [], 309 [with_ssl=check]) 310 311if test "x$with_ssl" != "xno" 312then 313 have_ssl=yes 314 315 AC_CHECK_HEADER(openssl/ssl.h,, [have_ssl=no]) 316 AC_CHECK_LIB([ssl], [SSL_CTX_new], [SSL_LIBS="$SSL_LIBS -lssl -lcrypto"], [have_ssl=no]) 317 318 if test "x${have_ssl}" = "xno" 319 then 320 AC_MSG_WARN([ 321 -------------------------------------------- 322 Unable to find libssl. 323 guacd will not support SSL connections. 324 --------------------------------------------]) 325 else 326 AC_DEFINE([ENABLE_SSL],, [Whether SSL-related support is enabled]) 327 328 # OpenSSL 1.1 does away with explicit threading callbacks 329 AC_MSG_CHECKING([whether libssl requires threading callbacks]) 330 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 331 332 #include <openssl/opensslv.h> 333 334 #if OPENSSL_VERSION_NUMBER < 0x10100000L 335 #error Threading callbacks required. 336 #endif 337 338 int main() { 339 return 0; 340 } 341 342 ]])], 343 [AC_MSG_RESULT([no])], 344 [AC_MSG_RESULT([yes]) 345 AC_DEFINE([OPENSSL_REQUIRES_THREADING_CALLBACKS],, 346 [Whether OpenSSL requires explicit threading callbacks for threadsafety])]) 347 348 fi 349fi 350 351AM_CONDITIONAL([ENABLE_SSL], [test "x${have_ssl}" = "xyes"]) 352AC_SUBST(SSL_LIBS) 353 354# 355# Winsock 356# 357 358have_winsock=disabled 359WINSOCK_LIBS= 360AC_ARG_WITH([winsock], 361 [AS_HELP_STRING([--with-winsock], 362 [support Windows Sockets API @<:@default=check@:>@])], 363 [], 364 [with_winsock=check]) 365 366if test "x$with_winsock" != "xno" 367then 368 have_winsock=yes 369 AC_CHECK_LIB([wsock32], [main], 370 [WINSOCK_LIBS="-lwsock32"] 371 [AC_DEFINE([ENABLE_WINSOCK],, 372 [Whether Windows Socket API support is enabled])], 373 [have_winsock=no]) 374fi 375 376AM_CONDITIONAL([ENABLE_WINSOCK], [test "x${have_winsock}" = "xyes"]) 377AC_SUBST(WINSOCK_LIBS) 378 379# 380# Ogg Vorbis 381# 382 383have_vorbis=disabled 384VORBIS_LIBS= 385AC_ARG_WITH([vorbis], 386 [AS_HELP_STRING([--with-vorbis], 387 [support Ogg Vorbis @<:@default=check@:>@])], 388 [], 389 [with_vorbis=check]) 390 391if test "x$with_vorbis" != "xno" 392then 393 have_vorbis=yes 394 395 AC_CHECK_HEADER(vorbis/vorbisenc.h,, [have_vorbis=no]) 396 AC_CHECK_LIB([ogg], [ogg_stream_init], [VORBIS_LIBS="$VORBIS_LIBS -logg"], [have_vorbis=no]) 397 AC_CHECK_LIB([vorbis], [vorbis_block_init], [VORBIS_LIBS="$VORBIS_LIBS -lvorbis"], [have_vorbis=no]) 398 AC_CHECK_LIB([vorbisenc], [vorbis_encode_init], [VORBIS_LIBS="$VORBIS_LIBS -lvorbisenc"], [have_vorbis=no]) 399 400 if test "x${have_vorbis}" = "xno" 401 then 402 AC_MSG_WARN([ 403 -------------------------------------------- 404 Unable to find libogg / libvorbis / libvorbisenc. 405 Sound will not be encoded with Ogg Vorbis. 406 --------------------------------------------]) 407 else 408 AC_DEFINE([ENABLE_OGG],, 409 [Whether support for Ogg Vorbis is enabled]) 410 fi 411fi 412 413AM_CONDITIONAL([ENABLE_OGG], [test "x${have_vorbis}" = "xyes"]) 414AC_SUBST(VORBIS_LIBS) 415 416# 417# PulseAudio 418# 419 420have_pulse=disabled 421PULSE_LIBS= 422AC_ARG_WITH([pulse], 423 [AS_HELP_STRING([--with-pulse], 424 [support PulseAudio @<:@default=check@:>@])], 425 [], 426 [with_pulse=check]) 427 428if test "x$with_pulse" != "xno" 429then 430 have_pulse=yes 431 432 AC_CHECK_LIB([pulse], [pa_context_new], [PULSE_LIBS="$PULSE_LIBS -lpulse"], [have_pulse=no]) 433 434 if test "x${have_pulse}" = "xno" 435 then 436 AC_MSG_WARN([ 437 -------------------------------------------- 438 Unable to find libpulse 439 Sound support for VNC will be disabled 440 --------------------------------------------]) 441 else 442 AC_DEFINE([ENABLE_PULSE],, [Whether PulseAudio support is enabled]) 443 fi 444fi 445 446AM_CONDITIONAL([ENABLE_PULSE], [test "x${have_pulse}" = "xyes"]) 447AC_SUBST(PULSE_LIBS) 448 449# 450# PANGO 451# 452 453have_pango=disabled 454AC_ARG_WITH([pango], 455 [AS_HELP_STRING([--with-pango], 456 [support Pango text layout @<:@default=check@:>@])], 457 [], 458 [with_pango=check]) 459 460if test "x$with_pango" != "xno" 461then 462 have_pango=yes 463 PKG_CHECK_MODULES([PANGO], [pango],, [have_pango=no]); 464 PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo],, [have_pango=no]); 465fi 466 467# 468# Terminal emulator 469# 470 471have_terminal=disabled 472AC_ARG_WITH([terminal], 473 [AS_HELP_STRING([--with-terminal], 474 [support text-based protocols @<:@default=check@:>@])], 475 [], 476 [with_terminal=check]) 477 478if test "x$with_terminal" != "xno" 479then 480 have_terminal=yes 481 if test "x${have_pango}" != "xyes" 482 then 483 have_terminal=no 484 fi 485fi 486 487AM_CONDITIONAL([ENABLE_TERMINAL], [test "x${have_terminal}" = "xyes"]) 488 489# 490# libVNCServer 491# 492 493have_libvncserver=disabled 494VNC_LIBS= 495AC_ARG_WITH([vnc], 496 [AS_HELP_STRING([--with-vnc], 497 [support VNC @<:@default=check@:>@])], 498 [], 499 [with_vnc=check]) 500 501if test "x$with_vnc" != "xno" 502then 503 have_libvncserver=yes 504 AC_CHECK_LIB([vncclient], [rfbInitClient], [VNC_LIBS="$VNC_LIBS -lvncclient"], [have_libvncserver=no]) 505fi 506 507# 508# Underlying libvncserver usage of gcrypt 509# 510 511if test "x${have_libvncserver}" = "xyes" 512then 513 514 # Whether libvncserver was built against libgcrypt 515 AC_CHECK_DECL([LIBVNCSERVER_WITH_CLIENT_GCRYPT], 516 [AC_CHECK_HEADER(gcrypt.h,, 517 [AC_MSG_WARN([ 518 -------------------------------------------- 519 libvncserver appears to be built against 520 libgcrypt, but the libgcrypt headers 521 could not be found. VNC will be disabled. 522 --------------------------------------------]) 523 have_libvncserver=no])],, 524 [[#include <rfb/rfbconfig.h>]]) 525 526fi 527 528AM_CONDITIONAL([ENABLE_VNC], [test "x${have_libvncserver}" = "xyes"]) 529AC_SUBST(VNC_LIBS) 530 531# 532# Repeater support within libVNCServer 533# 534 535if test "x${have_libvncserver}" = "xyes" 536then 537 538 have_vnc_repeater=yes 539 AC_CHECK_MEMBERS([rfbClient.destHost, rfbClient.destPort], 540 [], [have_vnc_repeater=no], 541 [[#include <rfb/rfbclient.h>]]) 542 543 if test "x${have_vnc_repeater}" = "xno" 544 then 545 AC_MSG_WARN([ 546 -------------------------------------------- 547 No repeater support found in libvncclient. 548 Support for VNC repeaters will not be built. 549 --------------------------------------------]) 550 else 551 AC_DEFINE([ENABLE_VNC_REPEATER],, 552 [Whether support for VNC repeaters is enabled.]) 553 fi 554 555fi 556 557# 558# Listening support within libVNCServer 559# 560 561if test "x${have_libvncserver}" = "xyes" 562then 563 564 have_vnc_listen=yes 565 AC_CHECK_DECL([listenForIncomingConnectionsNoFork], 566 [], [have_vnc_listen=no], 567 [[#include <rfb/rfbclient.h>]]) 568 569 if test "x${have_vnc_listen}" = "xno" 570 then 571 AC_MSG_WARN([ 572 -------------------------------------------- 573 No listening support found in libvncclient. 574 Support for listen-mode connections will not be built. 575 --------------------------------------------]) 576 else 577 AC_DEFINE([ENABLE_VNC_LISTEN],, 578 [Whether support for listen-mode VNC connections is enabled.]) 579 fi 580 581fi 582 583# 584# TLS Locking Support within libVNCServer 585# 586 587if test "x${have_libvncserver}" = "xyes" 588then 589 590 have_vnc_tls_locking=yes 591 AC_CHECK_MEMBERS([rfbClient.LockWriteToTLS, rfbClient.UnlockWriteToTLS], 592 [], [have_vnc_tls_locking=no], 593 [[#include <rfb/rfbclient.h>]]) 594 595 if test "x${have_vnc_tls_locking}" = "xno" 596 then 597 AC_MSG_WARN([ 598 -------------------------------------------- 599 This version of libvncclient lacks support 600 for TLS locking. VNC connections that use 601 TLS may experience instability as documented 602 in GUACAMOLE-414]) 603 else 604 AC_DEFINE([ENABLE_VNC_TLS_LOCKING],, 605 [Whether support for TLS locking within VNC is enabled.]) 606 fi 607 608fi 609 610# 611# Generic credential support within libVNCServer (authentication beyond 612# basic, standard VNC passwords) 613# 614 615if test "x${have_libvncserver}" = "xyes" 616then 617 618 have_vnc_creds=yes 619 AC_CHECK_MEMBERS([rfbClient.GetCredential], 620 [], [have_vnc_creds=no], 621 [[#include <rfb/rfbclient.h>]]) 622 623 if test "x${have_vnc_creds}" = "xno" 624 then 625 AC_MSG_WARN([ 626 -------------------------------------------- 627 No generic credential support found in libvncclient. 628 VNC authentication support will be limited to passwords. 629 --------------------------------------------]) 630 else 631 AC_DEFINE([ENABLE_VNC_GENERIC_CREDENTIALS],, 632 [Whether support for generic VNC credentials is available.]) 633 fi 634 635fi 636 637 638# 639# FreeRDP 2 (libfreerdp2, libfreerdp-client2, and libwinpr2) 640# 641 642have_freerdp2=disabled 643FREERDP2_PLUGIN_DIR= 644 645AC_ARG_WITH([rdp], 646 [AS_HELP_STRING([--with-rdp], 647 [support RDP @<:@default=check@:>@])], 648 [], 649 [with_rdp=check]) 650 651# FreeRDP plugin directory 652AC_ARG_WITH(freerdp_plugin_dir, 653 [AS_HELP_STRING([--with-freerdp-plugin-dir=<path>], 654 [install FreeRDP plugins to the given directory @<:@default=check@:>@]) 655 ],FREERDP2_PLUGIN_DIR=$withval) 656 657# Preserve CPPFLAGS so it can be restored later, following the addition of 658# options specific to FreeRDP tests 659OLDCPPFLAGS="$CPPFLAGS" 660 661if test "x$with_rdp" != "xno" 662then 663 have_freerdp2=yes 664 PKG_CHECK_MODULES([RDP], [freerdp2 freerdp-client2 winpr2], 665 [CPPFLAGS="${RDP_CFLAGS} -Werror $CPPFLAGS"] 666 [AS_IF([test "x${FREERDP2_PLUGIN_DIR}" = "x"], 667 [FREERDP2_PLUGIN_DIR="`$PKG_CONFIG --variable=libdir freerdp2`/freerdp2"])], 668 [AC_MSG_WARN([ 669 -------------------------------------------- 670 Unable to find FreeRDP (libfreerdp2 / libfreerdp-client2 / libwinpr2) 671 RDP will be disabled. 672 --------------------------------------------]) 673 have_freerdp2=no]) 674fi 675 676# Available color conversion functions 677if test "x$have_freerdp2" = "xyes" 678then 679 680 # FreeRDP 2.0.0-rc3 and older referred to FreeRDPConvertColor() as 681 # ConvertColor() 682 AC_CHECK_DECL([FreeRDPConvertColor], 683 [AC_DEFINE([HAVE_FREERDPCONVERTCOLOR],, 684 [Whether FreeRDPConvertColor() is defined])],, 685 [#include <freerdp/codec/color.h>]) 686 687fi 688 689# It is difficult or impossible to test for variations in FreeRDP behavior in 690# between releases, as the change in behavior may not (yet) be associated with 691# a corresponding change in version number and may not have any detectable 692# effect on the FreeRDP API 693 694AC_ARG_ENABLE(allow_freerdp_snapshots, 695 [AS_HELP_STRING([--enable-allow-freerdp-snapshots], 696 [allow building against unknown development snapshots of FreeRDP]) 697 ],allow_freerdp_snapshots=yes) 698 699if test "x${have_freerdp2}" = "xyes" -a "x${allow_freerdp_snapshots}" != "xyes" 700then 701 702 AC_MSG_CHECKING([whether FreeRDP appears to be a development version]) 703 AC_EGREP_CPP([\"[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?\"], [ 704 705 #include <freerdp/version.h> 706 FREERDP_VERSION_FULL 707 708 ], 709 [AC_MSG_RESULT([no])], 710 [AC_MSG_RESULT([yes])] 711 [AC_MSG_ERROR([ 712 -------------------------------------------- 713 You are building against a development version of FreeRDP. Non-release 714 versions of FreeRDP may have differences in behavior that are impossible to 715 check for at build time. This may result in memory leaks or other strange 716 behavior. 717 718 *** PLEASE USE A RELEASED VERSION OF FREERDP IF POSSIBLE *** 719 720 If you are ABSOLUTELY CERTAIN that building against this version of FreeRDP 721 is OK, rerun configure with the --enable-allow-freerdp-snapshots 722 --------------------------------------------])]) 723 724fi 725 726# Variation in memory internal allocation/free behavior for bitmaps 727if test "x${have_freerdp2}" = "xyes" 728then 729 730 # FreeRDP 2.0.0-rc0 and older automatically free rdpBitmap and its 731 # associated data member within Bitmap_Free(), relying on the 732 # implementation-specific free handler to free only implementation-specific 733 # data. This changed in commit 2cf10cc, and implementations must now 734 # manually free all data associated with the rdpBitmap, even data which 735 # was not allocated by the implementation. 736 AC_MSG_CHECKING([whether Bitmap_Free() frees the rdpBitmap and its image data]) 737 AC_EGREP_CPP([\"2\\.0\\.0-dev\"], [ 738 739 #include <freerdp/version.h> 740 FREERDP_VERSION_FULL 741 742 ], 743 [AC_MSG_RESULT([yes])] 744 [AC_DEFINE([FREERDP_BITMAP_FREE_FREES_BITMAP],, 745 [Whether Bitmap_Free() frees the rdpBitmap and its image data])], 746 [AC_MSG_RESULT([no])]) 747 748fi 749 750# Variation in memory internal allocation/free behavior for channel streams 751if test "x${have_freerdp2}" = "xyes" 752then 753 754 # FreeRDP 2.0.0-rc3 through 2.0.0-rc4 automatically free the wStream 755 # provided to pVirtualChannelWriteEx(). This changed in commit 1b78b59, and 756 # implementations must manually free the wStream after it is no longer 757 # needed (after the write is complete or cancelled). 758 AC_MSG_CHECKING([whether pVirtualChannelWriteEx() frees the wStream upon completion]) 759 AC_EGREP_CPP([\"2\\.0\\.0-(rc|dev)[3-4]\"], [ 760 761 #include <freerdp/version.h> 762 FREERDP_VERSION_FULL 763 764 ], 765 [AC_MSG_RESULT([yes])] 766 [AC_DEFINE([FREERDP_SVC_CORE_FREES_WSTREAM],, 767 [Whether pVirtualChannelWriteEx() frees the wStream upon completion])], 768 [AC_MSG_RESULT([no])]) 769 770fi 771 772 773# Glyph callback variants 774if test "x${have_freerdp2}" = "xyes" 775then 776 777 # FreeRDP 2.0.0-rc3 and older used UINT32 for integer parameters to all 778 # rdpGlyph callbacks 779 AC_MSG_CHECKING([whether rdpGlyph callbacks accept INT32 integer parameters]) 780 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 781 782 #include <freerdp/freerdp.h> 783 #include <freerdp/graphics.h> 784 #include <winpr/wtypes.h> 785 786 BOOL test_begindraw(rdpContext* context, INT32 x, INT32 y, 787 INT32 width, INT32 height, UINT32 fgcolor, UINT32 bgcolor, 788 BOOL redundant); 789 790 rdpGlyph glyph = { 791 .BeginDraw = test_begindraw 792 }; 793 794 int main() { 795 return (int) glyph.BeginDraw(NULL, 0, 0, 0, 0, 0, 0, FALSE); 796 } 797 798 ]])], 799 [AC_MSG_RESULT([yes])] 800 [AC_DEFINE([FREERDP_GLYPH_CALLBACKS_ACCEPT_INT32],, 801 [Whether rdpGlyph callbacks accept INT32 integer parameters])], 802 [AC_MSG_RESULT([no])]) 803 804fi 805 806# CLIPRDR callback variants 807if test "x${have_freerdp2}" = "xyes" 808then 809 810 # FreeRDP 2.0.0-rc3 and older did not use const for CLIPRDR callbacks 811 AC_MSG_CHECKING([whether CLIPRDR callbacks require const for their final parameter]) 812 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 813 814 #include <freerdp/client/cliprdr.h> 815 #include <winpr/wtypes.h> 816 817 UINT test_monitor_ready(CliprdrClientContext* cliprdr, 818 const CLIPRDR_MONITOR_READY* monitor_ready); 819 820 CliprdrClientContext context = { 821 .MonitorReady = test_monitor_ready 822 }; 823 824 int main() { 825 return (int) context.MonitorReady(NULL, NULL); 826 } 827 828 ]])], 829 [AC_MSG_RESULT([yes])] 830 [AC_DEFINE([FREERDP_CLIPRDR_CALLBACKS_REQUIRE_CONST],, 831 [Whether CLIPRDR callbacks require const for the final parameter])], 832 [AC_MSG_RESULT([no])]) 833 834fi 835 836# RAIL callback variants 837if test "x${have_freerdp2}" = "xyes" 838then 839 840 # FreeRDP 2.0.0-rc3 and older did not use const for RAIL callbacks 841 AC_MSG_CHECKING([whether RAIL callbacks require const for their final parameter]) 842 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 843 844 #include <freerdp/client/rail.h> 845 #include <winpr/wtypes.h> 846 847 UINT test_server_handshake(RailClientContext* rail, 848 const RAIL_HANDSHAKE_ORDER* handshake); 849 850 RailClientContext context = { 851 .ServerHandshake = test_server_handshake 852 }; 853 854 int main() { 855 return (int) context.ServerHandshake(NULL, NULL); 856 } 857 858 ]])], 859 [AC_MSG_RESULT([yes])] 860 [AC_DEFINE([FREERDP_RAIL_CALLBACKS_REQUIRE_CONST],, 861 [Whether RAIL callbacks require const for the final parameter])], 862 [AC_MSG_RESULT([no])]) 863 864fi 865 866# Support for receiving unannounced orders from the RDP server 867if test "x${have_freerdp2}" = "xyes" 868then 869 AC_CHECK_MEMBERS([rdpSettings.AllowUnanouncedOrdersFromServer],, 870 [AC_MSG_WARN([ 871 -------------------------------------------- 872 This version of FreeRDP does not support relaxed order checks. RDP servers 873 that send orders that the client did not announce as supported (such as the 874 VirtualBox RDP server) will likely not be usable. 875 876 See: https://issues.apache.org/jira/browse/GUACAMOLE-962 877 --------------------------------------------])], 878 [[#include <freerdp/freerdp.h>]]) 879fi 880 881# Updated certificate verification callback (introduced with 2.0.0, not present 882# in 2.0.0-rc4 or earlier) 883if test "x${have_freerdp2}" = "xyes" 884then 885 AC_CHECK_MEMBERS([freerdp.VerifyCertificateEx],,, 886 [[#include <freerdp/freerdp.h>]]) 887fi 888 889# Restore CPPFLAGS, removing FreeRDP-specific options needed for testing 890CPPFLAGS="$OLDCPPFLAGS" 891 892AC_SUBST(FREERDP2_PLUGIN_DIR) 893AM_CONDITIONAL([ENABLE_RDP], [test "x${have_freerdp2}" = "xyes"]) 894 895# 896# libssh2 897# 898 899have_libssh2=disabled 900SSH_LIBS= 901AC_ARG_WITH([ssh], 902 [AS_HELP_STRING([--with-ssh], 903 [support SSH @<:@default=check@:>@])], 904 [], 905 [with_ssh=check]) 906 907AC_ARG_ENABLE(ssh_agent, 908 [AS_HELP_STRING([--enable-ssh-agent], 909 [enable built-in ssh-agent]) 910 ],enable_ssh_agent=yes) 911 912if test "x$with_ssh" != "xno" 913then 914 have_libssh2=yes 915 916 AC_CHECK_LIB([ssh2], [libssh2_userauth_publickey_frommemory], 917 [SSH_LIBS="$SSH_LIBS -lssh2"], 918 [have_libssh2=no]) 919fi 920 921AM_CONDITIONAL([ENABLE_COMMON_SSH], [test "x${have_libssh2}" = "xyes" \ 922 -a "x${have_ssl}" = "xyes"]) 923AM_COND_IF([ENABLE_COMMON_SSH], 924 [AC_DEFINE([ENABLE_COMMON_SSH],, 925 [Whether support for the common SSH core is enabled])]) 926 927AM_CONDITIONAL([ENABLE_SSH], [test "x${have_libssh2}" = "xyes" \ 928 -a "x${have_terminal}" = "xyes" \ 929 -a "x${have_ssl}" = "xyes"]) 930 931AC_SUBST(SSH_LIBS) 932 933# 934# Underlying crypto library usage of libssh2 935# 936 937if test "x${have_libssh2}" = "xyes" 938then 939 940 # Whether libssh2 was built against libgcrypt 941 AC_CHECK_LIB([ssh2], [gcry_control], 942 [AC_CHECK_HEADER(gcrypt.h, 943 [AC_DEFINE([LIBSSH2_USES_GCRYPT],, 944 [Whether libssh2 was built against libgcrypt])], 945 [AC_MSG_WARN([ 946 -------------------------------------------- 947 libssh2 appears to be built against libgcrypt, but the libgcrypt headers 948 could not be found. SSH will be disabled. 949 --------------------------------------------]) 950 have_libssh2=no])]) 951 952fi 953 954# 955# Agent forwarding support within libssh2 956# 957 958have_ssh_agent=no 959if test "x${have_libssh2}" = "xyes" -a "x${enable_ssh_agent}" = "xyes" 960then 961 962 AC_CHECK_DECL([libssh2_channel_request_auth_agent], 963 [have_ssh_agent=yes], [], 964 [[#include <libssh2.h>]]) 965 966 if test "x${have_ssh_agent}" = "xno" 967 then 968 AC_MSG_ERROR([ 969 -------------------------------------------- 970 Agent forwarding support was requested but no such support was found 971 in libssh2. 972 --------------------------------------------]) 973 else 974 AC_DEFINE([ENABLE_SSH_AGENT],, 975 [Whether agent forwarding support for SSH is enabled]) 976 fi 977 978fi 979 980AM_CONDITIONAL([ENABLE_SSH_AGENT], 981 [test "x${have_ssh_agent}" = "xyes" \ 982 -a "x${enable_ssh_agent}" = "xyes"]) 983 984# 985# libtelnet 986# 987 988have_libtelnet=disabled 989TELNET_LIBS= 990AC_ARG_WITH([telnet], 991 [AS_HELP_STRING([--with-telnet], 992 [support Telnet @<:@default=check@:>@])], 993 [], 994 [with_telnet=check]) 995 996if test "x$with_telnet" != "xno" 997then 998 have_libtelnet=yes 999 AC_CHECK_LIB([telnet], [telnet_init], 1000 [TELNET_LIBS="$TELNET_LIBS -ltelnet"], 1001 [have_libtelnet=no]) 1002fi 1003 1004AM_CONDITIONAL([ENABLE_TELNET], [test "x${have_libtelnet}" = "xyes" \ 1005 -a "x${have_terminal}" = "xyes"]) 1006 1007AC_SUBST(TELNET_LIBS) 1008 1009# 1010# libwebp 1011# 1012 1013have_webp=disabled 1014WEBP_LIBS= 1015AC_ARG_WITH([webp], 1016 [AS_HELP_STRING([--with-webp], 1017 [support WebP image encoding @<:@default=check@:>@])], 1018 [], 1019 [with_webp=check]) 1020 1021if test "x$with_webp" != "xno" 1022then 1023 have_webp=yes 1024 1025 AC_CHECK_HEADER(webp/encode.h,, [have_webp=no]) 1026 AC_CHECK_LIB([webp], [WebPEncode], [WEBP_LIBS="$WEBP_LIBS -lwebp"], [have_webp=no]) 1027 1028 if test "x${have_webp}" = "xno" 1029 then 1030 AC_MSG_WARN([ 1031 -------------------------------------------- 1032 Unable to find libwebp. 1033 Images will not be encoded using WebP. 1034 --------------------------------------------]) 1035 else 1036 AC_DEFINE([ENABLE_WEBP],, [Whether WebP support is enabled]) 1037 fi 1038fi 1039 1040AM_CONDITIONAL([ENABLE_WEBP], [test "x${have_webp}" = "xyes"]) 1041AC_SUBST(WEBP_LIBS) 1042 1043# 1044# libwebsockets 1045# 1046 1047have_libwebsockets=disabled 1048WEBSOCKETS_LIBS= 1049AC_ARG_WITH([websockets], 1050 [AS_HELP_STRING([--with-websockets], 1051 [support WebSockets @<:@default=check@:>@])], 1052 [], 1053 [with_websockets=check]) 1054 1055if test "x$with_websockets" != "xno" 1056then 1057 have_libwebsockets=yes 1058 AC_CHECK_LIB([websockets], 1059 [lws_create_context], 1060 [WEBSOCKETS_LIBS="$WEBSOCKETS_LIBS -lwebsockets"], 1061 [AC_MSG_WARN([ 1062 -------------------------------------------- 1063 Unable to find libwebsockets. 1064 Support for Kubernetes will be disabled. 1065 --------------------------------------------]) 1066 have_libwebsockets=no]) 1067fi 1068 1069if test "x$with_websockets" != "xno" 1070then 1071 1072 # Check for client-specific closed event, which must be used in favor of 1073 # the generic closed event if libwebsockets is recent enough to provide 1074 # this 1075 AC_CHECK_DECL([LWS_CALLBACK_CLIENT_CLOSED], 1076 [AC_DEFINE([HAVE_LWS_CALLBACK_CLIENT_CLOSED],, 1077 [Whether LWS_CALLBACK_CLIENT_CLOSED is defined])],, 1078 [#include <libwebsockets.h>]) 1079 1080 # Older versions of libwebsockets may not define a flag for requesting 1081 # global initialization of OpenSSL, instead performing that initialization 1082 # by default 1083 AC_CHECK_DECL([LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT], 1084 [AC_DEFINE([HAVE_LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT],, 1085 [Whether LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT is defined])],, 1086 [#include <libwebsockets.h>]) 1087 1088 # Older versions of libwebsockets do not define special macros for SSL 1089 # connection flags, instead relying on documented integer values 1090 AC_CHECK_DECL([LCCSCF_USE_SSL], 1091 [AC_DEFINE([HAVE_LCCSCF_USE_SSL],, 1092 [Whether LCCSCF_USE_SSL is defined])],, 1093 [#include <libwebsockets.h>]) 1094 1095 # Older versions of libwebsockets do not define a dummy callback which 1096 # must be invoked after the main event callback is invoked; the main event 1097 # callback must instead manually return zero 1098 AC_CHECK_DECL([lws_callback_http_dummy], 1099 [AC_DEFINE([HAVE_LWS_CALLBACK_HTTP_DUMMY],, 1100 [Whether lws_callback_http_dummy() is defined])],, 1101 [#include <libwebsockets.h>]) 1102 1103fi 1104 1105AM_CONDITIONAL([ENABLE_WEBSOCKETS], 1106 [test "x${have_libwebsockets}" = "xyes"]) 1107 1108AC_SUBST(WEBSOCKETS_LIBS) 1109 1110# 1111# Kubernetes 1112# 1113 1114AC_ARG_ENABLE([kubernetes], 1115 [AS_HELP_STRING([--disable-kubernetes], 1116 [do not build support for attaching to Kubernetes pods])], 1117 [], 1118 [enable_kubernetes=yes]) 1119 1120AM_CONDITIONAL([ENABLE_KUBERNETES], [test "x${enable_kubernetes}" = "xyes" \ 1121 -a "x${have_libwebsockets}" = "xyes" \ 1122 -a "x${have_ssl}" = "xyes" \ 1123 -a "x${have_terminal}" = "xyes"]) 1124 1125# 1126# guacd 1127# 1128 1129AC_ARG_ENABLE([guacd], 1130 [AS_HELP_STRING([--disable-guacd], 1131 [do not build the Guacamole proxy daemon])], 1132 [], 1133 [enable_guacd=yes]) 1134 1135AM_CONDITIONAL([ENABLE_GUACD], [test "x${enable_guacd}" = "xyes"]) 1136 1137# 1138# guacenc 1139# 1140 1141AC_ARG_ENABLE([guacenc], 1142 [AS_HELP_STRING([--disable-guacenc], 1143 [do not build the Guacamole video encoding tool])], 1144 [], 1145 [enable_guacenc=yes]) 1146 1147AM_CONDITIONAL([ENABLE_GUACENC], [test "x${enable_guacenc}" = "xyes" \ 1148 -a "x${have_libavcodec}" = "xyes" \ 1149 -a "x${have_libavutil}" = "xyes" \ 1150 -a "x${have_libswscale}" = "xyes" \ 1151 -a "x${have_libavformat}" = "xyes"]) 1152 1153# 1154# guaclog 1155# 1156 1157AC_ARG_ENABLE([guaclog], 1158 [AS_HELP_STRING([--disable-guaclog], 1159 [do not build the Guacamole input logging tool])], 1160 [], 1161 [enable_guaclog=yes]) 1162 1163AM_CONDITIONAL([ENABLE_GUACLOG], [test "x${enable_guaclog}" = "xyes"]) 1164 1165# 1166# Output Makefiles 1167# 1168 1169AC_CONFIG_FILES([Makefile 1170 doc/libguac/Doxyfile 1171 doc/libguac-terminal/Doxyfile 1172 src/common/Makefile 1173 src/common/tests/Makefile 1174 src/common-ssh/Makefile 1175 src/common-ssh/tests/Makefile 1176 src/terminal/Makefile 1177 src/libguac/Makefile 1178 src/libguac/tests/Makefile 1179 src/guacd/Makefile 1180 src/guacd/man/guacd.8 1181 src/guacd/man/guacd.conf.5 1182 src/guacenc/Makefile 1183 src/guacenc/man/guacenc.1 1184 src/guaclog/Makefile 1185 src/guaclog/man/guaclog.1 1186 src/pulse/Makefile 1187 src/protocols/kubernetes/Makefile 1188 src/protocols/kubernetes/tests/Makefile 1189 src/protocols/rdp/Makefile 1190 src/protocols/rdp/tests/Makefile 1191 src/protocols/ssh/Makefile 1192 src/protocols/telnet/Makefile 1193 src/protocols/vnc/Makefile]) 1194AC_OUTPUT 1195 1196# 1197# Protocol build status 1198# 1199 1200AM_COND_IF([ENABLE_KUBERNETES], [build_kubernetes=yes], [build_kubernetes=no]) 1201AM_COND_IF([ENABLE_RDP], [build_rdp=yes], [build_rdp=no]) 1202AM_COND_IF([ENABLE_SSH], [build_ssh=yes], [build_ssh=no]) 1203AM_COND_IF([ENABLE_TELNET], [build_telnet=yes], [build_telnet=no]) 1204AM_COND_IF([ENABLE_VNC], [build_vnc=yes], [build_vnc=no]) 1205 1206# 1207# Service / tool build status 1208# 1209 1210AM_COND_IF([ENABLE_GUACD], [build_guacd=yes], [build_guacd=no]) 1211AM_COND_IF([ENABLE_GUACENC], [build_guacenc=yes], [build_guacenc=no]) 1212AM_COND_IF([ENABLE_GUACLOG], [build_guaclog=yes], [build_guaclog=no]) 1213 1214# 1215# Init scripts 1216# 1217 1218AM_COND_IF([ENABLE_INIT], [build_init="${init_dir}"], [build_init=no]) 1219 1220# 1221# Systemd units 1222# 1223 1224AM_COND_IF([ENABLE_SYSTEMD], [build_systemd="${systemd_dir}"], [build_systemd=no]) 1225 1226# 1227# FreeRDP plugins 1228# 1229 1230AM_COND_IF([ENABLE_RDP], [build_rdp_plugins="${FREERDP2_PLUGIN_DIR}"], [build_rdp_plugins=no]) 1231 1232# 1233# Display summary 1234# 1235 1236echo " 1237------------------------------------------------ 1238$PACKAGE_NAME version $PACKAGE_VERSION 1239------------------------------------------------ 1240 1241 Library status: 1242 1243 freerdp2 ............ ${have_freerdp2} 1244 pango ............... ${have_pango} 1245 libavcodec .......... ${have_libavcodec} 1246 libavformat.......... ${have_libavformat} 1247 libavutil ........... ${have_libavutil} 1248 libssh2 ............. ${have_libssh2} 1249 libssl .............. ${have_ssl} 1250 libswscale .......... ${have_libswscale} 1251 libtelnet ........... ${have_libtelnet} 1252 libVNCServer ........ ${have_libvncserver} 1253 libvorbis ........... ${have_vorbis} 1254 libpulse ............ ${have_pulse} 1255 libwebsockets ....... ${have_libwebsockets} 1256 libwebp ............. ${have_webp} 1257 wsock32 ............. ${have_winsock} 1258 1259 Protocol support: 1260 1261 Kubernetes .... ${build_kubernetes} 1262 RDP ........... ${build_rdp} 1263 SSH ........... ${build_ssh} 1264 Telnet ........ ${build_telnet} 1265 VNC ........... ${build_vnc} 1266 1267 Services / tools: 1268 1269 guacd ...... ${build_guacd} 1270 guacenc .... ${build_guacenc} 1271 guaclog .... ${build_guaclog} 1272 1273 FreeRDP plugins: ${build_rdp_plugins} 1274 Init scripts: ${build_init} 1275 Systemd units: ${build_systemd} 1276 1277Type \"make\" to compile $PACKAGE_NAME. 1278" 1279