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