summaryrefslogtreecommitdiff
path: root/gl/m4
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-05-20 09:44:38 +0200
committerSimon Josefsson <simon@josefsson.org>2010-05-20 09:44:38 +0200
commit7f36c1c5b302f2257b8d323513a469402e84212c (patch)
tree9ea2619d0def7930eebda48f106dfddc910b2982 /gl/m4
parent98f9d13a28d278409661d73639afe3cc205ba3d1 (diff)
downloadlibtasn1-7f36c1c5b302f2257b8d323513a469402e84212c.tar.gz
Update gnulib files, use valgrind-tests module.
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/gnulib-cache.m43
-rw-r--r--gl/m4/gnulib-common.m48
-rw-r--r--gl/m4/gnulib-comp.m45
-rw-r--r--gl/m4/unistd_h.m411
-rw-r--r--gl/m4/valgrind-tests.m434
5 files changed, 56 insertions, 5 deletions
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 72a57f4..b52050d 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright version-etc-fsf warnings
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
@@ -31,6 +31,7 @@ gl_MODULES([
read-file
stdint
update-copyright
+ valgrind-tests
version-etc-fsf
warnings
])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 54b2517..4c7ac30 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 19
+# gnulib-common.m4 serial 20
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
])
+ dnl Preparation for running test programs:
+ dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+ dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
+ dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
])
# gl_MODULE_INDICATOR_CONDITION
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index db53902..731b98d 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -57,6 +57,7 @@ AC_DEFUN([gl_EARLY],
# Code from module unistd:
# Code from module update-copyright:
# Code from module useless-if-before-free:
+ # Code from module valgrind-tests:
# Code from module vc-list-files:
# Code from module version-etc:
# Code from module version-etc-fsf:
@@ -133,6 +134,8 @@ AC_DEFUN([gl_INIT],
gl_UNISTD_H
# Code from module update-copyright:
# Code from module useless-if-before-free:
+ # Code from module valgrind-tests:
+ gl_VALGRIND_TESTS
# Code from module vc-list-files:
# Code from module version-etc:
gl_VERSION_ETC
@@ -188,6 +191,7 @@ changequote([, ])dnl
AC_SUBST([gltests_WITNESS])
gl_module_indicator_condition=$gltests_WITNESS
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ gl_VALGRIND_TESTS
m4_popdef([gl_MODULE_INDICATOR_CONDITION])
m4_ifval(gltests_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
@@ -325,6 +329,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdint.m4
m4/stdlib_h.m4
m4/unistd_h.m4
+ m4/valgrind-tests.m4
m4/version-etc.m4
m4/warn-on-use.m4
m4/warnings.m4
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 8c2eec6..48d06c7 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 45
+# unistd_h.m4 serial 46
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -38,8 +38,9 @@ AC_DEFUN([gl_UNISTD_H],
]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
fsync ftruncate getcwd getdomainname getdtablesize getgroups
gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe2 pread readlink readlinkat
- rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep])
+ endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+ readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+ usleep])
])
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -79,6 +80,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
+ GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
@@ -113,6 +115,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
+ HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
@@ -140,10 +143,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
+ REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
+ REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
diff --git a/gl/m4/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4
new file mode 100644
index 0000000..e2434c6
--- /dev/null
+++ b/gl/m4/valgrind-tests.m4
@@ -0,0 +1,34 @@
+# valgrind-tests.m4 serial 1
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_VALGRIND_TESTS()
+# -------------------
+# Check if valgrind is available, and set VALGRIND to it if available.
+AC_DEFUN([gl_VALGRIND_TESTS],
+[
+ AC_ARG_ENABLE(valgrind-tests,
+ AS_HELP_STRING([--enable-valgrind-tests],
+ [run self tests under valgrind]),
+ [opt_valgrind_tests=$enableval], [opt_valgrind_tests=yes])
+
+ # Run self-tests under valgrind?
+ if test "$opt_valgrind_tests" = "yes" && test "$cross_compiling" = no; then
+ AC_CHECK_PROGS(VALGRIND, valgrind)
+ fi
+
+ if test -n "$VALGRIND" && $VALGRIND -q true > /dev/null 2>&1; then
+ opt_valgrind_tests=yes
+ VALGRIND="$VALGRIND -q"
+ else
+ opt_valgrind_tests=no
+ VALGRIND=
+ fi
+
+ AC_MSG_CHECKING([whether self tests are run under valgrind])
+ AC_MSG_RESULT($opt_valgrind_tests)
+])