From 2b74237d19e44f7173bb052677f0ec35e6ff51b0 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 21 Aug 2014 19:37:37 +0200 Subject: Add estream code from GnuPG. * src/estream-printf.c, src/estream-printf.h: New. * src/estream.c, src/estream.h: New. * m4/estream.m4: New. * src/Makefile.am (libgpg_error_la_SOURCES): Add new files. * configure.ac (AH_BOTTOM): Define estream prefix. : Add useful gcc warning options. (estream_INIT): Call. -- This is the base line patch to move the estream code from GnuPG to libgpg-error. The code has been taken from the GnuPG repository at commit cb680c5ea540738692a5c74951802b0fdc658e85. Signed-off-by: Werner Koch --- m4/Makefile.am | 2 +- m4/estream.m4 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 m4/estream.m4 (limited to 'm4') diff --git a/m4/Makefile.am b/m4/Makefile.am index 9c2b1e2..2f16e46 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,3 +1,3 @@ EXTRA_DIST = inttypes-h.m4 lock.m4 visibility.m4 glibc2.m4 intmax.m4 longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4 ac_prog_cc_for_build.m4 nls.m4 po.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 -EXTRA_DIST += autobuild.m4 +EXTRA_DIST += autobuild.m4 estream.m4 diff --git a/m4/estream.m4 b/m4/estream.m4 new file mode 100644 index 0000000..92ddead --- /dev/null +++ b/m4/estream.m4 @@ -0,0 +1,49 @@ +dnl Autoconf macros for libestream +dnl Copyright (C) 2007 g10 Code GmbH +dnl +dnl This file is free software; as a special exception the author gives +dnl unlimited permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl +dnl This file is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + +dnl estream_PRINTF_INIT +dnl Prepare build of source included estream-printf.c +dnl +AC_DEFUN([estream_PRINTF_INIT], +[ + AC_MSG_NOTICE([checking system features for estream-printf]) + AC_CHECK_HEADERS(stdint.h) + AC_TYPE_LONG_LONG_INT + AC_TYPE_LONG_DOUBLE + AC_TYPE_INTMAX_T + AC_TYPE_UINTMAX_T + AC_CHECK_TYPES([ptrdiff_t]) + AC_CHECK_SIZEOF([unsigned long]) + AC_CHECK_SIZEOF([void *]) + AC_CACHE_CHECK([for nl_langinfo and THOUSANDS_SEP], + estream_cv_langinfo_thousands_sep, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(THOUSANDS_SEP); return !cs;], + estream_cv_langinfo_thousands_sep=yes, + estream_cv_langinfo_thousands_sep=no) + ]) + if test $estream_cv_langinfo_thousands_sep = yes; then + AC_DEFINE(HAVE_LANGINFO_THOUSANDS_SEP, 1, + [Define if you have and nl_langinfo(THOUSANDS_SEP).]) + fi +]) + + +dnl estream_INIT +dnl Prepare build of source included estream.c +dnl +AC_DEFUN([estream_INIT], +[ + AC_REQUIRE([estream_PRINTF_INIT]) + AC_MSG_NOTICE([checking system features for estream]) + +]) -- cgit v1.2.1