/[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 1256 - (show annotations)
Sun Sep 17 11:42:22 2006 UTC (17 years, 7 months ago) by stargo
File size: 19641 byte(s)
fix SunCC errors/warnings and configure-variable-usage (LIBS/LDFLAGS)

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

  ViewVC Help
Powered by ViewVC 1.1.26