summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-21 20:51:19 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-21 20:51:19 -0500
commit0001803f0b9523c94fa2ede48eaecb047fef4524 (patch)
treef334332811e033ff966d94f6268f0629a94304b3 /aclocal.m4
parent89a92869e56aba4e4cab2d639c00a86f0545c862 (diff)
downloadbash-0001803f0b9523c94fa2ede48eaecb047fef4524.tar.gz
Bash-4.1 distribution source
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m497
1 files changed, 97 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 5a742bc7..10a4741e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -80,6 +80,9 @@ AC_CACHE_VAL(bash_cv_type_$1,
#if HAVE_INTTYPES_H
#include <inttypes.h>
#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
$2
], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
AC_MSG_RESULT($bash_cv_type_$1)
@@ -1690,9 +1693,12 @@ AC_CHECK_HEADERS(wchar.h)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN))
+AC_CHECK_FUNC(mbscasecmp, AC_DEFINE(HAVE_MBSCMP))
AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP))
AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
+AC_REPLACE_FUNCS(mbschr)
+
AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB))
AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL))
AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP))
@@ -1753,6 +1759,13 @@ if test $bash_cv_type_wint_t = yes; then
AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here])
fi
+if test "$am_cv_func_iconv" = yes; then
+ OLDLIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_CHECK_FUNCS(locale_charset)
+ LIBS="$OLDLIBS"
+fi
+
])
dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB
@@ -4018,3 +4031,87 @@ AC_DEFUN([BASH_FUNC_FPURGE],
AC_CHECK_FUNCS_ONCE([__fpurge])
AC_CHECK_DECLS([fpurge], , , [#include <stdio.h>])
])
+
+AC_DEFUN([BASH_FUNC_SNPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([snprintf])
+ if test X$ac_cv_func_snprintf = Xyes; then
+ AC_CACHE_CHECK([for standard-conformant snprintf], [bash_cv_func_snprintf],
+ [AC_TRY_RUN([
+#include <stdio.h>
+
+main()
+{
+ int n;
+ n = snprintf (0, 0, "%s", "0123456");
+ exit(n != 7);
+}
+], bash_cv_func_snprintf=yes, bash_cv_func_snprintf=no,
+ [AC_MSG_WARN([cannot check standard snprintf if cross-compiling])
+ bash_cv_func_snprintf=yes]
+)])
+ if test $bash_cv_func_snprintf = no; then
+ ac_cv_func_snprintf=no
+ fi
+ fi
+ if test $ac_cv_func_snprintf = no; then
+ AC_DEFINE(HAVE_SNPRINTF, 0,
+ [Define if you have a standard-conformant snprintf function.])
+ fi
+])
+
+AC_DEFUN([BASH_FUNC_VSNPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([vsnprintf])
+ if test X$ac_cv_func_vsnprintf = Xyes; then
+ AC_CACHE_CHECK([for standard-conformant vsnprintf], [bash_cv_func_vsnprintf],
+ [AC_TRY_RUN([
+#if HAVE_STDARG_H
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+static int
+#if HAVE_STDARG_H
+foo(const char *fmt, ...)
+#else
+foo(format, va_alist)
+ const char *format;
+ va_dcl
+#endif
+{
+ va_list args;
+ int n;
+
+#if HAVE_STDARG_H
+ va_start(args, fmt);
+#else
+ va_start(args);
+#endif
+ n = vsnprintf(0, 0, fmt, args);
+ va_end (args);
+ return n;
+}
+
+main()
+{
+ int n;
+ n = foo("%s", "0123456");
+ exit(n != 7);
+}
+], bash_cv_func_vsnprintf=yes, bash_cv_func_vsnprintf=no,
+ [AC_MSG_WARN([cannot check standard vsnprintf if cross-compiling])
+ bash_cv_func_vsnprintf=yes]
+)])
+ if test $bash_cv_func_vsnprintf = no; then
+ ac_cv_func_vsnprintf=no
+ fi
+ fi
+ if test $ac_cv_func_vsnprintf = no; then
+ AC_DEFINE(HAVE_VSNPRINTF, 0,
+ [Define if you have a standard-conformant vsnprintf function.])
+ fi
+])