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