20 |
AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H)) |
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)) |
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)) |
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 |
|
AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H)) |
26 |
|
|
27 |
rpath="" |
rpath="" |
28 |
|
|
265 |
|
|
266 |
UTILS_FUNC_DIRFD |
UTILS_FUNC_DIRFD |
267 |
|
|
268 |
|
# |
269 |
|
# iconv |
270 |
|
# |
271 |
|
|
272 |
|
dnl This macros shamelessly stolen from |
273 |
|
dnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html. |
274 |
|
dnl Written by Bruno Haible. |
275 |
|
|
276 |
|
AC_DEFUN([UTILS_FUNC_ICONV], |
277 |
|
[ |
278 |
|
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and |
279 |
|
dnl those with the standalone portable GNU libiconv installed). |
280 |
|
|
281 |
|
AC_ARG_WITH([libiconv-prefix], |
282 |
|
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ |
283 |
|
for dir in `echo "$withval" | tr : ' '`; do |
284 |
|
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi |
285 |
|
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi |
286 |
|
done |
287 |
|
]) |
288 |
|
|
289 |
|
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ |
290 |
|
am_cv_func_iconv="no, consider installing GNU libiconv" |
291 |
|
am_cv_lib_iconv=no |
292 |
|
AC_TRY_LINK([#include <stdlib.h> |
293 |
|
#include <iconv.h>], |
294 |
|
[iconv_t cd = iconv_open("",""); |
295 |
|
iconv(cd,NULL,NULL,NULL,NULL); |
296 |
|
iconv_close(cd);], |
297 |
|
am_cv_func_iconv=yes) |
298 |
|
if test "$am_cv_func_iconv" != yes; then |
299 |
|
am_save_LIBS="$LIBS" |
300 |
|
LIBS="$LIBS -liconv" |
301 |
|
AC_TRY_LINK([#include <stdlib.h> |
302 |
|
#include <iconv.h>], |
303 |
|
[iconv_t cd = iconv_open("",""); |
304 |
|
iconv(cd,NULL,NULL,NULL,NULL); |
305 |
|
iconv_close(cd);], |
306 |
|
am_cv_lib_iconv=yes |
307 |
|
am_cv_func_iconv=yes) |
308 |
|
LIBS="$am_save_LIBS" |
309 |
|
fi |
310 |
|
]) |
311 |
|
if test "$am_cv_func_iconv" = yes; then |
312 |
|
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) |
313 |
|
AC_MSG_CHECKING([for iconv declaration]) |
314 |
|
AC_CACHE_VAL(am_cv_proto_iconv, [ |
315 |
|
AC_TRY_COMPILE([ |
316 |
|
#include <stdlib.h> |
317 |
|
#include <iconv.h> |
318 |
|
extern |
319 |
|
#ifdef __cplusplus |
320 |
|
"C" |
321 |
|
#endif |
322 |
|
#if defined(__STDC__) || defined(__cplusplus) |
323 |
|
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
324 |
|
#else |
325 |
|
size_t iconv(); |
326 |
|
#endif |
327 |
|
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") |
328 |
|
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) |
329 |
|
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` |
330 |
|
AC_MSG_RESULT([$]{ac_t:- |
331 |
|
}[$]am_cv_proto_iconv) |
332 |
|
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, |
333 |
|
[Define as const if the declaration of iconv() needs const.]) |
334 |
|
fi |
335 |
|
LIBICONV= |
336 |
|
if test "$am_cv_lib_iconv" = yes; then |
337 |
|
LIBICONV="-liconv" |
338 |
|
fi |
339 |
|
AC_SUBST(LIBICONV) |
340 |
|
]) |
341 |
|
|
342 |
|
UTILS_FUNC_ICONV |
343 |
|
LIBS="$LIBS $LIBICONV" |
344 |
|
|
345 |
|
# |
346 |
|
# socklen_t |
347 |
|
# from curl |
348 |
|
|
349 |
|
dnl Check for socklen_t: historically on BSD it is an int, and in |
350 |
|
dnl POSIX 1g it is a type of its own, but some platforms use different |
351 |
|
dnl types for the argument to getsockopt, getpeername, etc. So we |
352 |
|
dnl have to test to find something that will work. |
353 |
|
AC_DEFUN([TYPE_SOCKLEN_T], |
354 |
|
[ |
355 |
|
AC_CHECK_TYPE([socklen_t], ,[ |
356 |
|
AC_MSG_CHECKING([for socklen_t equivalent]) |
357 |
|
AC_CACHE_VAL([socklen_t_equiv], |
358 |
|
[ |
359 |
|
# Systems have either "struct sockaddr *" or |
360 |
|
# "void *" as the second argument to getpeername |
361 |
|
socklen_t_equiv= |
362 |
|
for arg2 in "struct sockaddr" void; do |
363 |
|
for t in int size_t unsigned long "unsigned long"; do |
364 |
|
AC_TRY_COMPILE([ |
365 |
|
#include <sys/types.h> |
366 |
|
#include <sys/socket.h> |
367 |
|
|
368 |
|
int getpeername (int, $arg2 *, $t *); |
369 |
|
],[ |
370 |
|
$t len; |
371 |
|
getpeername(0,0,&len); |
372 |
|
],[ |
373 |
|
socklen_t_equiv="$t" |
374 |
|
break |
375 |
|
]) |
376 |
|
done |
377 |
|
done |
378 |
|
|
379 |
|
if test "x$socklen_t_equiv" = x; then |
380 |
|
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) |
381 |
|
fi |
382 |
|
]) |
383 |
|
AC_MSG_RESULT($socklen_t_equiv) |
384 |
|
AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_equiv, |
385 |
|
[type to use in place of socklen_t if not defined])], |
386 |
|
[#include <sys/types.h> |
387 |
|
#include <sys/socket.h>]) |
388 |
|
]) |
389 |
|
|
390 |
|
TYPE_SOCKLEN_T |
391 |
|
|
392 |
# |
# |
393 |
# IPv6 |
# IPv6 |