charset.alias
getdate.c
getdate.tab.c
+getopt.h
fnmatch.h
fts.h
lstat.c
+2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * getopt.c, getopt1.c: Sync from gnulib.
+ * getopt_.h: Renamed from getopt.h (this syncs from gnulib).
+ * Makefile.am (libfetish_a_SOURCES): Remove getopt.c, getopt.h,
+ getopt1.c, getopt_int.h.
+ (BUILT_SOURCES, EXTRA_DIST, all-local, $(lib_OBJECTS), getopt.h,
+ MOSTLYCLEANFILES): Add current gnulib snippet for getopt.
+ * .cppi-disable: Add getopt_.h, getopt_int.h.
+ * .cvsignore: Add getopt.h.
+
2004-08-18 Paul Eggert <eggert@cs.ucla.edu>
* userspec.c: Don't use <alloca.h>, so that we don't use alloca on
posixtm.c posixtm.h \
posixver.c posixver.h \
strftime.c strftime.h \
- getopt.c getopt.h getopt1.c getopt_int.h \
hash.c hash.h \
hash-pjw.c hash-pjw.h \
__fpending.h \
cp $(srcdir)/fnmatch_.h $@-t
mv $@-t $@
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
+
+BUILT_SOURCES += $(GETOPT_H)
+EXTRA_DIST += getopt_.h getopt_int.h
+
+# We need the following in order to create an <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+all-local $(lib_OBJECTS): $(GETOPT_H)
+getopt.h: getopt_.h
+ cp $(srcdir)/getopt_.h $@-t
+ mv $@-t $@
+MOSTLYCLEANFILES += getopt.h getopt.h-t
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004
- Free Software Foundation, Inc.
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
#include <stdio.h>
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-# define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
0);
}
-#endif /* Not ELIDE_CODE. */
\f
#ifdef TEST
#include <stdio.h>
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
1, d);
}
-#endif /* Not ELIDE_CODE. */
\f
#ifdef TEST
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
+ optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _GETOPT_INT_H
-# define _GETOPT_INT_H 1
+#define _GETOPT_INT_H 1
extern int _getopt_internal (int ___argc, char *const *___argv,
const char *__shortopts,
int __first_nonopt;
int __last_nonopt;
-# if defined _LIBC && defined USE_NONOPTION_FLAGS
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
int __nonoption_flags_max_len;
int __nonoption_flags_len;
# endif
/* The initializer is necessary to set OPTIND and OPTERR to their
default values and to clear the initialization flag. */
-# define _GETOPT_DATA_INITIALIZER { 1, 1 }
+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
extern int _getopt_internal_r (int ___argc, char *const *___argv,
const char *__shortopts,
+2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * getopt.m4: Sync from gnulib.
+
2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
* obstack.m4 (gl_PREREQ_OBSTACK): Require
-# getopt.m4 serial 2
-dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# getopt.m4 serial 3
+dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
+# The getopt module assume you want GNU getopt, with getopt_long etc,
+# rather than vanilla POSIX getopt. This means your your code should
+# always include <getopt.h> for the getopt prototypes.
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE],
+[
+ GETOPT_H=getopt.h
+ AC_LIBOBJ([getopt])
+ AC_LIBOBJ([getopt1])
+ AC_DEFINE([optarg], [rpl_optarg],
+ [Define to rpl_optarg if the replacement variable should be used.])
+ AC_DEFINE([optind], [rpl_optind],
+ [Define to rpl_optind if the replacement variable should be used.])
+ AC_DEFINE([optopt], [rpl_optopt],
+ [Define to rpl_optopt if the replacement variable should be used.])
+ AC_DEFINE([getopt], [rpl_getopt],
+ [Define to rpl_getopt if the replacement function should be used.])
+ AC_DEFINE([getopt_long], [rpl_getopt_long],
+ [Define to rpl_getopt_long if the replacement function should be used.])
+ AC_DEFINE([getopt_long_only], [rpl_getopt_long_only],
+ [Define to rpl_getopt_long_only if the replacement function should be used.])
+ AC_SUBST([GETOPT_H])
+])
+
AC_DEFUN([gl_GETOPT],
[
- dnl Prerequisites of lib/getopt.c.
- :
+ gl_PREREQ_GETOPT
+
+ GETOPT_H=
+ AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
+ AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
+
+ if test -n "$GETOPT_H"; then
+ gl_GETOPT_SUBSTITUTE
+ fi
])
+
+# Prerequisites of lib/getopt*.
+AC_DEFUN([gl_PREREQ_GETOPT], [:])