summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-08-09 11:38:04 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-08-09 11:46:06 -0700
commit904be8c4cf8522a54a85542954bd553b6dbd0b64 (patch)
tree7f0c1eac5585e02a5461b36224490938cbcf3e92 /m4
parent7fc27ea70bc7dc24776b2c098ac970f2f21e37fb (diff)
downloademacs-904be8c4cf8522a54a85542954bd553b6dbd0b64.tar.gz
Merge from gnulib
This incorporates: 2017-08-09 tempname: do not depend on secure_getenv 2017-08-08 extensions: add _OPENBSD_SOURCE 2017-08-06 manywarnings: Add support for C++ 2017-08-06 warnings, manywarnings: Add support for multiple languages * admin/merge-gnulib: Don't use m4/manywarnings-c++.m4. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/secure_getenv.c, m4/secure_getenv.m4: Remove. * lib/tempname.c, m4/extensions.m4, m4/manywarnings.m4, m4/warnings.m4: Copy from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/extensions.m47
-rw-r--r--m4/gnulib-comp.m419
-rw-r--r--m4/manywarnings.m418
-rw-r--r--m4/secure_getenv.m426
-rw-r--r--m4/warnings.m447
5 files changed, 60 insertions, 57 deletions
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index c60f537db17..0c16bb832f8 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 15 -*- Autoconf -*-
+# serial 16 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc.
@@ -68,6 +68,10 @@ dnl configure.ac when using autoheader 2.62.
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
+/* Enable OpenBSD extensions on NetBSD. */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
@@ -128,6 +132,7 @@ dnl configure.ac when using autoheader 2.62.
AC_DEFINE([_ALL_SOURCE])
AC_DEFINE([_DARWIN_C_SOURCE])
AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_OPENBSD_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 188c116c851..69d77229bf7 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -124,7 +124,6 @@ AC_DEFUN([gl_EARLY],
# Code from module readlink:
# Code from module readlinkat:
# Code from module root-uid:
- # Code from module secure_getenv:
# Code from module sig2str:
# Code from module signal-h:
# Code from module snippet/_Noreturn:
@@ -424,7 +423,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
- gl_gnulib_enabled_secure_getenv=false
gl_gnulib_enabled_strtoll=false
gl_gnulib_enabled_tempname=false
gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
@@ -550,18 +548,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
fi
}
- func_gl_gnulib_m4code_secure_getenv ()
- {
- if ! $gl_gnulib_enabled_secure_getenv; then
- gl_FUNC_SECURE_GETENV
- if test $HAVE_SECURE_GETENV = 0; then
- AC_LIBOBJ([secure_getenv])
- gl_PREREQ_SECURE_GETENV
- fi
- gl_STDLIB_MODULE_INDICATOR([secure_getenv])
- gl_gnulib_enabled_secure_getenv=true
- fi
- }
func_gl_gnulib_m4code_strtoll ()
{
if ! $gl_gnulib_enabled_strtoll; then
@@ -579,7 +565,6 @@ AC_DEFUN([gl_INIT],
if ! $gl_gnulib_enabled_tempname; then
gl_FUNC_GEN_TEMPNAME
gl_gnulib_enabled_tempname=true
- func_gl_gnulib_m4code_secure_getenv
fi
}
func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec ()
@@ -658,7 +643,6 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_secure_getenv], [$gl_gnulib_enabled_secure_getenv])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
AM_CONDITIONAL([gl_GNULIB_ENABLED_tempname], [$gl_gnulib_enabled_tempname])
AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
@@ -907,7 +891,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/readlink.c
lib/readlinkat.c
lib/root-uid.h
- lib/secure_getenv.c
lib/set-permissions.c
lib/sha1.c
lib/sha1.h
@@ -1008,6 +991,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/localtime-buffer.m4
m4/longlong.m4
m4/lstat.m4
+ m4/manywarnings-c++.m4
m4/manywarnings.m4
m4/md5.m4
m4/memrchr.m4
@@ -1024,7 +1008,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/putenv.m4
m4/readlink.m4
m4/readlinkat.m4
- m4/secure_getenv.m4
m4/sha1.m4
m4/sha256.m4
m4/sha512.m4
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 6a8939b2c1e..a3d255a9402 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 10
+# manywarnings.m4 serial 11
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -33,8 +33,16 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
# Add all documented GCC warning parameters to variable VARIABLE.
# Note that you need to test them using gl_WARN_ADD if you want to
# make sure your gcc understands it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_MANYWARN_ALL_GCC],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C.
+AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
[
+ AC_LANG_PUSH([C])
+
dnl First, check for some issues that only occur when combining multiple
dnl gcc warning categories.
AC_REQUIRE([AC_PROG_CC])
@@ -303,4 +311,12 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
fi
$1=$gl_manywarn_set
+
+ AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++.
+AC_DEFUN([gl_MANYWARN_ALL_GCC(C++)],
+[
+ gl_MANYWARN_ALL_GCC_CXX_IMPL([$1])
])
diff --git a/m4/secure_getenv.m4 b/m4/secure_getenv.m4
deleted file mode 100644
index 6bd4afd9c1a..00000000000
--- a/m4/secure_getenv.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# Look up an environment variable more securely.
-dnl Copyright 2013-2017 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.
-
-AC_DEFUN([gl_FUNC_SECURE_GETENV],
-[
- dnl Persuade glibc <stdlib.h> to declare secure_getenv().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([secure_getenv])
- if test $ac_cv_func_secure_getenv = no; then
- HAVE_SECURE_GETENV=0
- fi
-])
-
-# Prerequisites of lib/secure_getenv.c.
-AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
- AC_CHECK_FUNCS([__secure_getenv])
- if test $ac_cv_func___secure_getenv = no; then
- AC_CHECK_FUNCS([issetugid])
- fi
- AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid])
-])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index e697174eddc..aa2735b77ff 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
-# warnings.m4 serial 11
+# warnings.m4 serial 12
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -20,10 +20,12 @@ m4_ifdef([AS_VAR_APPEND],
# -----------------------------------------------------------------
# Check if the compiler supports OPTION when compiling PROGRAM.
#
-# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
-# 2.64 or newer.
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_COMPILER_OPTION_IF],
-[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+[
+dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf
+dnl 2.64 or newer.
+AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
AS_LITERAL_IF([$1],
[m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
@@ -51,27 +53,50 @@ AS_VAR_POPDEF([gl_Warn])dnl
# ------------------------------
# Clang doesn't complain about unknown warning options unless one also
# specifies -Wunknown-warning-option -Werror. Detect this.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
+[
+ AC_LANG_PUSH([C])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
+[
+ AC_LANG_PUSH([C++])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([C++])
+])
+
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
[gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
[gl_unknown_warnings_are_errors=])])
-# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS],
# [PROGRAM = AC_LANG_PROGRAM()])
-# ---------------------------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it when
-# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+# -----------------------------------------------------------
+# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it
+# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
#
# If VARIABLE is a variable name, AC_SUBST it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_WARN_ADD],
-[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)])
gl_COMPILER_OPTION_IF([$1],
- [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+ [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])],
[],
[$3])
m4_ifval([$2],
[AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
- [AC_SUBST([WARN_CFLAGS])])dnl
+ [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl
])
# Local Variables: