diff options
| author | Paul Eggert | 2017-04-06 16:29:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-04-06 16:30:09 -0700 |
| commit | 022755953fc63ef70b72576e14e94324d055ef60 (patch) | |
| tree | 47ea3e6fb2396a41f413badaf203d698543d68c3 /m4 | |
| parent | 451a0c8b6955006f5aaa8b660a9e0b935b4fa095 (diff) | |
| download | emacs-022755953fc63ef70b72576e14e94324d055ef60.tar.gz emacs-022755953fc63ef70b72576e14e94324d055ef60.zip | |
Merge from gnulib
This merges some getopt fixes from Zack Weinberg, and affects only
non-GNUish platforms. It incorporates:
2017-04-06 getopt-gnu: omit some duplicate code
2017-04-06 getopt-posix: use angle-bracket include
2017-04-06 getopt: annotate files with relationship to glibc
2017-04-06 getopt: split up getopt.in.h and eliminate __need_getopt
2017-04-06 getopt: better handling of ambiguous options
2017-04-06 getopt: refactor long-option handling
2017-04-06 getopt: tidy up _getopt_initialize a bit
2017-04-06 getopt: merge from glibc: repetition reduction
2017-04-06 getopt: clean up error reporting
2017-04-06 getopt: fix fencepost error in ambiguous-W-option handling
2017-04-06 getopt: clean up getopt.c and getopt1.c file headers
2017-04-06 getopt: harmonize comments with glibc
2017-04-06 getopt: remove USE_NONOPTION_FLAGS
2017-04-06 getopt: tabify, in preparation for merge with glibc
2017-04-06 md5, sha1, sha256, sha512: Add comments re correctness
* build-aux/config.sub, doc/misc/texinfo.tex, lib/getopt.c:
* lib/getopt.in.h, lib/getopt1.c, lib/getopt_int.h, lib/md5.c:
* lib/md5.h, lib/sha1.c, lib/sha1.h, lib/sha256.c, lib/sha256.h:
* lib/sha512.c, lib/sha512.h, lib/unistd.in.h, m4/getopt.m4:
Copy from gnulib.
* lib/getopt_cdefs.in.h, lib/getopt_core.h, lib/getopt_ext.h:
* lib/getopt_pfx_core.h, lib/getopt_pfx_ext.h:
New files, taken from gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate.
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/getopt.m4 | 22 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 14 |
2 files changed, 17 insertions, 19 deletions
diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 7a946263558..d90076922b2 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # getopt.m4 serial 44 | 1 | # getopt.m4 serial 45 |
| 2 | dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -33,8 +33,6 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX], | |||
| 33 | AC_DEFUN([gl_FUNC_GETOPT_GNU], | 33 | AC_DEFUN([gl_FUNC_GETOPT_GNU], |
| 34 | [ | 34 | [ |
| 35 | m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) | 35 | m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) |
| 36 | |||
| 37 | AC_REQUIRE([gl_FUNC_GETOPT_POSIX]) | ||
| 38 | ]) | 36 | ]) |
| 39 | 37 | ||
| 40 | # Determine whether to replace the entire getopt facility. | 38 | # Determine whether to replace the entire getopt facility. |
| @@ -354,15 +352,19 @@ dnl is ambiguous with environment values that contain newlines. | |||
| 354 | 352 | ||
| 355 | AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], | 353 | AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], |
| 356 | [ | 354 | [ |
| 357 | GETOPT_H=getopt.h | 355 | AC_CHECK_HEADERS_ONCE([sys/cdefs.h]) |
| 356 | if test $ac_cv_header_sys_cdefs_h = yes; then | ||
| 357 | HAVE_SYS_CDEFS_H=1 | ||
| 358 | else | ||
| 359 | HAVE_SYS_CDEFS_H=0 | ||
| 360 | fi | ||
| 361 | AC_SUBST([HAVE_SYS_CDEFS_H]) | ||
| 362 | |||
| 358 | AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], | 363 | AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], |
| 359 | [Define to rpl_ if the getopt replacement functions and variables | 364 | [Define to rpl_ if the getopt replacement functions and variables |
| 360 | should be used.]) | 365 | should be used.]) |
| 366 | GETOPT_H=getopt.h | ||
| 367 | GETOPT_CDEFS_H=getopt_cdefs.h | ||
| 361 | AC_SUBST([GETOPT_H]) | 368 | AC_SUBST([GETOPT_H]) |
| 362 | ]) | 369 | AC_SUBST([GETOPT_CDEFS_H]) |
| 363 | |||
| 364 | # Prerequisites of lib/getopt*. | ||
| 365 | AC_DEFUN([gl_PREREQ_GETOPT], | ||
| 366 | [ | ||
| 367 | AC_CHECK_DECLS_ONCE([getenv]) | ||
| 368 | ]) | 370 | ]) |
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index e613490f1a4..5aea057c5d5 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -259,19 +259,10 @@ AC_DEFUN([gl_INIT], | |||
| 259 | fi | 259 | fi |
| 260 | gl_STDLIB_MODULE_INDICATOR([getloadavg]) | 260 | gl_STDLIB_MODULE_INDICATOR([getloadavg]) |
| 261 | gl_FUNC_GETOPT_GNU | 261 | gl_FUNC_GETOPT_GNU |
| 262 | if test $REPLACE_GETOPT = 1; then | ||
| 263 | AC_LIBOBJ([getopt]) | ||
| 264 | AC_LIBOBJ([getopt1]) | ||
| 265 | gl_PREREQ_GETOPT | ||
| 266 | dnl Arrange for unistd.h to include getopt.h. | ||
| 267 | GNULIB_GL_UNISTD_H_GETOPT=1 | ||
| 268 | fi | ||
| 269 | AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) | ||
| 270 | gl_FUNC_GETOPT_POSIX | 262 | gl_FUNC_GETOPT_POSIX |
| 271 | if test $REPLACE_GETOPT = 1; then | 263 | if test $REPLACE_GETOPT = 1; then |
| 272 | AC_LIBOBJ([getopt]) | 264 | AC_LIBOBJ([getopt]) |
| 273 | AC_LIBOBJ([getopt1]) | 265 | AC_LIBOBJ([getopt1]) |
| 274 | gl_PREREQ_GETOPT | ||
| 275 | dnl Arrange for unistd.h to include getopt.h. | 266 | dnl Arrange for unistd.h to include getopt.h. |
| 276 | GNULIB_GL_UNISTD_H_GETOPT=1 | 267 | GNULIB_GL_UNISTD_H_GETOPT=1 |
| 277 | fi | 268 | fi |
| @@ -911,7 +902,12 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 911 | lib/getopt.c | 902 | lib/getopt.c |
| 912 | lib/getopt.in.h | 903 | lib/getopt.in.h |
| 913 | lib/getopt1.c | 904 | lib/getopt1.c |
| 905 | lib/getopt_cdefs.in.h | ||
| 906 | lib/getopt_core.h | ||
| 907 | lib/getopt_ext.h | ||
| 914 | lib/getopt_int.h | 908 | lib/getopt_int.h |
| 909 | lib/getopt_pfx_core.h | ||
| 910 | lib/getopt_pfx_ext.h | ||
| 915 | lib/gettext.h | 911 | lib/gettext.h |
| 916 | lib/gettime.c | 912 | lib/gettime.c |
| 917 | lib/gettimeofday.c | 913 | lib/gettimeofday.c |