This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 897
/
Copy pathconfigure.ac
1237 lines (1126 loc) · 29.7 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
AC_INIT(freerdp, m4_esyscmd([build-aux/git-version-gen .version]),
AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
AM_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([libfreerdp-core/freerdp.c])
AC_PROG_CC
AM_PROG_CC_C_O
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall"
fi
AH_TEMPLATE(B_ENDIAN, [Big endian])
AH_TEMPLATE(L_ENDIAN, [Little endian])
AH_TEMPLATE(EGD_SOCKET, [EGD])
AH_TEMPLATE(HAVE_XV, [Define if you have XVideo extension])
AH_TEMPLATE(IPv6, [IPv6])
AH_TEMPLATE(NEED_ALIGN, [Alignment])
AH_TEMPLATE(DISABLE_TLS, [Disable TLS encryption])
AH_TEMPLATE(WITH_SSE, [Enable SSE Optimizations])
AH_TEMPLATE(WITH_NEON, [Enable NEON Optimizations])
AH_TEMPLATE(WITH_XKBFILE, [Use xkbfile for keyboard handling])
AH_TEMPLATE(WITH_PROFILER, [Turn on the code profiler])
AH_TEMPLATE(WITH_DEBUG, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_RDP, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_GDI, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_RFX, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_NLA, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_MCS, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_CACHE, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_ORDERS, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_LICENSE, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_KBD, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_X11, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_X11_KBD, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_CHANMAN, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_SCARD, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_SERIAL, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_SOUND, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_ASSERT, [Turn on debugging messages])
AH_TEMPLATE(WITH_DEBUG_STREAM_ASSERT, [Turn on debugging messages])
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_LANG_C
AC_HEADER_STDC
AC_C_BIGENDIAN([AC_DEFINE(B_ENDIAN)], [AC_DEFINE(L_ENDIAN)])
AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(inet_aton, resolv)
AC_CHECK_HEADERS(sys/select.h sys/modem.h sys/filio.h sys/strtio.h)
AC_CHECK_HEADERS(locale.h langinfo.h)
AC_CHECK_TOOL(STRIP, strip, :)
dnl Don't depend on pkg-config
m4_ifdef([PKG_CHECK_MODULES], [], [
m4_errprint([warning: pkg-config checks are not available])
m4_defun([PKG_CHECK_MODULES], [
AC_MSG_WARN([pkg-config not available, cannot check for $2])
$4
])
])
rpath=""
dnl Define keymap path
KEYMAP_PATH="${datadir}/freerdp/keymaps"
AC_SUBST(KEYMAP_PATH)
dnl Define plugin path
PLUGIN_PATH='${libdir}/freerdp'
AC_SUBST(PLUGIN_PATH)
dnl Define extensions path
EXT_PATH='${PLUGIN_PATH}/extensions'
AC_SUBST(EXT_PATH)
#
# Check Crypto libraries
#
AC_ARG_WITH([crypto],
[AS_HELP_STRING([--with-crypto=ARG],
[Choose the crypto library. Valid arguments are nss, gnutls, openssl (the default) or polarssl])],
[with_crypto=$withval],
[with_crypto=openssl])
disable_tls=yes
AM_CONDITIONAL(CRYPTO_NSS, false)
AM_CONDITIONAL(CRYPTO_GNUTLS, false)
AM_CONDITIONAL(CRYPTO_OPENSSL, false)
AM_CONDITIONAL(CRYPTO_POLARSSL, false)
case $with_crypto in
nss)
PKG_CHECK_MODULES(CRYPTO, [nss])
AM_CONDITIONAL(CRYPTO_NSS, true)
;;
gnutls)
PKG_CHECK_MODULES(CRYPTO, [gnutls >= 2.10.1])
AM_CONDITIONAL(CRYPTO_GNUTLS, true)
;;
openssl)
PKG_CHECK_MODULES(CRYPTO, [openssl >= 0.9.8a], [], [
# For systems like FreeBSD, openssl.pc is not installed. Detect it directly in a more common way
AC_CHECK_LIB(crypto, [CRYPTO_new_ex_data], [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
AC_CHECK_LIB(ssl, [SSL_library_init], [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR(OpenSSL development header not found)])
CRYPTO_LIBS="-lssl -lcrypto"
CRYPTO_CFLAGS=
AC_SUBST(CRYPTO_LIBS)
AC_SUBST(CRYPTO_CFLAGS)
])
AM_CONDITIONAL(CRYPTO_OPENSSL, true)
disable_tls=no
;;
polarssl)
AC_CHECK_LIB(polarssl, ssl_init,
[CRYPTO_LIBS=-lpolarssl],
[AC_MSG_ERROR(PolarSSL library not found)])
AC_CHECK_HEADER(polarssl/ssl.h,
[CRYPTO_CFLAGS=],
[AC_MSG_ERROR(PolarSSL development header not found)])
AC_SUBST(CRYPTO_LIBS)
AC_SUBST(CRYPTO_CFLAGS)
AM_CONDITIONAL(CRYPTO_POLARSSL, true)
;;
*)
AC_MSG_ERROR([Invalid --with-crypto argument $with_crypto.])
;;
esac
#
# Disable TLS encryption
#
AC_ARG_ENABLE(tls,
[AS_HELP_STRING([--disable-tls], [disable TLS encryption])],
[
if test $enableval = "no";
then
disable_tls=yes
fi
])
AM_CONDITIONAL(ENABLE_TLS, true)
if test "$disable_tls" = "yes"; then
AC_DEFINE(DISABLE_TLS,1)
AM_CONDITIONAL(ENABLE_TLS, false)
fi
#
# Smartcard
#
smartcard="no"
AC_ARG_WITH(smartcard,
[AS_HELP_STRING([--with-smartcard], [Build smart-card sub-plugin])],
[
if test "$withval" = no; then
WITH_SCARD=0
else
case "$OSTYPE" in
darwin*)
AC_CHECK_HEADER(PCSC/pcsclite.h, [WITH_SCARD=1], [WITH_SCARD=0])
PCSCLITE_CFLAGS=""
PCSCLITE_LIBS="-framework PCSC"
;;
*)
if test -n "$PKG_CONFIG"; then
PKG_CHECK_MODULES(PCSCLITE, libpcsclite, [WITH_SCARD=1], [WITH_SCARD=0])
fi
;;
esac
if test x"$WITH_SCARD" = "x1"; then
AC_SUBST(PCSCLITE_CFLAGS)
AC_SUBST(PCSCLITE_LIBS)
smartcard="yes"
fi
fi
])
#
# Alignment
#
AC_MSG_CHECKING([if architecture needs alignment])
AC_TRY_RUN([
#include <stdlib.h>
#include <signal.h>
int main(int argc, char **argv)
{
unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 };
signal(SIGBUS, exit);
signal(SIGABRT, exit);
signal(SIGSEGV, exit);
if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) {
return 1;
}
return 0;
}],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)
AC_DEFINE(NEED_ALIGN)],
[AC_MSG_RESULT(assuming yes)
AC_DEFINE(NEED_ALIGN)])
#
# sound
#
AC_ARG_WITH([alsa],
[AS_HELP_STRING([--with-alsa], [Build ALSA sub-plugins])])
alsa="no"
AS_IF([test "x$with_alsa" != xno], [
PKG_CHECK_MODULES(ALSA, alsa, [
alsa="yes"
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
], [
if test "x$with_alsa" == xyes; then
AC_MSG_ERROR([ALSA development headers not found])
fi
])
])
AC_ARG_WITH([pulse],
[AS_HELP_STRING([--with-pulse], [Build PulseAudio sub-plugins])])
pulse="no"
AS_IF([test "x$with_pulse" != xno], [
PKG_CHECK_MODULES(PULSE, libpulse, [
pulse="yes"
AC_SUBST(PULSE_CFLAGS)
AC_SUBST(PULSE_LIBS)
], [
if test "x$with_pulse" == xyes; then
AC_MSG_ERROR([PulseAudio development headers not found])
fi
])
])
#
# Video
#
AC_ARG_WITH([ffmpeg],
[AS_HELP_STRING([--with-ffmpeg], [Build Multimedia Redirection with FFmpeg])])
ffmpeg="no"
AS_IF([test "x$with_ffmpeg" != xno], [
PKG_CHECK_MODULES(FFMPEG, [libavcodec], [
ffmpeg="yes"
AC_SUBST(FFMPEG_CFLAGS)
AC_SUBST(FFMPEG_LIBS)
], [
if test "x$with_ffmpeg" == xyes; then
AC_MSG_ERROR([FFmpeg development headers not found])
fi
])
])
#
# printer
#
AC_ARG_WITH([printer],
[AS_HELP_STRING([--with-printer=ARG],
[Choose the printer module. Valid arguments are cups, no (default is cups)])],
[printer=$withval],
[printer=cups])
AM_CONDITIONAL(RDPDR_PRINTER_CUPS, false)
case $printer in
cups)
AC_CHECK_PROG(HAVE_CUPS, cups-config, 1, 0)
if test x"$HAVE_CUPS" = "x1"; then
CUPS_CFLAGS=`cups-config --cflags`
AC_SUBST(CUPS_CFLAGS)
CUPS_LIBS=`cups-config --libs`
AC_SUBST(CUPS_LIBS)
AM_CONDITIONAL(RDPDR_PRINTER_CUPS, true)
else
AC_MSG_WARN([Printer support disabled. CUPS development package not found.])
printer=no
fi
;;
no)
AC_MSG_WARN([Printer support disabled.])
;;
*)
AC_MSG_ERROR([Invalid --with-printer argument $with_printer.])
;;
esac
# Checks for time zones
AC_STRUCT_TIMEZONE
#
# dirfd
#
dnl Find out how to get the file descriptor associated with an open DIR*.
dnl From Jim Meyering
AC_DEFUN([UTILS_FUNC_DIRFD],
[
AC_HEADER_DIRENT
dirfd_headers='
#if HAVE_DIRENT_H
# include <dirent.h>
#else /* not HAVE_DIRENT_H */
# define dirent direct
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
# if HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
# if HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
'
AC_CHECK_FUNCS(dirfd)
AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
AC_CACHE_CHECK([whether dirfd is a macro],
jm_cv_func_dirfd_macro,
[AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
#ifdef dirfd
dirent_header_defines_dirfd
#endif],
jm_cv_func_dirfd_macro=yes,
jm_cv_func_dirfd_macro=no)])
# Use the replacement only if we have no function, macro,
# or declaration with that name.
if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
= no,no,no; then
AC_REPLACE_FUNCS([dirfd])
AC_CACHE_CHECK(
[how to get the file descriptor associated with an open DIR*],
gl_cv_sys_dir_fd_member_name,
[
dirfd_save_CFLAGS=$CFLAGS
for ac_expr in d_fd dd_fd; do
CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
AC_TRY_COMPILE(
[$dirfd_headers
],
[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
dir_fd_found=yes
)
CFLAGS=$dirfd_save_CFLAGS
test "$dir_fd_found" = yes && break
done
test "$dir_fd_found" = yes || ac_expr=no_such_member
gl_cv_sys_dir_fd_member_name=$ac_expr
]
)
if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
$gl_cv_sys_dir_fd_member_name,
[the name of the file descriptor member of DIR])
fi
AH_VERBATIM(DIR_TO_FD,
[#ifdef DIR_FD_MEMBER_NAME
# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
#else
# define DIR_TO_FD(Dir_p) -1
#endif
]
)
fi
])
UTILS_FUNC_DIRFD
#
# iconv
#
dnl This macros shamelessly stolen from
dnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html.
dnl Written by Bruno Haible.
AC_DEFUN([UTILS_FUNC_ICONV],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
AC_ARG_WITH([libiconv-prefix],
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
done
])
AC_CHECK_HEADERS(iconv.h)
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
LIBICONV=
if test "$am_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
fi
AC_SUBST(LIBICONV)
])
AC_ARG_ENABLE(iconv,
[AS_HELP_STRING([--disable-iconv], [disable iconv support])],
[
if test $enableval != "no";
then
UTILS_FUNC_ICONV
fi
],
[
UTILS_FUNC_ICONV
])
LIBS="$LIBS $LIBICONV"
#
# socklen_t
# from curl
dnl Check for socklen_t: historically on BSD it is an int, and in
dnl POSIX 1g it is a type of its own, but some platforms use different
dnl types for the argument to getsockopt, getpeername, etc. So we
dnl have to test to find something that will work.
AC_DEFUN([TYPE_SOCKLEN_T],
[
AC_CHECK_TYPE([socklen_t], ,[
AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([socklen_t_cv_equiv],
[
# Systems have either "struct sockaddr *" or
# "void *" as the second argument to getpeername
socklen_t_cv_equiv=
for arg2 in "struct sockaddr" void; do
for t in int size_t unsigned long "unsigned long"; do
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
int getpeername (int, $arg2 *, $t *);
],[
$t len;
getpeername(0,0,&len);
],[
socklen_t_cv_equiv="$t"
break
])
done
done
if test "x$socklen_t_cv_equiv" = x; then
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
fi
])
AC_MSG_RESULT($socklen_t_cv_equiv)
AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_cv_equiv,
[type to use in place of socklen_t if not defined])],
[#include <sys/types.h>
#include <sys/socket.h>])
])
TYPE_SOCKLEN_T
#
# statfs stuff
#
AC_CHECK_HEADERS(sys/vfs.h)
AC_CHECK_HEADERS(sys/statvfs.h)
AC_CHECK_HEADERS(sys/statfs.h)
AC_CHECK_HEADERS(sys/param.h)
mount_includes="\
$ac_includes_default
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
"
AC_CHECK_HEADERS(sys/mount.h,,,[$mount_includes])
#################################################
# these tests are taken from the GNU fileutils package
AC_CHECKING(how to get filesystem space usage)
space=no
# Test for statvfs64.
if test $space = no; then
# SVR4
AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
[AC_TRY_RUN([
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/statvfs.h>
main ()
{
struct statvfs64 fsd;
exit (statvfs64 (".", &fsd));
}],
fu_cv_sys_stat_statvfs64=yes,
fu_cv_sys_stat_statvfs64=no,
fu_cv_sys_stat_statvfs64=cross)])
if test $fu_cv_sys_stat_statvfs64 = yes; then
space=yes
AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
fi
fi
# Perform only the link test since it seems there are no variants of the
# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
# because that got a false positive on SCO OSR5. Adding the declaration
# of a `struct statvfs' causes this test to fail (as it should) on such
# systems. That system is reported to work fine with STAT_STATFS4 which
# is what it gets when this test fails.
if test $space = no; then
# SVR4
AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
[AC_TRY_LINK([#include <sys/types.h>
#include <sys/statvfs.h>],
[struct statvfs fsd; statvfs (0, &fsd);],
fu_cv_sys_stat_statvfs=yes,
fu_cv_sys_stat_statvfs=no)])
if test $fu_cv_sys_stat_statvfs = yes; then
space=yes
AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
fi
fi
if test $space = no; then
# DEC Alpha running OSF/1
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
[AC_TRY_RUN([
#include <sys/param.h>
#include <sys/types.h>
#include <sys/mount.h>
main ()
{
struct statfs fsd;
fsd.f_fsize = 0;
exit (statfs (".", &fsd, sizeof (struct statfs)));
}],
fu_cv_sys_stat_statfs3_osf1=yes,
fu_cv_sys_stat_statfs3_osf1=no,
fu_cv_sys_stat_statfs3_osf1=no)])
#C_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
space=yes
AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
fi
fi
if test $space = no; then
# AIX
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
member (AIX, 4.3BSD)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
[AC_TRY_RUN([
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
main ()
{
struct statfs fsd;
fsd.f_bsize = 0;
exit (statfs (".", &fsd));
}],
fu_cv_sys_stat_statfs2_bsize=yes,
fu_cv_sys_stat_statfs2_bsize=no,
fu_cv_sys_stat_statfs2_bsize=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
if test $fu_cv_sys_stat_statfs2_bsize = yes; then
space=yes
AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
fi
fi
if test $space = no; then
# SVR3
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
[AC_TRY_RUN([#include <sys/types.h>
#include <sys/statfs.h>
main ()
{
struct statfs fsd;
exit (statfs (".", &fsd, sizeof fsd, 0));
}],
fu_cv_sys_stat_statfs4=yes,
fu_cv_sys_stat_statfs4=no,
fu_cv_sys_stat_statfs4=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
if test $fu_cv_sys_stat_statfs4 = yes; then
space=yes
AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
fi
fi
if test $space = no; then
# 4.4BSD and NetBSD
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
member (4.4BSD and NetBSD)])
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
[AC_TRY_RUN([#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
main ()
{
struct statfs fsd;
fsd.f_fsize = 0;
exit (statfs (".", &fsd));
}],
fu_cv_sys_stat_statfs2_fsize=yes,
fu_cv_sys_stat_statfs2_fsize=no,
fu_cv_sys_stat_statfs2_fsize=no)])
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
if test $fu_cv_sys_stat_statfs2_fsize = yes; then
space=yes
AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
fi
fi
if test $space = no; then
# Ultrix
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
[AC_TRY_RUN([#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_FS_TYPES_H
#include <sys/fs_types.h>
#endif
main ()
{
struct fs_data fsd;
/* Ultrix's statfs returns 1 for success,
0 for not mounted, -1 for failure. */
exit (statfs (".", &fsd) != 1);
}],
fu_cv_sys_stat_fs_data=yes,
fu_cv_sys_stat_fs_data=no,
fu_cv_sys_stat_fs_data=no)])
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
if test $fu_cv_sys_stat_fs_data = yes; then
space=yes
AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
fi
fi
statxfs_includes="\
$ac_includes_default
#if HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
#endif
#if HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
#if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
# if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
/* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
# include <sys/param.h>
# include <sys/mount.h>
# elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
/* Ultrix 4.4 needs these for the declaration of struct statfs. */
# include <netinet/in.h>
# include <nfs/nfs_clnt.h>
# include <nfs/vfs.h>
# endif
#endif
"
AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
#
# Large file support
#
AC_SYS_LARGEFILE
#
# mntent
#
AC_CHECK_HEADERS(mntent.h)
AC_CHECK_FUNCS(setmntent)
#
# IPv6
#
AC_ARG_ENABLE(ipv6,
[AS_HELP_STRING([--disable-ipv6], [disable IPv6 support])],
[
if test $enableval != "no";
then
AC_DEFINE(IPv6,1)
fi
],
[
AC_DEFINE(IPv6,1)
])
#
# debugging
#
AC_ARG_WITH(debug,
[ --with-debug enable protocol debugging output],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-rdp,
[ --with-debug-rdp enable debugging of core RDP],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_RDP,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-gdi,
[ --with-debug-gdi enable debugging of GDI],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_GDI,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-rfx,
[ --with-debug-rfx enable debugging of RemoteFX],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_RFX,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-nla,
[ --with-debug-nla enable debugging of network level authentication],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_NLA,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-cache,
[ --with-debug-cache enable debugging of bitmap cache],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_CACHE,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-mcs,
[ --with-debug-mcs enable debugging of MCS],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_MCS,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-orders,
[ --with-debug-orders enable debugging of orders],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_ORDERS,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-license,
[ --with-debug-license enable debugging of license],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_LICENSE,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-kbd,
[ --with-debug-kbd enable debugging of keyboard handling],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_KBD,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-x11,
[ --with-debug-x11 enable debugging of X11],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_X11,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-x11-kbd,
[ --with-debug-x11-kbd enable debugging of X11 keyboard handling],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_X11_KBD,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-chanman,
[ --with-debug-chanman enable debugging of channel manager],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_CHANMAN,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-sound,
[ --with-debug-sound enable debugging of sound code],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_SOUND,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-serial,
[ --with-debug-serial enable debugging of Serial code],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_SERIAL,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-smartcard,
[ --with-debug-smartcard enable debugging of smart-card code],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_SCARD,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-assert,
[ --with-debug-assert enable assert debugging],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_ASSERT,1)
debug_support=yes
fi
])
AC_ARG_WITH(debug-stream-assert,
[ --with-debug-stream-assert enable stream assert debugging],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_STREAM_ASSERT,1)
debug_support=yes
fi
])
if test "$debug_support" != "yes"; then
CFLAGS="$CFLAGS -DNDEBUG"
fi
#
# target-specific stuff
#
# strip leading colon from rpath
rpath=`echo $rpath |sed 's/^://'`
AC_CANONICAL_HOST
case "$host" in
*-*-solaris*)
LDFLAGS="$LDFLAGS -R$rpath"
;;
*-dec-osf*)
LDFLAGS="$LDFLAGS -Wl,-rpath,$rpath"
;;
*-*-hpux*)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
;;
*-*-irix6.5*)
CFLAGS="$CFLAGS -D__SGI_IRIX__"
;;
esac
#
# Optional build targets
#
EXTRA_SUBDIRS=""
#
# ALSA
#
if test x"$alsa" = "xyes"; then
EXTRA_SUBDIRS="$EXTRA_SUBDIRS channels/rdpsnd/alsa channels/drdynvc/audin/alsa channels/drdynvc/tsmf/alsa"
fi
#