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