This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
forked from apache/guacamole-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1278 lines (1067 loc) · 39.9 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
AC_PREREQ([2.61])
AC_INIT([guacamole-server], [0.9.13-incubating])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Programs
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_LIBTOOL
# Headers
AC_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])
# Source characteristics
AC_DEFINE([_XOPEN_SOURCE], [700], [Uses X/Open and POSIX APIs])
# Check for whether math library is required
AC_CHECK_LIB([m], [cos],
[MATH_LIBS=-lm],
[AC_CHECK_DECL([cos],,
AC_MSG_ERROR("Complex math functions are missing and no libm was found")
[#include <math.h>])])
# libpng
AC_CHECK_LIB([png], [png_write_png], [PNG_LIBS=-lpng],
AC_MSG_ERROR("libpng is required for writing png messages"))
# libjpeg
AC_CHECK_LIB([jpeg], [jpeg_start_compress], [JPEG_LIBS=-ljpeg],
AC_MSG_ERROR("libjpeg is required for writing jpeg messages"))
# Cairo
AC_CHECK_LIB([cairo], [cairo_create], [CAIRO_LIBS=-lcairo],
AC_MSG_ERROR("Cairo is required for drawing instructions"))
# libpthread
AC_CHECK_LIB([pthread], [pthread_create], [PTHREAD_LIBS=-lpthread
AC_DEFINE([HAVE_LIBPTHREAD],,
[Whether libpthread was found])])
# Include libdl for dlopen() if necessary
AC_CHECK_LIB([dl], [dlopen],
[DL_LIBS=-ldl],
[AC_CHECK_DECL([dlopen],,
AC_MSG_ERROR("libdl is required on systems which do not otherwise provide dlopen()"),
[#include <dlfcn.h>])])
# OSSP UUID
AC_CHECK_LIB([ossp-uuid], [uuid_make], [UUID_LIBS=-lossp-uuid],
AC_CHECK_LIB([uuid], [uuid_make], [UUID_LIBS=-luuid],
AC_MSG_ERROR("The OSSP UUID library is required")))
# Check for and validate OSSP uuid.h header
AC_CHECK_HEADERS([ossp/uuid.h])
AC_CHECK_DECL([uuid_make],,
AC_MSG_ERROR("No OSSP uuid.h found in include path"),
[#ifdef HAVE_OSSP_UUID_H
#include <ossp/uuid.h>
#else
#include <uuid.h>
#endif
])
# cunit
AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit])
AC_SUBST(DL_LIBS)
AC_SUBST(MATH_LIBS)
AC_SUBST(PNG_LIBS)
AC_SUBST(JPEG_LIBS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(UUID_LIBS)
AC_SUBST(CUNIT_LIBS)
# Library functions
AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset select strdup nanosleep])
AC_CHECK_DECL([png_get_io_ptr],
[AC_DEFINE([HAVE_PNG_GET_IO_PTR],,
[Whether png_get_io_ptr() is defined])],,
[#include <png.h>])
AC_CHECK_DECL([cairo_format_stride_for_width],
[AC_DEFINE([HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH],,
[Whether cairo_format_stride_for_width() is defined])],,
[#include <cairo/cairo.h>])
AC_CHECK_DECL([poll],
[AC_DEFINE([HAVE_POLL],,
[Whether poll() is defined])],,
[#include <poll.h>])
# Typedefs
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Bundled libguac
AC_SUBST([LIBGUAC_LTLIB], '$(top_builddir)/src/libguac/libguac.la')
AC_SUBST([LIBGUAC_INCLUDE], '-I$(top_srcdir)/src/libguac')
# Common non-libguac utility library
AC_SUBST([COMMON_LTLIB], '$(top_builddir)/src/common/libguac_common.la')
AC_SUBST([COMMON_INCLUDE], '-I$(top_srcdir)/src/common')
# Common PulseAudio utility library
AC_SUBST([PULSE_LTLIB], '$(top_builddir)/src/pulse/libguac_pulse.la')
AC_SUBST([PULSE_INCLUDE], '-I$(top_srcdir)/src/pulse')
# Common base SSH client
AC_SUBST([COMMON_SSH_LTLIB], '$(top_builddir)/src/common-ssh/libguac_common_ssh.la')
AC_SUBST([COMMON_SSH_INCLUDE], '-I$(top_srcdir)/src/common-ssh')
# Terminal emulator
AC_SUBST([TERMINAL_LTLIB], '$(top_builddir)/src/terminal/libguac_terminal.la')
AC_SUBST([TERMINAL_INCLUDE], '-I$(top_srcdir)/src/terminal $(PANGO_CFLAGS) $(PANGOCAIRO_CFLAGS) $(COMMON_INCLUDE)')
# Init directory
AC_ARG_WITH(init_dir,
[AS_HELP_STRING([--with-init-dir=<path>],
[install init scripts to the given directory])
],init_dir=$withval)
AM_CONDITIONAL([ENABLE_INIT], [test "x${init_dir}" != "x"])
AC_SUBST(init_dir)
# guacd config file
AC_ARG_WITH(guacd_conf,
[AS_HELP_STRING([--with-guacd-conf=<path>],
[the full path to the guacd config file @<:@default=/etc/guacamole/guacd.conf@:>@])],
[guacd_conf=$withval],
[guacd_conf=/etc/guacamole/guacd.conf])
AC_DEFINE_UNQUOTED([GUACD_CONF_FILE], ["$guacd_conf"], [The full path to the guacd config file])
#
# libavcodec
#
have_libavcodec=disabled
AC_ARG_WITH([libavcodec],
[AS_HELP_STRING([--with-libavcodec],
[use libavcodec when encoding video @<:@default=check@:>@])],
[],
[with_libavcodec=check])
if test "x$with_libavcodec" != "xno"
then
have_libavcodec=yes
PKG_CHECK_MODULES([AVCODEC], [libavcodec],, [have_libavcodec=no]);
fi
AM_CONDITIONAL([ENABLE_AVCODEC], [test "x${have_libavcodec}" = "xyes"])
#
# libavutil
#
have_libavutil=disabled
AC_ARG_WITH([libavutil],
[AS_HELP_STRING([--with-libavutil],
[use libavutil when encoding video @<:@default=check@:>@])],
[],
[with_libavutil=check])
if test "x$with_libavutil" != "xno"
then
have_libavutil=yes
PKG_CHECK_MODULES([AVUTIL], [libavutil],, [have_libavutil=no]);
fi
AM_CONDITIONAL([ENABLE_AVUTIL], [test "x${have_libavutil}" = "xyes"])
#
# libswscale
#
have_libswscale=disabled
AC_ARG_WITH([libswscale],
[AS_HELP_STRING([--with-libswscale],
[use libswscale when encoding video @<:@default=check@:>@])],
[],
[with_libswscale=check])
if test "x$with_libswscale" != "xno"
then
have_libswscale=yes
PKG_CHECK_MODULES([SWSCALE], [libswscale],, [have_libswscale=no]);
fi
AM_CONDITIONAL([ENABLE_SWSCALE], [test "x${have_libswscale}" = "xyes"])
#
# libssl
#
have_ssl=disabled
SSL_LIBS=
AC_ARG_WITH([ssl],
[AS_HELP_STRING([--with-ssl],
[support SSL encryption @<:@default=check@:>@])],
[],
[with_ssl=check])
if test "x$with_ssl" != "xno"
then
have_ssl=yes
AC_CHECK_HEADER(openssl/ssl.h,, [have_ssl=no])
AC_CHECK_LIB([ssl], [SSL_CTX_new], [SSL_LIBS="$SSL_LIBS -lssl -lcrypto"], [have_ssl=no])
if test "x${have_ssl}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
Unable to find libssl.
guacd will not support SSL connections.
--------------------------------------------])
else
AC_DEFINE([ENABLE_SSL],, [Whether SSL-related support is enabled])
# OpenSSL 1.1 accessor function for DSA signature values
AC_CHECK_DECL([DSA_SIG_get0],
[AC_DEFINE([HAVE_DSA_SIG_GET0],,
[Whether libssl provides DSA_SIG_get0()])],,
[#include <openssl/dsa.h>])
# OpenSSL 1.1 accessor function for DSA public key parameters
AC_CHECK_DECL([DSA_get0_pqg],
[AC_DEFINE([HAVE_DSA_GET0_PQG],,
[Whether libssl provides DSA_get0_pqg()])],,
[#include <openssl/dsa.h>])
# OpenSSL 1.1 accessor function for DSA public/private key values
AC_CHECK_DECL([DSA_get0_key],
[AC_DEFINE([HAVE_DSA_GET0_KEY],,
[Whether libssl provides DSA_get0_key()])],,
[#include <openssl/dsa.h>])
# OpenSSL 1.1 accessor function for RSA public/private key values
AC_CHECK_DECL([RSA_get0_key],
[AC_DEFINE([HAVE_RSA_GET0_KEY],,
[Whether libssl provides RSA_get0_key()])],,
[#include <openssl/rsa.h>])
# OpenSSL 1.1 does away with explicit threading callbacks
AC_MSG_CHECKING([whether libssl requires threading callbacks])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#error Threading callbacks required.
#endif
int main() {
return 0;
}
]])],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
AC_DEFINE([OPENSSL_REQUIRES_THREADING_CALLBACKS],,
[Whether OpenSSL requires explicit threading callbacks for threadsafety])])
fi
fi
AM_CONDITIONAL([ENABLE_SSL], [test "x${have_ssl}" = "xyes"])
AC_SUBST(SSL_LIBS)
#
# Winsock
#
have_winsock=disabled
WINSOCK_LIBS=
AC_ARG_WITH([winsock],
[AS_HELP_STRING([--with-winsock],
[support Windows Sockets API @<:@default=check@:>@])],
[],
[with_winsock=check])
if test "x$with_winsock" != "xno"
then
have_winsock=yes
AC_CHECK_LIB([wsock32], [main],
[WINSOCK_LIBS="-lwsock32"]
[AC_DEFINE([ENABLE_WINSOCK],,
[Whether Windows Socket API support is enabled])],
[have_winsock=no])
fi
AM_CONDITIONAL([ENABLE_WINSOCK], [test "x${have_winsock}" = "xyes"])
AC_SUBST(WINSOCK_LIBS)
#
# Ogg Vorbis
#
have_vorbis=disabled
VORBIS_LIBS=
AC_ARG_WITH([vorbis],
[AS_HELP_STRING([--with-vorbis],
[support Ogg Vorbis @<:@default=check@:>@])],
[],
[with_vorbis=check])
if test "x$with_vorbis" != "xno"
then
have_vorbis=yes
AC_CHECK_HEADER(vorbis/vorbisenc.h,, [have_vorbis=no])
AC_CHECK_LIB([ogg], [ogg_stream_init], [VORBIS_LIBS="$VORBIS_LIBS -logg"], [have_vorbis=no])
AC_CHECK_LIB([vorbis], [vorbis_block_init], [VORBIS_LIBS="$VORBIS_LIBS -lvorbis"], [have_vorbis=no])
AC_CHECK_LIB([vorbisenc], [vorbis_encode_init], [VORBIS_LIBS="$VORBIS_LIBS -lvorbisenc"], [have_vorbis=no])
if test "x${have_vorbis}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
Unable to find libogg / libvorbis / libvorbisenc.
Sound will not be encoded with Ogg Vorbis.
--------------------------------------------])
else
AC_DEFINE([ENABLE_OGG],,
[Whether support for Ogg Vorbis is enabled])
fi
fi
AM_CONDITIONAL([ENABLE_OGG], [test "x${have_vorbis}" = "xyes"])
AC_SUBST(VORBIS_LIBS)
#
# PulseAudio
#
have_pulse=disabled
PULSE_LIBS=
AC_ARG_WITH([pulse],
[AS_HELP_STRING([--with-pulse],
[support PulseAudio @<:@default=check@:>@])],
[],
[with_pulse=check])
if test "x$with_pulse" != "xno"
then
have_pulse=yes
AC_CHECK_LIB([pulse], [pa_context_new], [PULSE_LIBS="$PULSE_LIBS -lpulse"], [have_pulse=no])
if test "x${have_pulse}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
Unable to find libpulse
Sound support for VNC will be disabled
--------------------------------------------])
else
AC_DEFINE([ENABLE_PULSE],, [Whether PulseAudio support is enabled])
fi
fi
AM_CONDITIONAL([ENABLE_PULSE], [test "x${have_pulse}" = "xyes"])
AC_SUBST(PULSE_LIBS)
#
# PANGO
#
have_pango=disabled
AC_ARG_WITH([pango],
[AS_HELP_STRING([--with-pango],
[support Pango text layout @<:@default=check@:>@])],
[],
[with_pango=check])
if test "x$with_pango" != "xno"
then
have_pango=yes
PKG_CHECK_MODULES([PANGO], [pango],, [have_pango=no]);
PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo],, [have_pango=no]);
fi
#
# Terminal emulator
#
have_terminal=disabled
AC_ARG_WITH([terminal],
[AS_HELP_STRING([--with-terminal],
[support text-based protocols @<:@default=check@:>@])],
[],
[with_terminal=check])
if test "x$with_terminal" != "xno"
then
have_terminal=yes
if test "x${have_pango}" = "xno"
then
have_terminal=no
fi
fi
AM_CONDITIONAL([ENABLE_TERMINAL], [test "x${have_terminal}" = "xyes"])
#
# libVNCServer
#
have_libvncserver=disabled
VNC_LIBS=
AC_ARG_WITH([vnc],
[AS_HELP_STRING([--with-vnc],
[support VNC @<:@default=check@:>@])],
[],
[with_vnc=check])
if test "x$with_vnc" != "xno"
then
have_libvncserver=yes
AC_CHECK_LIB([vncclient], [rfbInitClient], [VNC_LIBS="$VNC_LIBS -lvncclient"], [have_libvncserver=no])
fi
AM_CONDITIONAL([ENABLE_VNC], [test "x${have_libvncserver}" = "xyes"])
AC_SUBST(VNC_LIBS)
#
# Repeater support within libVNCServer
#
if test "x${have_libvncserver}" = "xyes"
then
have_vnc_repeater=yes
AC_CHECK_MEMBERS([rfbClient.destHost, rfbClient.destPort],
[], [have_vnc_repeater=no],
[[#include <rfb/rfbclient.h>]])
if test "x${have_vnc_repeater}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
No repeater support found in libvncclient.
Support for VNC repeaters will not be built.
--------------------------------------------])
else
AC_DEFINE([ENABLE_VNC_REPEATER],,
[Whether support for VNC repeaters is enabled.])
fi
fi
#
# Listening support within libVNCServer
#
if test "x${have_libvncserver}" = "xyes"
then
have_vnc_listen=yes
AC_CHECK_DECL([listenForIncomingConnectionsNoFork],
[], [have_vnc_listen=no],
[[#include <rfb/rfbclient.h>]])
if test "x${have_vnc_listen}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
No listening support found in libvncclient.
Support for listen-mode connections will not be built.
--------------------------------------------])
else
AC_DEFINE([ENABLE_VNC_LISTEN],,
[Whether support for listen-mode VNC connections is enabled.])
fi
fi
#
# FreeRDP
#
have_freerdp=disabled
RDP_LIBS=
WINPR_LIBS=
AC_ARG_WITH([rdp],
[AS_HELP_STRING([--with-rdp],
[support RDP @<:@default=check@:>@])],
[],
[with_rdp=check])
if test "x$with_rdp" != "xno"
then
have_winpr=yes
have_freerdp=yes
legacy_freerdp_extensions=no
rdpsettings_interface=unknown
rdpsettings_audiocapture=yes
rdpsettings_audioplayback=yes
rdpsettings_deviceredirection=yes
freerdp_interface=unknown
event_interface=unknown
# libfreerdp-core / libfreerdp
AC_CHECK_LIB([freerdp-core], [freerdp_new],
[RDP_LIBS="$RDP_LIBS -lfreerdp-core"],
[AC_CHECK_LIB([freerdp], [freerdp_new],
[RDP_LIBS="$RDP_LIBS -lfreerdp -lfreerdp-client"],
[AC_MSG_WARN([
--------------------------------------------
Unable to find libfreerdp-core / libfreerdp
RDP will be disabled.
--------------------------------------------])
have_freerdp=no])])
fi
# libfreerdp-cache
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_LIB([freerdp-cache], [glyph_cache_register_callbacks],
[RDP_LIBS="$RDP_LIBS -lfreerdp-cache"])
fi
# libfreerdp-channels (1.0) / libfreerdp-client + libfreerdp-core (1.1)
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_LIB([freerdp-client], [freerdp_channels_new],
[RDP_LIBS="$RDP_LIBS -lfreerdp-client"],
[AC_CHECK_LIB([freerdp-channels], [freerdp_channels_new],
[RDP_LIBS="$RDP_LIBS -lfreerdp-channels"
legacy_freerdp_extensions=yes])],
[-lfreerdp-core])
fi
# libfreerdp-utils
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_LIB([freerdp-utils], [svc_plugin_init],
[RDP_LIBS="$RDP_LIBS -lfreerdp-utils"])
fi
# libfreerdp-codec
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_LIB([freerdp-codec], [freerdp_image_convert],
[RDP_LIBS="$RDP_LIBS -lfreerdp-codec"])
fi
# Available color conversion functions
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_DECL([freerdp_convert_gdi_order_color],
[AC_DEFINE([HAVE_FREERDP_CONVERT_GDI_ORDER_COLOR],,
[Whether freerdp_convert_gdi_order_color() is defined])],,
[#include <freerdp/codec/color.h>])
AC_CHECK_DECL([freerdp_color_convert_drawing_order_color_to_gdi_color],
[AC_DEFINE([HAVE_FREERDP_COLOR_CONVERT_DRAWING_ORDER_COLOR_TO_GDI_COLOR],,
[Whether freerdp_color_convert_drawing_order_color_to_gdi_color() is defined])],,
[#include <freerdp/codec/color.h>])
fi
# Check for interval polling in plugins
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_MEMBERS([rdpSvcPlugin.interval_ms],,,
[[#include <freerdp/utils/svc_plugin.h>]])
fi
# Keyboard layout header
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADERS([freerdp/locale/keyboard.h],,
[AC_CHECK_HEADERS([freerdp/kbd/layouts.h],,
[AC_MSG_WARN([
--------------------------------------------
Unable to find keyboard layout headers
RDP will be disabled.
--------------------------------------------])
have_freerdp=no])])
fi
# New headers defining addins
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADERS([freerdp/addin.h freerdp/client/channels.h])
fi
# Header defining cliprdr
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADERS([freerdp/client/cliprdr.h],,
[AC_CHECK_HEADERS([freerdp/plugins/cliprdr.h],,
[AC_MSG_WARN([
--------------------------------------------
Unable to find cliprdr headers
RDP will be disabled.
--------------------------------------------])
have_freerdp=no],
[#include <freerdp/types.h>])],
[#include <winpr/wtypes.h>
#include <winpr/collections.h>])
fi
# Header defining display update channel
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADERS([freerdp/client/disp.h],
[AC_DEFINE([HAVE_FREERDP_DISPLAY_UPDATE_SUPPORT],,
[Whether FreeRDP supports the display update channel])]
[AC_CHECK_MEMBERS([rdpSettings.SupportDisplayControl],,,
[[#include <freerdp/freerdp.h>]])],,
[#include <winpr/wtypes.h>
#include <winpr/collections.h>])
fi
# Support for RDP gateways
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_MEMBERS([rdpSettings.GatewayEnabled],
[AC_DEFINE([HAVE_FREERDP_GATEWAY_SUPPORT],,
[Whether FreeRDP supports RDP gateways])],,
[[#include <freerdp/freerdp.h>]])
fi
# Support for load balancing via connection brokers
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_MEMBERS([rdpSettings.LoadBalanceInfo],
[AC_DEFINE([HAVE_FREERDP_LOAD_BALANCER_SUPPORT],,
[Whether FreeRDP supports load balancers])],,
[[#include <freerdp/freerdp.h>]])
fi
# Support for "PubSub" event system
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_DECL([PubSub_SubscribeChannelConnected],
[AC_DEFINE([HAVE_FREERDP_EVENT_PUBSUB],,
[Whether this version of FreeRDP provides the PubSub event system])],,
[#include <freerdp/event.h>])
fi
# Addin registration variations
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_DECL([freerdp_register_addin_provider],
[AC_DEFINE([HAVE_FREERDP_REGISTER_ADDIN_PROVIDER],,
[Whether freerdp_register_addin_provider() is defined])],,
[#include <freerdp/addin.h>])
AC_CHECK_DECL([freerdp_channels_global_init],
[AC_DEFINE([HAVE_FREERDP_CHANNELS_GLOBAL_INIT],,
[Whether freerdp_channels_global_init() is defined])],,
[#include <freerdp/channels/channels.h>])
fi
# Availability of ADDIN_ARGV structure for configuring plugins
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_TYPE([ADDIN_ARGV],
[AC_DEFINE([HAVE_ADDIN_ARGV],,
[Whether the ADDIN_ARGV type is available])],,
[#include <freerdp/settings.h>])
fi
#
# FreeRDP: WinPR
#
# Check for stream support via WinPR
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADER(winpr/stream.h,[WINPR_LIBS="$WINPR_LIBS -lwinpr-utils"],
[have_winpr=no,
AC_CHECK_DECL([stream_write_uint8],,
[AC_MSG_WARN([
--------------------------------------------
Unable to find stream support
RDP will be disabled.
--------------------------------------------])
have_freerdp=no],
[#include <freerdp/utils/stream.h>])])
fi
# Check for types in WinPR
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADER(winpr/wtypes.h,,
[have_winpr=no,
AC_CHECK_HEADER(freerdp/types.h,,
[AC_MSG_WARN([
--------------------------------------------
Unable to find type definitions
RDP will be disabled.
--------------------------------------------])
have_freerdp=no])])
fi
if test "x${have_freerdp}" = "xyes" -a "x${have_winpr}" = "xyes"
then
AC_DEFINE([ENABLE_WINPR],,
[Whether library support for WinPR types was found])
fi
#
# FreeRDP: freerdp
#
if test "x${have_freerdp}" = "xyes"
then
# Check for current (as of 1.1) freerdp interface
AC_CHECK_MEMBERS([freerdp.ContextSize],
[freerdp_interface=stable],,
[[#include <freerdp/freerdp.h>]])
# If not current, check for legacy interface
if test "x${freerdp_interface}" = "xunknown"
then
AC_CHECK_MEMBERS([freerdp.context_size],
[freerdp_interface=legacy],,
[[#include <freerdp/freerdp.h>]])
fi
# Set defines based on interface type, warn if unknown
if test "x${freerdp_interface}" = "xlegacy"; then
AC_DEFINE([LEGACY_FREERDP],,
[Whether the older version of the FreeRDP API was found])
elif test "x${freerdp_interface}" = "xunknown"; then
AC_MSG_WARN([
--------------------------------------------
Unknown FreeRDP interface
RDP will be disabled.
--------------------------------------------])
have_freerdp=no
fi
fi
#
# FreeRDP: rdpSettings
#
if test "x${have_freerdp}" = "xyes"
then
# Check for current (as of 1.1) rdpSettings interface
AC_CHECK_MEMBERS([rdpSettings.Width,
rdpSettings.Height,
rdpSettings.FastPathInput,
rdpSettings.FastPathOutput,
rdpSettings.SendPreconnectionPdu,
rdpSettings.OrderSupport],
[rdpsettings_interface=stable],,
[[#include <freerdp/freerdp.h>]])
# If not current, check for legacy interface
if test "x${rdpsettings_interface}" = "xunknown"
then
AC_CHECK_MEMBERS([rdpSettings.width,
rdpSettings.height,
rdpSettings.order_support],
[rdpsettings_interface=legacy],,
[[#include <freerdp/freerdp.h>]])
fi
# Set defines based on interface type, warn if unknown
if test "x${rdpsettings_interface}" = "xlegacy"; then
AC_DEFINE([LEGACY_RDPSETTINGS],,
[Whether the legacy version of the rdpSettings API was found])
# Legacy interface may not have AudioPlayback settings
AC_CHECK_MEMBERS([rdpSettings.audio_playback],,
[rdpsettings_audioplayback=no],
[[#include <freerdp/freerdp.h>]])
# Legacy interface may not have AudioCapture settings
AC_CHECK_MEMBERS([rdpSettings.audio_capture],,
[rdpsettings_audiocapture=no],
[[#include <freerdp/freerdp.h>]])
# Legacy interface may not have DeviceRedirection settings
AC_CHECK_MEMBERS([rdpSettings.device_redirection],,
[rdpsettings_deviceredirection=no],
[[#include <freerdp/freerdp.h>]])
elif test "x${rdpsettings_interface}" = "xunknown"; then
AC_MSG_WARN([
--------------------------------------------
Unknown rdpSettings interface
RDP will be disabled.
--------------------------------------------])
have_freerdp=no
fi
fi
# Activate audio playback settings if present
if test "x${have_freerdp}" = "xyes" -a "x${rdpsettings_audioplayback}" = "xyes"; then
AC_DEFINE([HAVE_RDPSETTINGS_AUDIOPLAYBACK],,
[Whether the rdpSettings structure has AudioPlayback settings])
fi
# Activate audio capture settings if present
if test "x${have_freerdp}" = "xyes" -a "x${rdpsettings_audiocapture}" = "xyes"; then
AC_DEFINE([HAVE_RDPSETTINGS_AUDIOCAPTURE],,
[Whether the rdpSettings structure has AudioCapture settings])
fi
# Activate device redirection settings if present
if test "x${have_freerdp}" = "xyes" -a "x${rdpsettings_deviceredirection}" = "xyes"; then
AC_DEFINE([HAVE_RDPSETTINGS_DEVICEREDIRECTION],,
[Whether the rdpSettings structure has DeviceRedirection settings])
fi
# Check if the type CHANNEL_ENTRY_POINTS_FREERDP exists, if not define it to CHANNEL_ENTRY_POINTS_EX
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_TYPE([CHANNEL_ENTRY_POINTS_FREERDP],,
AC_DEFINE([CHANNEL_ENTRY_POINTS_FREERDP],[CHANNEL_ENTRY_POINTS_EX], [Type compatibility]),
[[#include <freerdp/svc.h>]])
fi
# Check if the freerdp version header exists
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_HEADERS([freerdp/version.h])
fi
#
# FreeRDP: rdpBitmap
#
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([whether rdpBitmap.Decompress() requires the codec_id])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <winpr/wtypes.h>
#include <freerdp/freerdp.h>
void __decompress(rdpContext* context,
rdpBitmap* bitmap,
UINT8* data,
int width,
int height,
int bpp,
int length,
BOOL compressed,
int codec_id);
rdpBitmap b = { .Decompress = __decompress };]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_DEFINE([LEGACY_RDPBITMAP],,
[Whether the legacy rdpBitmap API was found])])
fi
#
# FreeRDP: IWTSVirtualChannelCallback
#
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([whether IWTSVirtualChannelCallback.OnDataReceived() uses a wStream])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <winpr/wtypes.h>
#include <freerdp/dvc.h>
#include <freerdp/freerdp.h>
int __data_received(
IWTSVirtualChannelCallback* channel_callback,
wStream* stream);
IWTSVirtualChannelCallback cb = {
.OnDataReceived = __data_received
};
int main() {
return
cb.OnDataReceived(NULL, NULL);
}]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_DEFINE([LEGACY_IWTSVIRTUALCHANNELCALLBACK],,
[Whether the legacy IWTSVirtualChannelCallback API was found])])
fi
#
# FreeRDP: Decompression function variants
#
# Check whether interleaved_decompress() can handle the palette
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([whether interleaved_decompress() accepts an additional palette parameter])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <freerdp/codec/interleaved.h>
int main() {
BYTE* palette = NULL;
interleaved_decompress(NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, palette);
}]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([INTERLEAVED_DECOMPRESS_TAKES_PALETTE],,
[Whether interleaved_decompress() accepts an additional palette parameter])],
[AC_MSG_RESULT([no])])
fi
# Check whether planar_decompress() will handle flipping
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([whether planar_decompress() can flip])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <freerdp/codec/planar.h>
int main() {
BOOL* flip = TRUE;
planar_decompress(NULL, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, flip);
}]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([PLANAR_DECOMPRESS_CAN_FLIP],,
[Whether planar_decompress() can flip])],
[AC_MSG_RESULT([no])])
fi
#
# FreeRDP: rdpContext
#
# Check for rdpContext.codecs
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_MEMBERS([rdpContext.codecs],
[AC_DEFINE([FREERDP_BITMAP_REQUIRES_ALIGNED_MALLOC],,
[Whether this version of FreeRDP requires _aligned_malloc() for bitmap data])],,
[[#include <freerdp/freerdp.h>]])
fi
#
# FreeRDP: rdpPalette
#
if test "x${have_freerdp}" = "xyes"
then
AC_MSG_CHECKING([whether rdpPalette.entries is static])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <freerdp/update.h>
rdpPalette p;
PALETTE_ENTRY* foo = p.entries;]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_DEFINE([LEGACY_RDPPALETTE],,
[Whether the legacy rdpPalette API was found])])
fi
#
# FreeRDP: rdpPointer
#
# Check for SetDefault and SetNull members of rdpPointer
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_MEMBERS([rdpPointer.SetDefault,
rdpPointer.SetNull],
,,
[[#include <freerdp/freerdp.h>]])
fi
#
# FreeRDP: wMessage / RDP_EVENT
#
# Check for current (as of 1.1) wMessage interface
if test "x${have_freerdp}" = "xyes"
then
AC_CHECK_MEMBERS([wMessage.id],
[event_interface=stable],,
[[#include <winpr/collections.h>]])
# If not current, check for legacy (RDP_EVENT) interface
if test "x${event_interface}" = "xunknown"
then
AC_CHECK_MEMBERS([RDP_EVENT.event_class],
[event_interface=legacy],,
[[#include <freerdp/types.h>]])
fi
# Set defines based on interface type, warn if unknown