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