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