/[rdesktop]/sourceforge.net/trunk/rdesktop/configure.ac
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /sourceforge.net/trunk/rdesktop/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1301 - (show annotations)
Sat Oct 21 06:36:49 2006 UTC (17 years, 8 months ago) by astrand
File size: 21410 byte(s)
Define WITH_RDPSND when using sound

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

  ViewVC Help
Powered by ViewVC 1.1.26