| 1 |
dnl Autoconf macros for libestream |
| 2 |
dnl Copyright (C) 2007 g10 Code GmbH |
| 3 |
dnl |
| 4 |
dnl This file is free software; as a special exception the author gives |
| 5 |
dnl unlimited permission to copy and/or distribute it, with or without |
| 6 |
dnl modifications, as long as this notice is preserved. |
| 7 |
dnl |
| 8 |
dnl This file is distributed in the hope that it will be useful, but |
| 9 |
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 10 |
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 |
|
| 12 |
|
| 13 |
dnl estream_PRINTF_INIT |
| 14 |
dnl Prepare build of source included estream-printf.c |
| 15 |
dnl |
| 16 |
AC_DEFUN([estream_PRINTF_INIT], |
| 17 |
[ |
| 18 |
AC_MSG_NOTICE([checking system features for estream-printf]) |
| 19 |
AC_CHECK_HEADERS(stdint.h) |
| 20 |
AC_TYPE_LONG_LONG_INT |
| 21 |
AC_TYPE_LONG_DOUBLE |
| 22 |
AC_TYPE_INTMAX_T |
| 23 |
AC_TYPE_UINTMAX_T |
| 24 |
AC_CHECK_TYPES([ptrdiff_t]) |
| 25 |
AC_CHECK_SIZEOF([unsigned long]) |
| 26 |
AC_CHECK_SIZEOF([void *]) |
| 27 |
AC_CACHE_CHECK([for nl_langinfo and THOUSEP], |
| 28 |
estream_cv_langinfo_thousep, |
| 29 |
[AC_LINK_IFELSE( |
| 30 |
[AC_LANG_PROGRAM([[#include <langinfo.h>]], |
| 31 |
[[char* cs = nl_langinfo(THOUSEP); return !cs;]])], |
| 32 |
estream_cv_langinfo_thousep=yes, |
| 33 |
estream_cv_langinfo_thousep=no) |
| 34 |
]) |
| 35 |
if test $estream_cv_langinfo_thousep = yes; then |
| 36 |
AC_DEFINE(HAVE_LANGINFO_THOUSEP, 1, |
| 37 |
[Define if you have <langinfo.h> and nl_langinfo(THOUSEP).]) |
| 38 |
fi |
| 39 |
]) |
| 40 |
|
| 41 |
|
| 42 |
dnl estream_INIT |
| 43 |
dnl Prepare build of source included estream.c |
| 44 |
dnl |
| 45 |
AC_DEFUN([estream_INIT], |
| 46 |
[ |
| 47 |
AC_REQUIRE([estream_PRINTF_INIT]) |
| 48 |
AC_MSG_NOTICE([checking system features for estream]) |
| 49 |
AC_CHECK_FUNCS([memrchr]) |
| 50 |
]) |