/[rdesktop]/jpeg/rdesktop/trunk/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 /jpeg/rdesktop/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26