/[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 1307 - (show annotations)
Mon Oct 30 09:01:01 2006 UTC (17 years, 7 months ago) by astrand
File size: 21463 byte(s)
libsamplerate requires libm

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 LIBSAMPLERATE_LIBS="$LIBSAMPLERATE_LIBS -lm"
172 fi
173 fi
174
175 if test "$sound" != "no"; then
176 SOUNDOBJ="$SOUNDOBJ rdpsnd.o rdpsnd_dsp.o"
177 CFLAGS="$CFLAGS $LIBSAMPLERATE_CFLAGS"
178 LIBS="$LIBS $LIBSAMPLERATE_LIBS"
179 AC_DEFINE(WITH_RDPSND)
180 fi
181
182 case $sound in
183 yes)
184 if test x"$HAVE_OSS" = "x1"; then
185 SOUNDOBJ="$SOUNDOBJ rdpsnd_oss.o"
186 AC_DEFINE(RDPSND_OSS)
187 fi
188
189 if test x"$HAVE_SGI" = "x1"; then
190 SOUNDOBJ="$SOUNDOBJ rdpsnd_sgi.o"
191 LIBS="$LIBS -laudio"
192 AC_DEFINE(RDPSND_SGI)
193 fi
194
195 if test x"$HAVE_SUN" = "x1"; then
196 SOUNDOBJ="$SOUNDOBJ rdpsnd_sun.o"
197 AC_DEFINE(RDPSND_SUN)
198 fi
199
200 if test x"$HAVE_ALSA" = "x1"; then
201 SOUNDOBJ="$SOUNDOBJ rdpsnd_alsa.o"
202 CFLAGS="$CFLAGS $ALSA_CFLAGS"
203 LIBS="$LIBS $ALSA_LIBS"
204 AC_DEFINE(RDPSND_ALSA)
205 fi
206
207 if test x"$HAVE_LIBAO" = "x1"; then
208 SOUNDOBJ="$SOUNDOBJ rdpsnd_libao.o"
209 CFLAGS="$CFLAGS $LIBAO_CFLAGS"
210 LIBS="$LIBS $LIBAO_LIBS"
211 AC_DEFINE(RDPSND_LIBAO)
212 fi
213
214 ;;
215
216 oss)
217 if test x"$HAVE_OSS" = "x1"; then
218 SOUNDOBJ="$SOUNDOBJ rdpsnd_oss.o"
219 AC_DEFINE(RDPSND_OSS)
220 else
221 AC_MSG_ERROR([Selected sound system is not available.])
222 fi
223 ;;
224
225 sgi)
226 if test x"$HAVE_SGI" = "x1"; then
227 SOUNDOBJ="$SOUNDOBJ rdpsnd_sgi.o"
228 LIBS="$LIBS -laudio"
229 AC_DEFINE(RDPSND_SGI)
230 else
231 AC_MSG_ERROR([Selected sound system is not available.])
232 fi
233 ;;
234
235 sun)
236 if test x"$HAVE_SUN" = "x1"; then
237 SOUNDOBJ="$SOUNDOBJ rdpsnd_sun.o"
238 AC_DEFINE(RDPSND_SUN)
239 else
240 AC_MSG_ERROR([Selected sound system is not available.])
241 fi
242 ;;
243
244 alsa)
245 if test x"$HAVE_ALSA" = "x1"; then
246 SOUNDOBJ="$SOUNDOBJ rdpsnd_alsa.o"
247 CFLAGS="$CFLAGS $ALSA_CFLAGS"
248 LIBS="$LIBS $ALSA_LIBS"
249 AC_DEFINE(RDPSND_ALSA)
250 else
251 AC_MSG_ERROR([Selected sound system is not available.])
252 fi
253 ;;
254
255 libao)
256 if test x"$HAVE_LIBAO" = "x1"; then
257 SOUNDOBJ="$SOUNDOBJ rdpsnd_libao.o"
258 CFLAGS="$CFLAGS $LIBAO_CFLAGS"
259 LIBS="$LIBS $LIBAO_LIBS"
260 AC_DEFINE(RDPSND_LIBAO)
261 else
262 AC_MSG_ERROR([Selected sound system is not available.])
263 fi
264 ;;
265
266 no)
267 ;;
268
269 *)
270 AC_MSG_WARN([sound support disabled])
271 AC_MSG_WARN([Currently supported systems are Open Sound System (oss), SGI AL (sgi), Sun/BSD (sun), ALSA (alsa) and libao])
272 ;;
273 esac
274
275 AC_SUBST(SOUNDOBJ)
276
277 #
278 # dirfd
279 #
280 dnl Find out how to get the file descriptor associated with an open DIR*.
281 dnl From Jim Meyering
282
283 AC_DEFUN([UTILS_FUNC_DIRFD],
284 [
285
286 AC_HEADER_DIRENT
287 dirfd_headers='
288 #if HAVE_DIRENT_H
289 # include <dirent.h>
290 #else /* not HAVE_DIRENT_H */
291 # define dirent direct
292 # if HAVE_SYS_NDIR_H
293 # include <sys/ndir.h>
294 # endif /* HAVE_SYS_NDIR_H */
295 # if HAVE_SYS_DIR_H
296 # include <sys/dir.h>
297 # endif /* HAVE_SYS_DIR_H */
298 # if HAVE_NDIR_H
299 # include <ndir.h>
300 # endif /* HAVE_NDIR_H */
301 #endif /* HAVE_DIRENT_H */
302 '
303 AC_CHECK_FUNCS(dirfd)
304 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
305
306 AC_CACHE_CHECK([whether dirfd is a macro],
307 jm_cv_func_dirfd_macro,
308 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
309 #ifdef dirfd
310 dirent_header_defines_dirfd
311 #endif],
312 jm_cv_func_dirfd_macro=yes,
313 jm_cv_func_dirfd_macro=no)])
314
315 # Use the replacement only if we have no function, macro,
316 # or declaration with that name.
317 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
318 = no,no,no; then
319 AC_REPLACE_FUNCS([dirfd])
320 AC_CACHE_CHECK(
321 [how to get the file descriptor associated with an open DIR*],
322 gl_cv_sys_dir_fd_member_name,
323 [
324 dirfd_save_CFLAGS=$CFLAGS
325 for ac_expr in d_fd dd_fd; do
326
327 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
328 AC_TRY_COMPILE(
329 [$dirfd_headers
330 ],
331 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
332 dir_fd_found=yes
333 )
334 CFLAGS=$dirfd_save_CFLAGS
335 test "$dir_fd_found" = yes && break
336 done
337 test "$dir_fd_found" = yes || ac_expr=no_such_member
338
339 gl_cv_sys_dir_fd_member_name=$ac_expr
340 ]
341 )
342 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
343 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
344 $gl_cv_sys_dir_fd_member_name,
345 [the name of the file descriptor member of DIR])
346 fi
347 AH_VERBATIM(DIR_TO_FD,
348 [#ifdef DIR_FD_MEMBER_NAME
349 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
350 #else
351 # define DIR_TO_FD(Dir_p) -1
352 #endif
353 ]
354 )
355 fi
356 ])
357
358 UTILS_FUNC_DIRFD
359
360 #
361 # iconv
362 #
363
364 dnl This macros shamelessly stolen from
365 dnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html.
366 dnl Written by Bruno Haible.
367
368 AC_DEFUN([UTILS_FUNC_ICONV],
369 [
370 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
371 dnl those with the standalone portable GNU libiconv installed).
372
373 AC_ARG_WITH([libiconv-prefix],
374 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
375 for dir in `echo "$withval" | tr : ' '`; do
376 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
377 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
378 done
379 ])
380 AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H))
381
382 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
383 am_cv_func_iconv="no, consider installing GNU libiconv"
384 am_cv_lib_iconv=no
385 AC_TRY_LINK([#include <stdlib.h>
386 #include <iconv.h>],
387 [iconv_t cd = iconv_open("","");
388 iconv(cd,NULL,NULL,NULL,NULL);
389 iconv_close(cd);],
390 am_cv_func_iconv=yes)
391 if test "$am_cv_func_iconv" != yes; then
392 am_save_LIBS="$LIBS"
393 LIBS="$LIBS -liconv"
394 AC_TRY_LINK([#include <stdlib.h>
395 #include <iconv.h>],
396 [iconv_t cd = iconv_open("","");
397 iconv(cd,NULL,NULL,NULL,NULL);
398 iconv_close(cd);],
399 am_cv_lib_iconv=yes
400 am_cv_func_iconv=yes)
401 LIBS="$am_save_LIBS"
402 fi
403 ])
404 if test "$am_cv_func_iconv" = yes; then
405 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
406 AC_MSG_CHECKING([for iconv declaration])
407 AC_CACHE_VAL(am_cv_proto_iconv, [
408 AC_TRY_COMPILE([
409 #include <stdlib.h>
410 #include <iconv.h>
411 extern
412 #ifdef __cplusplus
413 "C"
414 #endif
415 #if defined(__STDC__) || defined(__cplusplus)
416 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
417 #else
418 size_t iconv();
419 #endif
420 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
421 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);"])
422 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
423 AC_MSG_RESULT([$]{ac_t:-
424 }[$]am_cv_proto_iconv)
425 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
426 [Define as const if the declaration of iconv() needs const.])
427 fi
428 LIBICONV=
429 if test "$am_cv_lib_iconv" = yes; then
430 LIBICONV="-liconv"
431 fi
432 AC_SUBST(LIBICONV)
433 ])
434
435 UTILS_FUNC_ICONV
436 LIBS="$LIBS $LIBICONV"
437
438 #
439 # socklen_t
440 # from curl
441
442 dnl Check for socklen_t: historically on BSD it is an int, and in
443 dnl POSIX 1g it is a type of its own, but some platforms use different
444 dnl types for the argument to getsockopt, getpeername, etc. So we
445 dnl have to test to find something that will work.
446 AC_DEFUN([TYPE_SOCKLEN_T],
447 [
448 AC_CHECK_TYPE([socklen_t], ,[
449 AC_MSG_CHECKING([for socklen_t equivalent])
450 AC_CACHE_VAL([socklen_t_equiv],
451 [
452 # Systems have either "struct sockaddr *" or
453 # "void *" as the second argument to getpeername
454 socklen_t_equiv=
455 for arg2 in "struct sockaddr" void; do
456 for t in int size_t unsigned long "unsigned long"; do
457 AC_TRY_COMPILE([
458 #include <sys/types.h>
459 #include <sys/socket.h>
460
461 int getpeername (int, $arg2 *, $t *);
462 ],[
463 $t len;
464 getpeername(0,0,&len);
465 ],[
466 socklen_t_equiv="$t"
467 break
468 ])
469 done
470 done
471
472 if test "x$socklen_t_equiv" = x; then
473 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
474 fi
475 ])
476 AC_MSG_RESULT($socklen_t_equiv)
477 AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_equiv,
478 [type to use in place of socklen_t if not defined])],
479 [#include <sys/types.h>
480 #include <sys/socket.h>])
481 ])
482
483 TYPE_SOCKLEN_T
484
485 #
486 # statfs stuff
487 #
488 AC_CHECK_HEADERS(sys/vfs.h)
489 AC_CHECK_HEADERS(sys/statvfs.h)
490 AC_CHECK_HEADERS(sys/statfs.h)
491 AC_CHECK_HEADERS(sys/param.h)
492
493 mount_includes="\
494 $ac_includes_default
495 #if HAVE_SYS_PARAM_H
496 # include <sys/param.h>
497 #endif
498 "
499
500 AC_CHECK_HEADERS(sys/mount.h,,,[$mount_includes])
501
502 #################################################
503 # these tests are taken from the GNU fileutils package
504 AC_CHECKING(how to get filesystem space usage)
505 space=no
506
507 # Test for statvfs64.
508 if test $space = no; then
509 # SVR4
510 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
511 [AC_TRY_RUN([
512 #if defined(HAVE_UNISTD_H)
513 #include <unistd.h>
514 #endif
515 #include <sys/types.h>
516 #include <sys/statvfs.h>
517 main ()
518 {
519 struct statvfs64 fsd;
520 exit (statvfs64 (".", &fsd));
521 }],
522 fu_cv_sys_stat_statvfs64=yes,
523 fu_cv_sys_stat_statvfs64=no,
524 fu_cv_sys_stat_statvfs64=cross)])
525 if test $fu_cv_sys_stat_statvfs64 = yes; then
526 space=yes
527 AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
528 fi
529 fi
530
531 # Perform only the link test since it seems there are no variants of the
532 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
533 # because that got a false positive on SCO OSR5. Adding the declaration
534 # of a `struct statvfs' causes this test to fail (as it should) on such
535 # systems. That system is reported to work fine with STAT_STATFS4 which
536 # is what it gets when this test fails.
537 if test $space = no; then
538 # SVR4
539 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
540 [AC_TRY_LINK([#include <sys/types.h>
541 #include <sys/statvfs.h>],
542 [struct statvfs fsd; statvfs (0, &fsd);],
543 fu_cv_sys_stat_statvfs=yes,
544 fu_cv_sys_stat_statvfs=no)])
545 if test $fu_cv_sys_stat_statvfs = yes; then
546 space=yes
547 AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
548 fi
549 fi
550
551 if test $space = no; then
552 # DEC Alpha running OSF/1
553 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
554 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
555 [AC_TRY_RUN([
556 #include <sys/param.h>
557 #include <sys/types.h>
558 #include <sys/mount.h>
559 main ()
560 {
561 struct statfs fsd;
562 fsd.f_fsize = 0;
563 exit (statfs (".", &fsd, sizeof (struct statfs)));
564 }],
565 fu_cv_sys_stat_statfs3_osf1=yes,
566 fu_cv_sys_stat_statfs3_osf1=no,
567 fu_cv_sys_stat_statfs3_osf1=no)])
568
569
570 #C_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
571 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
572 space=yes
573 AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
574 fi
575 fi
576
577 if test $space = no; then
578 # AIX
579 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
580 member (AIX, 4.3BSD)])
581 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
582 [AC_TRY_RUN([
583 #ifdef HAVE_SYS_PARAM_H
584 #include <sys/param.h>
585 #endif
586 #ifdef HAVE_SYS_MOUNT_H
587 #include <sys/mount.h>
588 #endif
589 #ifdef HAVE_SYS_VFS_H
590 #include <sys/vfs.h>
591 #endif
592 main ()
593 {
594 struct statfs fsd;
595 fsd.f_bsize = 0;
596 exit (statfs (".", &fsd));
597 }],
598 fu_cv_sys_stat_statfs2_bsize=yes,
599 fu_cv_sys_stat_statfs2_bsize=no,
600 fu_cv_sys_stat_statfs2_bsize=no)])
601 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
602 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
603 space=yes
604 AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
605 fi
606 fi
607
608 if test $space = no; then
609 # SVR3
610 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
611 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
612 [AC_TRY_RUN([#include <sys/types.h>
613 #include <sys/statfs.h>
614 main ()
615 {
616 struct statfs fsd;
617 exit (statfs (".", &fsd, sizeof fsd, 0));
618 }],
619 fu_cv_sys_stat_statfs4=yes,
620 fu_cv_sys_stat_statfs4=no,
621 fu_cv_sys_stat_statfs4=no)])
622 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
623 if test $fu_cv_sys_stat_statfs4 = yes; then
624 space=yes
625 AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
626 fi
627 fi
628
629 if test $space = no; then
630 # 4.4BSD and NetBSD
631 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
632 member (4.4BSD and NetBSD)])
633 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
634 [AC_TRY_RUN([#include <sys/types.h>
635 #ifdef HAVE_SYS_PARAM_H
636 #include <sys/param.h>
637 #endif
638 #ifdef HAVE_SYS_MOUNT_H
639 #include <sys/mount.h>
640 #endif
641 main ()
642 {
643 struct statfs fsd;
644 fsd.f_fsize = 0;
645 exit (statfs (".", &fsd));
646 }],
647 fu_cv_sys_stat_statfs2_fsize=yes,
648 fu_cv_sys_stat_statfs2_fsize=no,
649 fu_cv_sys_stat_statfs2_fsize=no)])
650 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
651 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
652 space=yes
653 AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
654 fi
655 fi
656
657 if test $space = no; then
658 # Ultrix
659 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
660 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
661 [AC_TRY_RUN([#include <sys/types.h>
662 #ifdef HAVE_SYS_PARAM_H
663 #include <sys/param.h>
664 #endif
665 #ifdef HAVE_SYS_MOUNT_H
666 #include <sys/mount.h>
667 #endif
668 #ifdef HAVE_SYS_FS_TYPES_H
669 #include <sys/fs_types.h>
670 #endif
671 main ()
672 {
673 struct fs_data fsd;
674 /* Ultrix's statfs returns 1 for success,
675 0 for not mounted, -1 for failure. */
676 exit (statfs (".", &fsd) != 1);
677 }],
678 fu_cv_sys_stat_fs_data=yes,
679 fu_cv_sys_stat_fs_data=no,
680 fu_cv_sys_stat_fs_data=no)])
681 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
682 if test $fu_cv_sys_stat_fs_data = yes; then
683 space=yes
684 AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
685 fi
686 fi
687
688 statxfs_includes="\
689 $ac_includes_default
690 #if HAVE_SYS_STATVFS_H
691 # include <sys/statvfs.h>
692 #endif
693 #if HAVE_SYS_VFS_H
694 # include <sys/vfs.h>
695 #endif
696 #if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
697 # if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
698 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
699 # include <sys/param.h>
700 # include <sys/mount.h>
701 # elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
702 /* Ultrix 4.4 needs these for the declaration of struct statfs. */
703 # include <netinet/in.h>
704 # include <nfs/nfs_clnt.h>
705 # include <nfs/vfs.h>
706 # endif
707 #endif
708 "
709
710 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
711 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
712 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
713 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
714
715 #
716 # Large file support
717 #
718 AC_SYS_LARGEFILE
719
720 #
721 # mntent
722 #
723 AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H))
724 AC_CHECK_FUNCS(setmntent)
725
726 #
727 # IPv6
728 #
729 AC_ARG_WITH(ipv6,
730 [ --with-ipv6 enable IPv6-support],
731 [
732 if test $withval != "no";
733 then
734 AC_DEFINE(IPv6,1)
735 fi
736 ])
737
738
739 #
740 # debugging
741 #
742 AC_ARG_WITH(debug,
743 [ --with-debug enable protocol debugging output],
744 [
745 if test $withval != "no";
746 then
747 AC_DEFINE(WITH_DEBUG,1)
748 fi
749 ])
750
751 AC_ARG_WITH(debug-kbd,
752 [ --with-debug-kbd enable debugging of keyboard handling],
753 [
754 if test $withval != "no";
755 then
756 AC_DEFINE(WITH_DEBUG_KBD,1)
757 fi
758 ])
759
760 AC_ARG_WITH(debug-rdp5,
761 [ --with-debug-rdp5 enable debugging of RDP5 code],
762 [
763 if test $withval != "no";
764 then
765 AC_DEFINE(WITH_DEBUG_RDP5,1)
766 fi
767 ])
768
769 AC_ARG_WITH(debug-clipboard,
770 [ --with-debug-clipboard enable debugging of clipboard code],
771 [
772 if test $withval != "no";
773 then
774 AC_DEFINE(WITH_DEBUG_CLIPBOARD,1)
775 fi
776 ])
777
778 AC_ARG_WITH(debug-channel,
779 [ --with-debug-channel enable debugging of virtual channel code],
780 [
781 if test $withval != "no";
782 then
783 AC_DEFINE(WITH_DEBUG_CHANNEL,1)
784 fi
785 ])
786
787
788 #
789 # target-specific stuff
790 #
791 # strip leading colon from rpath
792 rpath=`echo $rpath |sed 's/^://'`
793 AC_CANONICAL_HOST
794 case "$host" in
795 *-*-solaris*)
796 LDFLAGS="$LDFLAGS -R$rpath"
797 ;;
798 *-dec-osf*)
799 LDFLAGS="$LDFLAGS -Wl,-rpath,$rpath"
800 ;;
801 *-*-hpux*)
802 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
803 ;;
804 *-*-irix6.5*)
805 LIBS="$LIBS -L$ssldir/lib32 -lcrypto"
806 CFLAGS="$CFLAGS -D__SGI_IRIX__"
807 ;;
808 esac
809
810
811 AC_OUTPUT(Makefile)
812
813 dnl Local Variables:
814 dnl comment-start: "dnl "
815 dnl comment-end: ""
816 dnl comment-start-skip: "\\bdnl\\b\\s *"
817 dnl compile-command: "autoconf"
818 dnl End:

  ViewVC Help
Powered by ViewVC 1.1.26