mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-08 17:22:05 +03:00
parse-datetime: Require Bison 2.4 or newer.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Set PARSE_DATETIME_BISON. Code taken from gettext's intl.m4. * modules/parse-datetime (Makefile.am): Use PARSE_DATETIME_BISON instead of YACC.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2019-07-19 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
|
parse-datetime: Require Bison 2.4 or newer.
|
||||||
|
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Set PARSE_DATETIME_BISON.
|
||||||
|
Code taken from gettext's intl.m4.
|
||||||
|
* modules/parse-datetime (Makefile.am): Use PARSE_DATETIME_BISON instead
|
||||||
|
of YACC.
|
||||||
|
|
||||||
2019-07-19 Bruno Haible <bruno@clisp.org>
|
2019-07-19 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
areadlink-with-size, xgethostname, xgetdomainname: Fix GCC warning.
|
areadlink-with-size, xgethostname, xgetdomainname: Fix GCC warning.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# parse-datetime.m4 serial 22
|
# parse-datetime.m4 serial 23
|
||||||
dnl Copyright (C) 2002-2006, 2008-2019 Free Software Foundation, Inc.
|
dnl Copyright (C) 2002-2006, 2008-2019 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -26,6 +26,37 @@ AC_DEFUN([gl_C_COMPOUND_LITERALS],
|
|||||||
|
|
||||||
AC_DEFUN([gl_PARSE_DATETIME],
|
AC_DEFUN([gl_PARSE_DATETIME],
|
||||||
[
|
[
|
||||||
|
dnl parse-datetime.c is generated from parse-datetime.y. It requires bison,
|
||||||
|
dnl because parse-datetime.y uses bison specific features. It requires at
|
||||||
|
dnl least bison-2.4 for %define api.pure.
|
||||||
|
dnl bison is only needed for the maintainer (who touches parse-datetime.y).
|
||||||
|
dnl But in order to avoid separate Makefiles or --enable-maintainer-mode,
|
||||||
|
dnl we put the rule in general Makefile. Now, some people carelessly touch
|
||||||
|
dnl the files or have a broken "make" program, hence the parse-datetime.c
|
||||||
|
dnl rule will sometimes fire. To avoid an error, defines PARSE_DATETIME_BISON
|
||||||
|
dnl to ":" if it is not present or too old.
|
||||||
|
AC_CHECK_PROGS([PARSE_DATETIME_BISON], [bison])
|
||||||
|
if test -z "$PARSE_DATETIME_BISON"; then
|
||||||
|
ac_verc_fail=yes
|
||||||
|
else
|
||||||
|
dnl Found it, now check the version.
|
||||||
|
AC_MSG_CHECKING([version of bison])
|
||||||
|
changequote(<<,>>)dnl
|
||||||
|
ac_prog_version=`$PARSE_DATETIME_BISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
|
||||||
|
case $ac_prog_version in
|
||||||
|
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
|
||||||
|
1.* | 2.[0-3] | 2.[0-3].*)
|
||||||
|
changequote([,])dnl
|
||||||
|
ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
|
||||||
|
*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
|
||||||
|
esac
|
||||||
|
AC_MSG_RESULT([$ac_prog_version])
|
||||||
|
fi
|
||||||
|
if test $ac_verc_fail = yes; then
|
||||||
|
PARSE_DATETIME_BISON=:
|
||||||
|
fi
|
||||||
|
AC_SUBST([PARSE_DATETIME_BISON])
|
||||||
|
|
||||||
dnl Prerequisites of lib/parse-datetime.h.
|
dnl Prerequisites of lib/parse-datetime.h.
|
||||||
AC_REQUIRE([AM_STDBOOL_H])
|
AC_REQUIRE([AM_STDBOOL_H])
|
||||||
AC_REQUIRE([gl_TIMESPEC])
|
AC_REQUIRE([gl_TIMESPEC])
|
||||||
|
@@ -38,7 +38,7 @@ parse-datetime.c: parse-datetime.y
|
|||||||
y.tab.c parse-datetime.c \
|
y.tab.c parse-datetime.c \
|
||||||
y.tab.h parse-datetime.h \
|
y.tab.h parse-datetime.h \
|
||||||
y.output parse-datetime.output \
|
y.output parse-datetime.output \
|
||||||
-- $(YACC) $(YFLAGS) $(AM_YFLAGS) && \
|
-- $(PARSE_DATETIME_BISON) -y -d $(YFLAGS) $(AM_YFLAGS) && \
|
||||||
sed -e 's|".*/parse-datetime.y"|"parse-datetime.y"|' \
|
sed -e 's|".*/parse-datetime.y"|"parse-datetime.y"|' \
|
||||||
< parse-datetime.c > parse-datetime.c-t && \
|
< parse-datetime.c > parse-datetime.c-t && \
|
||||||
rm -f parse-datetime.c && \
|
rm -f parse-datetime.c && \
|
||||||
|
Reference in New Issue
Block a user