/[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 1297 - (show annotations)
Wed Oct 18 05:12:30 2006 UTC (17 years, 7 months ago) by astrand
File size: 21383 byte(s)
Corrected pkgconfig check for libsamplerate

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

  ViewVC Help
Powered by ViewVC 1.1.26