VirtualBox

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

Last change on this file since 14833 was 9902, checked in by vboxsync, 16 years ago

Added rdesktop 1.6.0.

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