VirtualBox

source: vbox/trunk/src/VBox/RDP/client/configure.ac@ 34918

Last change on this file since 34918 was 32472, checked in by vboxsync, 14 years ago

RDP/client: use sysfs for USB device enumeration and switch to using real iprt

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