1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

10 Commits

Author SHA1 Message Date
Bruno Haible
37d5dc0daa getopt-gnu: Add comments.
* m4/getopt.m4 (gl_FUNC_GETOPT_GNU): Add comments.
* modules/getopt-gnu (configure.ac): Likewise.
2017-04-19 00:14:20 +02:00
Paul Eggert
28ac412baf getopt-gnu: omit some duplicate code
* m4/getopt.m4 (gl_FUNC_GETOPT_GNU): Don’t require
gl_FUNC_GETOPT_POSIX, as the configure.ac code generated by
gnulib-tool already does this.
* modules/getopt-gnu (configure.ac): Omit code duplicated from
getopt-posix, which we depend on.
2017-04-06 15:42:05 -07:00
Zack Weinberg
fbd6c98844 getopt: clean up getopt.c and getopt1.c file headers
In getopt.c, there is no need to include wchar.h at all, and it is
safe nowadays to assume that stdlib.h does declare getenv (several
other gnulib modules make this assumption).

In getopt1.c, the #ifdef _LIBC block at the top can be simplified
by using "" inclusions consistently, and there is no actual need to
include stdlib.h (except in the #ifdef TEST block, where it should be
unconditional), nor to provide a backup definition of NULL at all.

* lib/getopt1.c: Simplify #ifdeffage at top of file.
Move inclusion of stdlib.h to #ifdef TEST block and make
unconditional.  Do not define NULL.
* lib/getopt.c: Don't include wchar.h. No need to declare getenv.
* m4/getopt.m4 (gl_PREREQ_GETENV): Delete.
* modules/getopt-gnu, modules/getopt-posix: Don't call
gl_PREREQ_GETENV.
2017-04-06 15:42:03 -07:00
Bruno Haible
bd70cf691d Split tests for getopt-posix and getopt-gnu.
* tests/test-getopt-posix.c: New file.
* tests/test-getopt-gnu.c: New file, with code from test-getopt.c.
* tests/test-getopt-main.h: Renamed from tests/test-getopt.c. Remove
stuff moved to test-getopt-gnu.c. Test TEST_GETOPT_GNU instead of
GNULIB_TEST_GETOPT_GNU.
* modules/getopt-posix-tests (Files): Add test-getopt-posix.c,
test-getopt-main.h. Remove test-getopt.c, test-getopt_long.h.
(Makefile.am): Test test-getopt-posix instead of test-getopt.
* modules/getopt-gnu-tests: New file.
* modules/getopt-gnu (configure.ac): Don't define GNULIB_TEST_GETOPT_GNU.
2016-12-18 14:03:37 +01:00
Bruno Haible
48bf98f380 Fix conflict between two instantiations of module 'unistd'.
* gnulib-tool (func_emit_autoconf_snippet): Substitute
${include_guard_prefix} also in the autoconf snippet.
* m4/getopt.m4 (gl_FUNC_GETOPT_POSIX): Don't set GNULIB_UNISTD_H_GETOPT.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize
GNULIB_UNISTD_H_GETOPT.
* modules/getopt-posix (configure.ac): Set the
GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT variable.
* modules/getopt-gnu (configure.ac): Likewise.
* modules/unistd (Makefile.am): Change the substitution value of
GNULIB_UNISTD_H_GETOPT to depend on the include guard prefix.
Reported by Simon Josefsson.
2011-11-26 21:08:25 +01:00
Pádraig Brady
a2eb92ef60 getopt-gnu: suppress core dumps from detection code
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Use the nocrash module
to suppress core dumps that may well occur on glibc systems.
These core dumps might not be cleaned up automatically, or could
trigger some system core dump handling logic.
* modules/getopt-gnu: Depend on nocrash.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
2011-07-19 18:47:38 +01:00
Bruno Haible
37723302e7 getopt: Move AC_LIBOBJ invocations to module description.
* m4/getopt.m4 (gl_REPLACE_GETOPT): Remove macro.
(gl_FUNC_GETOPT): Inline it here. Move AC_LIBOBJ and gl_PREREQ_GETOPT
invocations from here...
* modules/getopt-gnu (configure.ac): ... to here.
* modules/getopt-posix (configure.ac): ... and here.
(Depends-on): Update condition.
2011-06-16 00:06:07 +02:00
Jim Meyering
c2090a84dc getopt-gnu: relax license from LGPLv3+ to LGPLv2+
* modules/getopt-gnu (License): Relax to LGPLv2+, for augeas,
on request from Matthew Booth.
2011-03-03 07:59:42 +01:00
Bruno Haible
cd21604b6b Distinguish two kinds of module indicators. 2010-03-28 00:46:24 +01:00
Bruno Haible
1dff1a67c5 New modules 'getopt-posix', 'getopt-gnu'. 2009-08-13 01:23:35 +02:00