VirtualBox

source: vbox/trunk/src/VBox/RDP/client-1.8.4/configure.ac@ 85126

Last change on this file since 85126 was 76779, checked in by vboxsync, 6 years ago

RDP: add client-1.8.4.
bugref:9356: Update rdesktop-vrdp to 1.8.4
client-1.8.4 is a Subversion copy of 1.8.3 with the upstream 1.8.3 to 1.8.4
patch applied and a couple of fixes and changes after review, namely:

  • Stopped disabling the new pointer data format for our build, as this is no

longer needed.

  • Adjusted some snprintf buffers to make GCC happy.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.2 KB
Line 
1AC_INIT(rdesktop, 1.8.4)
2
3AC_CONFIG_SRCDIR([rdesktop.c])
4
5AC_CANONICAL_HOST
6
7AC_PROG_CC
8if test "$GCC" = yes; then
9 CFLAGS="$CFLAGS -Wall"
10fi
11
12AC_PROG_INSTALL
13AC_LANG_C
14AC_HEADER_STDC
15AC_C_BIGENDIAN([AC_DEFINE(B_ENDIAN)], [AC_DEFINE(L_ENDIAN)])
16AC_PATH_XTRA
17if test "$no_x" = "yes"; then
18 echo
19 echo "ERROR: Could not find X Window System headers/libraries."
20 if test -f /etc/debian_version; then
21 echo "Probably you need to install the libx11-dev package."
22 elif test -f /etc/redhat-release; then
23 echo "Probably you need to install the libX11-devel package."
24 fi
25 echo "To specify paths manually, use the options --x-includes and --x-libraries."
26 echo
27 exit 1
28fi
29
30AC_PATH_TOOL(PKG_CONFIG, pkg-config)
31
32AC_SEARCH_LIBS(socket, socket)
33AC_SEARCH_LIBS(inet_aton, resolv)
34
35AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
36AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H))
37AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H))
38AC_CHECK_HEADER(sys/strtio.h, AC_DEFINE(HAVE_SYS_STRTIO_H))
39AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H))
40AC_CHECK_HEADER(langinfo.h, AC_DEFINE(HAVE_LANGINFO_H))
41AC_CHECK_HEADER(sysexits.h, AC_DEFINE(HAVE_SYSEXITS_H))
42
43AC_CHECK_TOOL(STRIP, strip, :)
44
45dnl Don't depend on pkg-config
46m4_ifdef([PKG_CHECK_MODULES], [], [
47 m4_errprint([warning: pkg-config checks are not available])
48 m4_defun([PKG_CHECK_MODULES], [
49 AC_MSG_WARN([pkg-config not available, cannot check for $2])
50 $4
51 ])
52])
53
54#
55# OpenSSL detection borrowed from stunnel
56#
57checkssldir() { :
58 if test -f "$1/include/openssl/ssl.h"; then
59 ssldir="$1"
60 return 0
61 fi
62 return 1
63}
64AC_MSG_CHECKING([for OpenSSL directory])
65AC_ARG_WITH(openssl,
66 [ --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib],
67 [
68 dnl Check the specified location only
69 checkssldir "$withval"
70 ],
71 [
72 dnl Search default locations of OpenSSL library
73 for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do
74 for dir in $maindir $maindir/openssl $maindir/ssl; do
75 checkssldir $dir && break 2
76 done
77 done
78 ]
79)
80if test -z "$ssldir"; then
81 AC_MSG_RESULT([Not found])
82 echo
83 echo "ERROR: Could not find OpenSSL headers/libraries."
84 if test -f /etc/debian_version; then
85 echo "Probably you need to install the libssl-dev package."
86 elif test -f /etc/redhat-release; then
87 echo "Probably you need to install the openssl-devel package."
88 fi
89 echo "To specify a path manually, use the --with-openssl option."
90 echo
91 exit 1
92fi
93AC_MSG_RESULT([$ssldir])
94AC_SUBST(ssldir)
95AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
96
97dnl Add OpenSSL includes and libraries
98CFLAGS="$CFLAGS -I$ssldir/include"
99AC_ARG_ENABLE(static-openssl,
100 [ --enable-static-openssl link OpenSSL statically],
101 [static_openssl=yes],
102 [static_openssl=no])
103if test x"$static_openssl" = "xyes"; then
104 # OpenSSL generally relies on libz
105 AC_SEARCH_LIBS(deflate, z)
106 LIBS="-L$ssldir/lib -L$ssldir/lib64 -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic $LIBS"
107else
108 LIBS="-L$ssldir/lib -L$ssldir/lib64 -lssl -lcrypto $LIBS"
109
110 #
111 # target-specific stuff
112 #
113 case "$host" in
114 *-*-solaris*)
115 LDFLAGS="$LDFLAGS -R$ssldir/lib"
116 ;;
117 *-dec-osf*)
118 LDFLAGS="$LDFLAGS -Wl,-rpath,$ssldir/lib"
119 ;;
120 esac
121fi
122
123dnl CredSSP feature
124AC_ARG_ENABLE([credssp], AS_HELP_STRING([--disable-credssp], [disable support for CredSSP]))
125AC_ARG_ENABLE([static-gssglue], AS_HELP_STRING([--enable-static-gssglue]),
126 [static_gssglue=yes], [static_gssglue=no])
127AS_IF([test "x$enable_credssp" != "xno"], [
128 if test -n "$PKG_CONFIG"; then
129 PKG_CHECK_MODULES(GSSGLUE, libgssglue, [WITH_CREDSSP=1], [WITH_CREDSSP=0])
130 fi
131
132 if test x"$WITH_CREDSSP" = "x1"; then
133 CREDSSPOBJ="cssp.o"
134 CFLAGS="$CFLAGS $GSSGLUE_CFLAGS"
135
136 AS_IF([test "x$static_gssglue" != "xno"], [
137 LIBS="$LIBS -Wl,-Bstatic -lgssglue -Wl,-Bdynamic"
138 ], [
139 LIBS="$LIBS -lgssglue"
140 ])
141
142 AC_DEFINE(WITH_CREDSSP)
143 else
144 echo
145 echo "CredSSP support requires libgssglue, install the dependency"
146 echo "or disable the feature using --disable-credssp."
147 echo
148 exit 1
149 fi
150])
151AC_SUBST(CREDSSPOBJ)
152
153# xrandr
154if test -n "$PKG_CONFIG"; then
155 PKG_CHECK_MODULES(XRANDR, xrandr, [HAVE_XRANDR=1], [HAVE_XRANDR=0])
156fi
157if test x"$HAVE_XRANDR" = "x1"; then
158 CFLAGS="$CFLAGS $XRANDR_CFLAGS"
159 LIBS="$LIBS $XRANDR_LIBS"
160 AC_DEFINE(HAVE_XRANDR)
161fi
162
163dnl Smartcard support
164AC_ARG_ENABLE(smartcard, AS_HELP_STRING([--disable-smartcard], [disable support for smartcard]))
165AS_IF([test "x$enable_smartcard" != "xno"], [
166 case "$OSTYPE" in
167 darwin*)
168 AC_CHECK_HEADER(PCSC/pcsclite.h, [WITH_SCARD=1], [WITH_SCARD=0])
169 PCSCLITE_CFLAGS=""
170 PCSCLITE_LIBS="-framework PCSC"
171 ;;
172 *)
173 if test -n "$PKG_CONFIG"; then
174 PKG_CHECK_MODULES(PCSCLITE, libpcsclite, [WITH_SCARD=1], [WITH_SCARD=0])
175 fi
176 ;;
177 esac
178
179 if test x"$WITH_SCARD" = "x1"; then
180 SCARDOBJ="scard.o"
181 CFLAGS="$CFLAGS $PCSCLITE_CFLAGS"
182 LIBS="$LIBS $PCSCLITE_LIBS"
183 AC_DEFINE(WITH_SCARD)
184 else
185 echo
186 echo "SmartCard support requires PCSC, install the dependency"
187 echo "or disable the feature using --disable-smartcard."
188 echo
189 exit 1
190 fi
191
192 AC_MSG_CHECKING([for old version of PCSC])
193 AC_TRY_LINK([
194 #include <stdlib.h>
195 #ifdef __APPLE__
196 #include <PCSC/wintypes.h>
197 #include <PCSC/winscard.h>
198 #else
199 #include <winscard.h>
200 #endif
201 ],
202 [SCardControl(NULL, NULL, 0, NULL, NULL);],
203 [AC_MSG_RESULT(yes) AC_DEFINE(WITH_PCSC120, 1, [old version of PCSC])],
204 [AC_MSG_RESULT(no)])
205])
206AC_SUBST(SCARDOBJ)
207
208#
209# Alignment
210#
211AC_MSG_CHECKING([if architecture needs alignment])
212AC_TRY_RUN([
213#include <stdlib.h>
214#include <signal.h>
215int main(int argc, char **argv)
216{
217 unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 };
218 signal(SIGBUS, exit);
219 signal(SIGABRT, exit);
220 signal(SIGSEGV, exit);
221 if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) {
222 return 1;
223 }
224 return 0;
225}],
226 [AC_MSG_RESULT(no)],
227 [AC_MSG_RESULT(yes)
228 AC_DEFINE(NEED_ALIGN)],
229 [AC_MSG_RESULT(assuming yes)
230 AC_DEFINE(NEED_ALIGN)])
231
232
233#
234# EGD
235#
236AC_ARG_WITH(egd-socket,
237 [ --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH],
238 [EGD_SOCKET="$withval"],
239 [EGD_SOCKET="/var/run/egd-pool"]
240)
241AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
242
243
244#
245# rdp2vnc
246#
247vncserverconfig=libvncserver-config
248AC_ARG_WITH(libvncserver-config,
249 [ --with-libvncserver-config=CMD use CMD as libvncserver-config],
250 [vncserverconfig="$withval"]
251)
252AC_ARG_WITH(libvncserver,
253 [ --with-libvncserver make rdp2vnc],
254 [
255 VNCINC=`$vncserverconfig --cflags`
256 AC_SUBST(VNCINC)
257 LDVNC=`$vncserverconfig --libs`
258 AC_SUBST(LDVNC)
259 VNCLINK=`$vncserverconfig --link`
260 AC_SUBST(VNCLINK)
261 RDP2VNCTARGET="rdp2vnc"
262 AC_SUBST(RDP2VNCTARGET)
263 ]
264)
265
266#
267# sound
268#
269
270sound="yes"
271AC_ARG_WITH(sound,
272 [ --with-sound select sound system ("oss", "sgi", "sun", "alsa" or "libao") ],
273 [
274 sound="$withval"
275 ])
276
277AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=1], [HAVE_OSS=0])
278AC_CHECK_HEADER(dmedia/audio.h, [HAVE_SGI=1], [HAVE_SGI=0])
279AC_CHECK_HEADER(sys/audioio.h, [HAVE_SUN=1], [HAVE_SUN=0])
280
281AC_ARG_ENABLE(static-libsamplerate,
282 [ --enable-static-libsamplerate link libsamplerate statically],
283 [static_libsamplerate=yes],
284 [static_libsamplerate=no])
285
286if test -n "$PKG_CONFIG"; then
287 PKG_CHECK_MODULES(LIBAO, ao, [HAVE_LIBAO=1], [HAVE_LIBAO=0])
288 PKG_CHECK_MODULES(ALSA, alsa, [HAVE_ALSA=1], [HAVE_ALSA=0])
289 PKG_CHECK_MODULES(LIBSAMPLERATE, samplerate, [HAVE_LIBSAMPLERATE=1], [HAVE_LIBSAMPLERATE=0])
290 if test x"$HAVE_LIBSAMPLERATE" = "x1"; then
291 AC_DEFINE(HAVE_LIBSAMPLERATE)
292 if test x"$static_libsamplerate" = "xyes"; then
293 _libsamplerate_libdir=`$PKG_CONFIG --errors-to-stdout --variable=libdir samplerate`
294 LIBSAMPLERATE_LIBS="$_libsamplerate_libdir""/libsamplerate.a"
295 LIBSAMPLERATE_LIBS="$LIBSAMPLERATE_LIBS -lm"
296 fi
297 fi
298fi
299
300if test "$sound" != "no"; then
301 SOUNDOBJ="$SOUNDOBJ rdpsnd.o rdpsnd_dsp.o"
302 CFLAGS="$CFLAGS $LIBSAMPLERATE_CFLAGS"
303 LIBS="$LIBS $LIBSAMPLERATE_LIBS"
304 AC_DEFINE(WITH_RDPSND)
305fi
306
307case $sound in
308 yes)
309 if test x"$HAVE_OSS" = "x1"; then
310 SOUNDOBJ="$SOUNDOBJ rdpsnd_oss.o"
311 AC_DEFINE(RDPSND_OSS)
312 fi
313
314 if test x"$HAVE_SGI" = "x1"; then
315 SOUNDOBJ="$SOUNDOBJ rdpsnd_sgi.o"
316 LIBS="$LIBS -laudio"
317 AC_DEFINE(RDPSND_SGI)
318 fi
319
320 if test x"$HAVE_SUN" = "x1"; then
321 SOUNDOBJ="$SOUNDOBJ rdpsnd_sun.o"
322 AC_DEFINE(RDPSND_SUN)
323 fi
324
325 if test x"$HAVE_ALSA" = "x1"; then
326 SOUNDOBJ="$SOUNDOBJ rdpsnd_alsa.o"
327 CFLAGS="$CFLAGS $ALSA_CFLAGS"
328 LIBS="$LIBS $ALSA_LIBS"
329 AC_DEFINE(RDPSND_ALSA)
330 fi
331
332 if test x"$HAVE_LIBAO" = "x1"; then
333 SOUNDOBJ="$SOUNDOBJ rdpsnd_libao.o"
334 CFLAGS="$CFLAGS $LIBAO_CFLAGS"
335 LIBS="$LIBS $LIBAO_LIBS"
336 AC_DEFINE(RDPSND_LIBAO)
337 fi
338
339 ;;
340
341 oss)
342 if test x"$HAVE_OSS" = "x1"; then
343 SOUNDOBJ="$SOUNDOBJ rdpsnd_oss.o"
344 AC_DEFINE(RDPSND_OSS)
345 else
346 AC_MSG_ERROR([Selected sound system is not available.])
347 fi
348 ;;
349
350 sgi)
351 if test x"$HAVE_SGI" = "x1"; then
352 SOUNDOBJ="$SOUNDOBJ rdpsnd_sgi.o"
353 LIBS="$LIBS -laudio"
354 AC_DEFINE(RDPSND_SGI)
355 else
356 AC_MSG_ERROR([Selected sound system is not available.])
357 fi
358 ;;
359
360 sun)
361 if test x"$HAVE_SUN" = "x1"; then
362 SOUNDOBJ="$SOUNDOBJ rdpsnd_sun.o"
363 AC_DEFINE(RDPSND_SUN)
364 else
365 AC_MSG_ERROR([Selected sound system is not available.])
366 fi
367 ;;
368
369 alsa)
370 if test x"$HAVE_ALSA" = "x1"; then
371 SOUNDOBJ="$SOUNDOBJ rdpsnd_alsa.o"
372 CFLAGS="$CFLAGS $ALSA_CFLAGS"
373 LIBS="$LIBS $ALSA_LIBS"
374 AC_DEFINE(RDPSND_ALSA)
375 else
376 AC_MSG_ERROR([Selected sound system is not available.])
377 fi
378 ;;
379
380 libao)
381 if test x"$HAVE_LIBAO" = "x1"; then
382 SOUNDOBJ="$SOUNDOBJ rdpsnd_libao.o"
383 CFLAGS="$CFLAGS $LIBAO_CFLAGS"
384 LIBS="$LIBS $LIBAO_LIBS"
385 AC_DEFINE(RDPSND_LIBAO)
386 else
387 AC_MSG_ERROR([Selected sound system is not available.])
388 fi
389 ;;
390
391 no)
392 ;;
393
394 *)
395 AC_MSG_WARN([sound support disabled])
396 AC_MSG_WARN([Currently supported systems are Open Sound System (oss), SGI AL (sgi), Sun/BSD (sun), ALSA (alsa) and libao])
397 ;;
398esac
399
400AC_SUBST(SOUNDOBJ)
401
402#
403# dirfd
404#
405dnl Find out how to get the file descriptor associated with an open DIR*.
406dnl From Jim Meyering
407
408AC_DEFUN([UTILS_FUNC_DIRFD],
409[
410
411 AC_HEADER_DIRENT
412 dirfd_headers='
413#if HAVE_DIRENT_H
414# include <dirent.h>
415#else /* not HAVE_DIRENT_H */
416# define dirent direct
417# if HAVE_SYS_NDIR_H
418# include <sys/ndir.h>
419# endif /* HAVE_SYS_NDIR_H */
420# if HAVE_SYS_DIR_H
421# include <sys/dir.h>
422# endif /* HAVE_SYS_DIR_H */
423# if HAVE_NDIR_H
424# include <ndir.h>
425# endif /* HAVE_NDIR_H */
426#endif /* HAVE_DIRENT_H */
427'
428 AC_CHECK_FUNCS(dirfd)
429 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
430
431 AC_CACHE_CHECK([whether dirfd is a macro],
432 jm_cv_func_dirfd_macro,
433 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
434#ifdef dirfd
435 dirent_header_defines_dirfd
436#endif],
437 jm_cv_func_dirfd_macro=yes,
438 jm_cv_func_dirfd_macro=no)])
439
440 # Use the replacement only if we have no function, macro,
441 # or declaration with that name.
442 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
443 = no,no,no; then
444 AC_REPLACE_FUNCS([dirfd])
445 AC_CACHE_CHECK(
446 [how to get the file descriptor associated with an open DIR*],
447 gl_cv_sys_dir_fd_member_name,
448 [
449 dirfd_save_CFLAGS=$CFLAGS
450 for ac_expr in d_fd dd_fd; do
451
452 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
453 AC_TRY_COMPILE(
454 [$dirfd_headers
455 ],
456 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
457 dir_fd_found=yes
458 )
459 CFLAGS=$dirfd_save_CFLAGS
460 test "$dir_fd_found" = yes && break
461 done
462 test "$dir_fd_found" = yes || ac_expr=no_such_member
463
464 gl_cv_sys_dir_fd_member_name=$ac_expr
465 ]
466 )
467 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
468 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
469 $gl_cv_sys_dir_fd_member_name,
470 [the name of the file descriptor member of DIR])
471 fi
472 AH_VERBATIM(DIR_TO_FD,
473 [#ifdef DIR_FD_MEMBER_NAME
474# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
475#else
476# define DIR_TO_FD(Dir_p) -1
477#endif
478]
479 )
480 fi
481])
482
483UTILS_FUNC_DIRFD
484
485#
486# iconv
487#
488
489dnl This macros shamelessly stolen from
490dnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html.
491dnl Written by Bruno Haible.
492
493AC_DEFUN([UTILS_FUNC_ICONV],
494[
495 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
496 dnl those with the standalone portable GNU libiconv installed).
497
498 AC_ARG_WITH([libiconv-prefix],
499[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
500 for dir in `echo "$withval" | tr : ' '`; do
501 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
502 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
503 done
504 ])
505 AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H))
506
507 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
508 am_cv_func_iconv="no, consider installing GNU libiconv"
509 am_cv_lib_iconv=no
510 AC_TRY_LINK([#include <stdlib.h>
511#include <iconv.h>],
512 [iconv_t cd = iconv_open("","");
513 iconv(cd,NULL,NULL,NULL,NULL);
514 iconv_close(cd);],
515 am_cv_func_iconv=yes)
516 if test "$am_cv_func_iconv" != yes; then
517 am_save_LIBS="$LIBS"
518 LIBS="$LIBS -liconv"
519 AC_TRY_LINK([#include <stdlib.h>
520#include <iconv.h>],
521 [iconv_t cd = iconv_open("","");
522 iconv(cd,NULL,NULL,NULL,NULL);
523 iconv_close(cd);],
524 am_cv_lib_iconv=yes
525 am_cv_func_iconv=yes)
526 LIBS="$am_save_LIBS"
527 fi
528 ])
529 if test "$am_cv_func_iconv" = yes; then
530 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
531 AC_MSG_CHECKING([for iconv declaration])
532 AC_CACHE_VAL(am_cv_proto_iconv, [
533 AC_TRY_COMPILE([
534#include <stdlib.h>
535#include <iconv.h>
536extern
537#ifdef __cplusplus
538"C"
539#endif
540#if defined(__STDC__) || defined(__cplusplus)
541size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
542#else
543size_t iconv();
544#endif
545], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
546 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);"])
547 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
548 AC_MSG_RESULT([$]{ac_t:-
549 }[$]am_cv_proto_iconv)
550 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
551 [Define as const if the declaration of iconv() needs const.])
552 fi
553 LIBICONV=
554 if test "$am_cv_lib_iconv" = yes; then
555 LIBICONV="-liconv"
556 fi
557 AC_SUBST(LIBICONV)
558])
559
560UTILS_FUNC_ICONV
561LIBS="$LIBS $LIBICONV"
562
563#
564# socklen_t
565# from curl
566
567dnl Check for socklen_t: historically on BSD it is an int, and in
568dnl POSIX 1g it is a type of its own, but some platforms use different
569dnl types for the argument to getsockopt, getpeername, etc. So we
570dnl have to test to find something that will work.
571AC_DEFUN([TYPE_SOCKLEN_T],
572[
573 AC_CHECK_TYPE([socklen_t], ,[
574 AC_MSG_CHECKING([for socklen_t equivalent])
575 AC_CACHE_VAL([socklen_t_cv_equiv],
576 [
577 # Systems have either "struct sockaddr *" or
578 # "void *" as the second argument to getpeername
579 socklen_t_cv_equiv=
580 for arg2 in "struct sockaddr" void; do
581 for t in int size_t unsigned long "unsigned long"; do
582 AC_TRY_COMPILE([
583 #include <sys/types.h>
584 #include <sys/socket.h>
585
586 int getpeername (int, $arg2 *, $t *);
587 ],[
588 $t len;
589 getpeername(0,0,&len);
590 ],[
591 socklen_t_cv_equiv="$t"
592 break
593 ])
594 done
595 done
596
597 if test "x$socklen_t_cv_equiv" = x; then
598 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
599 fi
600 ])
601 AC_MSG_RESULT($socklen_t_cv_equiv)
602 AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_cv_equiv,
603 [type to use in place of socklen_t if not defined])],
604 [#include <sys/types.h>
605#include <sys/socket.h>])
606])
607
608TYPE_SOCKLEN_T
609
610#
611# statfs stuff
612#
613AC_CHECK_HEADERS(sys/vfs.h)
614AC_CHECK_HEADERS(sys/statvfs.h)
615AC_CHECK_HEADERS(sys/statfs.h)
616AC_CHECK_HEADERS(sys/param.h)
617
618mount_includes="\
619 $ac_includes_default
620 #if HAVE_SYS_PARAM_H
621 # include <sys/param.h>
622 #endif
623 "
624
625AC_CHECK_HEADERS(sys/mount.h,,,[$mount_includes])
626
627#################################################
628# these tests are taken from the GNU fileutils package
629AC_CHECKING(how to get filesystem space usage)
630space=no
631
632# Test for statvfs64.
633if test $space = no; then
634 # SVR4
635 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
636 [AC_TRY_RUN([
637#if defined(HAVE_UNISTD_H)
638#include <unistd.h>
639#endif
640#include <sys/types.h>
641#include <sys/statvfs.h>
642 main ()
643 {
644 struct statvfs64 fsd;
645 exit (statvfs64 (".", &fsd));
646 }],
647 fu_cv_sys_stat_statvfs64=yes,
648 fu_cv_sys_stat_statvfs64=no,
649 fu_cv_sys_stat_statvfs64=cross)])
650 if test $fu_cv_sys_stat_statvfs64 = yes; then
651 space=yes
652 AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
653 fi
654fi
655
656# Perform only the link test since it seems there are no variants of the
657# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
658# because that got a false positive on SCO OSR5. Adding the declaration
659# of a `struct statvfs' causes this test to fail (as it should) on such
660# systems. That system is reported to work fine with STAT_STATFS4 which
661# is what it gets when this test fails.
662if test $space = no; then
663 # SVR4
664 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
665 [AC_TRY_LINK([#include <sys/types.h>
666#include <sys/statvfs.h>],
667 [struct statvfs fsd; statvfs (0, &fsd);],
668 fu_cv_sys_stat_statvfs=yes,
669 fu_cv_sys_stat_statvfs=no)])
670 if test $fu_cv_sys_stat_statvfs = yes; then
671 space=yes
672 AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
673 fi
674fi
675
676if test $space = no; then
677 # DEC Alpha running OSF/1
678 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
679 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
680 [AC_TRY_RUN([
681#include <sys/param.h>
682#include <sys/types.h>
683#include <sys/mount.h>
684 main ()
685 {
686 struct statfs fsd;
687 fsd.f_fsize = 0;
688 exit (statfs (".", &fsd, sizeof (struct statfs)));
689 }],
690 fu_cv_sys_stat_statfs3_osf1=yes,
691 fu_cv_sys_stat_statfs3_osf1=no,
692 fu_cv_sys_stat_statfs3_osf1=no)])
693
694
695#C_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
696 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
697 space=yes
698 AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
699 fi
700fi
701
702if test $space = no; then
703# AIX
704 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
705member (AIX, 4.3BSD)])
706 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
707 [AC_TRY_RUN([
708#ifdef HAVE_SYS_PARAM_H
709#include <sys/param.h>
710#endif
711#ifdef HAVE_SYS_MOUNT_H
712#include <sys/mount.h>
713#endif
714#ifdef HAVE_SYS_VFS_H
715#include <sys/vfs.h>
716#endif
717 main ()
718 {
719 struct statfs fsd;
720 fsd.f_bsize = 0;
721 exit (statfs (".", &fsd));
722 }],
723 fu_cv_sys_stat_statfs2_bsize=yes,
724 fu_cv_sys_stat_statfs2_bsize=no,
725 fu_cv_sys_stat_statfs2_bsize=no)])
726 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
727 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
728 space=yes
729 AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
730 fi
731fi
732
733if test $space = no; then
734# SVR3
735 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
736 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
737 [AC_TRY_RUN([#include <sys/types.h>
738#include <sys/statfs.h>
739 main ()
740 {
741 struct statfs fsd;
742 exit (statfs (".", &fsd, sizeof fsd, 0));
743 }],
744 fu_cv_sys_stat_statfs4=yes,
745 fu_cv_sys_stat_statfs4=no,
746 fu_cv_sys_stat_statfs4=no)])
747 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
748 if test $fu_cv_sys_stat_statfs4 = yes; then
749 space=yes
750 AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
751 fi
752fi
753
754if test $space = no; then
755# 4.4BSD and NetBSD
756 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
757member (4.4BSD and NetBSD)])
758 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
759 [AC_TRY_RUN([#include <sys/types.h>
760#ifdef HAVE_SYS_PARAM_H
761#include <sys/param.h>
762#endif
763#ifdef HAVE_SYS_MOUNT_H
764#include <sys/mount.h>
765#endif
766 main ()
767 {
768 struct statfs fsd;
769 fsd.f_fsize = 0;
770 exit (statfs (".", &fsd));
771 }],
772 fu_cv_sys_stat_statfs2_fsize=yes,
773 fu_cv_sys_stat_statfs2_fsize=no,
774 fu_cv_sys_stat_statfs2_fsize=no)])
775 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
776 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
777 space=yes
778 AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
779 fi
780fi
781
782if test $space = no; then
783 # Ultrix
784 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
785 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
786 [AC_TRY_RUN([#include <sys/types.h>
787#ifdef HAVE_SYS_PARAM_H
788#include <sys/param.h>
789#endif
790#ifdef HAVE_SYS_MOUNT_H
791#include <sys/mount.h>
792#endif
793#ifdef HAVE_SYS_FS_TYPES_H
794#include <sys/fs_types.h>
795#endif
796 main ()
797 {
798 struct fs_data fsd;
799 /* Ultrix's statfs returns 1 for success,
800 0 for not mounted, -1 for failure. */
801 exit (statfs (".", &fsd) != 1);
802 }],
803 fu_cv_sys_stat_fs_data=yes,
804 fu_cv_sys_stat_fs_data=no,
805 fu_cv_sys_stat_fs_data=no)])
806 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
807 if test $fu_cv_sys_stat_fs_data = yes; then
808 space=yes
809 AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
810 fi
811fi
812
813 statxfs_includes="\
814$ac_includes_default
815#if HAVE_SYS_STATVFS_H
816# include <sys/statvfs.h>
817#endif
818#if HAVE_SYS_VFS_H
819# include <sys/vfs.h>
820#endif
821#if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
822# if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
823/* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
824# include <sys/param.h>
825# include <sys/mount.h>
826# elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
827/* Ultrix 4.4 needs these for the declaration of struct statfs. */
828# include <netinet/in.h>
829# include <nfs/nfs_clnt.h>
830# include <nfs/vfs.h>
831# endif
832#endif
833"
834
835AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
836AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
837AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
838AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
839
840#
841# Large file support
842#
843AC_SYS_LARGEFILE
844
845#
846# mntent
847#
848AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H))
849AC_CHECK_FUNCS(setmntent)
850
851#
852# IPv6
853#
854AC_ARG_WITH(ipv6,
855 [ --with-ipv6 enable IPv6-support],
856 [
857 if test $withval != "no";
858 then
859 AC_DEFINE(IPv6,1)
860 fi
861 ])
862
863
864#
865# debugging
866#
867AC_ARG_WITH(debug,
868 [ --with-debug enable protocol debugging output],
869 [
870 if test $withval != "no";
871 then
872 AC_DEFINE(WITH_DEBUG,1)
873 fi
874 ])
875
876AC_ARG_WITH(debug-kbd,
877 [ --with-debug-kbd enable debugging of keyboard handling],
878 [
879 if test $withval != "no";
880 then
881 AC_DEFINE(WITH_DEBUG_KBD,1)
882 fi
883 ])
884
885AC_ARG_WITH(debug-rdp5,
886 [ --with-debug-rdp5 enable debugging of RDP5 code],
887 [
888 if test $withval != "no";
889 then
890 AC_DEFINE(WITH_DEBUG_RDP5,1)
891 fi
892 ])
893
894AC_ARG_WITH(debug-clipboard,
895 [ --with-debug-clipboard enable debugging of clipboard code],
896 [
897 if test $withval != "no";
898 then
899 AC_DEFINE(WITH_DEBUG_CLIPBOARD,1)
900 fi
901 ])
902
903AC_ARG_WITH(debug-sound,
904 [ --with-debug-sound enable debugging of sound code],
905 [
906 if test $withval != "no";
907 then
908 AC_DEFINE(WITH_DEBUG_SOUND,1)
909 fi
910 ])
911
912AC_ARG_WITH(debug-channel,
913 [ --with-debug-channel enable debugging of virtual channel code],
914 [
915 if test $withval != "no";
916 then
917 AC_DEFINE(WITH_DEBUG_CHANNEL,1)
918 fi
919 ])
920
921AC_ARG_WITH(debug-seamless,
922 [ --with-debug-seamless enable debugging of SeamlessRDP code],
923 [
924 if test $withval != "no";
925 then
926 AC_DEFINE(WITH_DEBUG_SEAMLESS,1)
927 fi
928 ])
929
930AC_ARG_WITH(debug-smartcard,
931 [ --with-debug-smartcard enable debugging of smart-card code],
932 [
933 if test $withval != "no";
934 then
935 if test x"$WITH_SCARD" = "x1"; then
936 AC_DEFINE(WITH_DEBUG_SCARD,1)
937 fi
938 fi
939 ])
940
941AC_ARG_WITH(debug-credssp,
942 [ --with-debug-credssp enable debugging of CredSSP code],
943 [
944 if test $withval != "no";
945 then
946 if test x"$WITH_CREDSSP" = "x1"; then
947 AC_DEFINE(WITH_DEBUG_CREDSSP,1)
948 fi
949 fi
950 ])
951
952#
953# target-specific stuff
954#
955case "$host" in
956*-*-hpux*)
957 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
958 ;;
959*-*-irix6.5*)
960 LIBS="-L$ssldir/lib32 $LIBS"
961 CFLAGS="$CFLAGS -D__SGI_IRIX__"
962 ;;
963esac
964
965AC_OUTPUT(Makefile)
966
967dnl Local Variables:
968dnl comment-start: "dnl "
969dnl comment-end: ""
970dnl comment-start-skip: "\\bdnl\\b\\s *"
971dnl compile-command: "autoconf"
972dnl End:
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette