/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1324 - (hide annotations)
Fri Nov 3 16:44:40 2006 UTC (17 years, 7 months ago) by stargo
File size: 22356 byte(s)
Add compatibility with older autoconf versions
PKG_PROG_PKG_CONFIG is done implicitly by autoconf, so no need to
call it manually. (It is not defined in old versions)
Thanks to Jennings Jared for noting

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

  ViewVC Help
Powered by ViewVC 1.1.26