VirtualBox

source: vbox/trunk/src/VBox/RDP/client-1.8.3/configure.ac@ 67954

Last change on this file since 67954 was 55123, checked in by vboxsync, 10 years ago

rdesktop 1.8.3 modified for VBox

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