+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * lib/strspn.c: New.
+
2001-08-01 Marc Autret <autret_m@epita.fr>
* doc/bison.texinfo: Update.
Jesse Thilo jthilo@gnu.org
Jim Meyering meyering@gnu.org
Laurent Mascherpa laurent.mascherpa@epita.fr
+Marc Autret autret_m@epita.fr
Neil Booth NeilB@earthling.net
Noah Friedman friedman@gnu.org
Paul Eggert eggert@twinsun.com
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
-# serial 9
+# serial 10
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
AC_CHECK_FUNCS(dcgettext)
LIBS="$gt_save_LIBS"
+ dnl Search for GNU msgfmt in the PATH.
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
- if test "$MSGFMT" != "no"; then
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- fi
+ [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ dnl Search for GNU xgettext in the PATH.
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
CATOBJEXT=.gmo
fi
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+ [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
AC_SUBST(MSGFMT)
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+ dnl Test whether we really found GNU msgfmt.
+ if test "$GMSGFMT" != ":"; then
+ dnl If it is no GNU msgfmt we define it as : so that the
+ dnl Makefiles still can work.
+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found msgfmt program is not GNU msgfmt; ignore it])
+ GMSGFMT=":"
+ fi
+ fi
+
+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
- if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
: ;
else
AC_MSG_RESULT(
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
-# serial 1
+# serial 2
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
;;
esac])dnl
$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
# serial 2
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
+/* Define if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the `strnlen' function. */
#undef HAVE_STRNLEN
+/* Define if you have the `strspn' function. */
+#undef HAVE_STRSPN
+
/* Define if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
/* Define if you have the `tsearch' function. */
#undef HAVE_TSEARCH
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.50)
+AC_PREREQ(2.52)
AC_INIT(bison, 1.28a, bug-bison@gnu.org)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(bison, 1.28a)
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(mkstemp setlocale)
AC_CHECK_DECLS([stpcpy, strndup, strnlen, memchr])
-AC_REPLACE_FUNCS(stpcpy strndup strnlen memchr)
+AC_REPLACE_FUNCS(stpcpy strndup strnlen strspn memchr)
jm_FUNC_MALLOC
jm_FUNC_REALLOC
jm_PREREQ_QUOTEARG
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in alloca.c ansi2knr.1 ansi2knr.c \
-memchr.c stpcpy.c strndup.c strnlen.c
+memchr.c stpcpy.c strndup.c strnlen.c strspn.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
DEP_FILES = .deps/alloca.P .deps/error.P .deps/getopt.P .deps/getopt1.P \
.deps/memchr.P .deps/obstack.P .deps/quote.P .deps/quotearg.P \
-.deps/stpcpy.P .deps/strndup.P .deps/strnlen.P .deps/xmalloc.P \
-.deps/xstrdup.P
+.deps/stpcpy.P .deps/strndup.P .deps/strnlen.P .deps/strspn.P \
+.deps/xmalloc.P .deps/xstrdup.P
SOURCES = $(libbison_a_SOURCES)
OBJECTS = $(libbison_a_OBJECTS)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strndup_.c
strnlen_.c: strnlen.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strnlen.c; then echo $(srcdir)/strnlen.c; else echo strnlen.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strnlen_.c
+strspn_.c: strspn.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
xmalloc_.c: xmalloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xmalloc_.c
xstrdup_.c: xstrdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrdup_.c
alloca_.o error_.o getopt_.o getopt1_.o memchr_.o obstack_.o quote_.o \
-quotearg_.o stpcpy_.o strndup_.o strnlen_.o xmalloc_.o xstrdup_.o : \
-$(ANSI2KNR)
+quotearg_.o stpcpy_.o strndup_.o strnlen_.o strspn_.o xmalloc_.o \
+xstrdup_.o : $(ANSI2KNR)
tags: TAGS
--- /dev/null
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU
+ C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License
+ as published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place -
+ Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined _LIBC || HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#undef strspn
+
+/* Return the length of the maximum initial segment
+ of S which contains only characters in ACCEPT. */
+size_t
+strspn (s, accept)
+ const char *s;
+ const char *accept;
+{
+ const char *p;
+ const char *a;
+ size_t count = 0;
+
+ for (p = s; *p != '\0'; ++p)
+ {
+ for (a = accept; *a != '\0'; ++a)
+ if (*p == *a)
+ break;
+ if (*a == '\0')
+ return count;
+ else
+ ++count;
+ }
+
+ return count;
+}
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strndup_.c
strnlen_.c: strnlen.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strnlen.c; then echo $(srcdir)/strnlen.c; else echo strnlen.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strnlen_.c
+strspn_.c: strspn.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
symtab_.c: symtab.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/symtab.c; then echo $(srcdir)/symtab.c; else echo symtab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > symtab_.c
vmsgetargs_.c: vmsgetargs.c $(ANSI2KNR)
LR0_.o alloca_.o closure_.o complain_.o conflicts_.o derives_.o \
files_.o getargs_.o gram_.o lalr_.o lex_.o main_.o memchr_.o \
nullable_.o output_.o print_.o reader_.o reduce_.o stpcpy_.o strndup_.o \
-strnlen_.o symtab_.o vmsgetargs_.o warshall_.o : $(ANSI2KNR)
+strnlen_.o strspn_.o symtab_.o vmsgetargs_.o warshall_.o : $(ANSI2KNR)
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)