/[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 1335 - (hide annotations)
Wed Nov 15 09:15:36 2006 UTC (17 years, 7 months ago) by stargo
File size: 22636 byte(s)
Don't depend on pkg-config during bootstrap

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

  ViewVC Help
Powered by ViewVC 1.1.26