blob: 35a131067aebb3d0005ed3113152e5f3ea29bc7d [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 04bd40fe2c48c6e01ab418a04d27c4aff644ad96 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 17 Feb 2016 23:54:02 -0500
4Subject: [PATCH] m4/bison-i18n.m4: add --with-bisonlocaledir to assign
5 BISON_LOCALEDIR
6
7The variable BISON_LOCALEDIR is assigned only by the output of
8'bison --print-localedir', we add option --with-bisonlocaledir
9to assign it explicitly. It is helpful for user to split the
10native compile and cross compile.
11
12For backward compatibility, if option not used, it still
13make use of the output of 'bison --print-localedir'.
14
15Upstream-Status: Submitted [bison-patches@gnu.org]
16
17Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
18---
19 gettext-tools/gnulib-m4/bison-i18n.m4 | 10 ++++++++--
20 1 file changed, 8 insertions(+), 2 deletions(-)
21
22diff --git a/gettext-tools/gnulib-m4/bison-i18n.m4 b/gettext-tools/gnulib-m4/bison-i18n.m4
23index f5cfd3a..fb6ac4d 100644
24--- a/gettext-tools/gnulib-m4/bison-i18n.m4
25+++ b/gettext-tools/gnulib-m4/bison-i18n.m4
26@@ -14,11 +14,16 @@ dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
27 dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
28 AC_DEFUN([BISON_I18N],
29 [
30+ dnl Default is not to set bisonlocaledir
31+ AC_ARG_WITH([bisonlocaledir],
32+ [ --with-bisonlocaledir sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files],
33+ BISON_LOCALEDIR=$withval,
34+ BISON_LOCALEDIR=)
35+
36 if test -z "$USE_NLS"; then
37 echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
38 exit 1
39 fi
40- BISON_LOCALEDIR=
41 BISON_USE_NLS=no
42 if test "$USE_NLS" = yes; then
43 dnl Determine bison's localedir.
44@@ -26,9 +31,10 @@ AC_DEFUN([BISON_I18N],
45 dnl But even is YACC is called "yacc", it may be a script that invokes bison
46 dnl and accepts the --print-localedir option.
47 dnl YACC's default value is empty; BISON's default value is :.
48- if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
49+ if test -z "$BISON_LOCALEDIR" -a ${YACC-${BISON-:}} --print-localedir >/dev/null 2>&1; then
50 BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
51 fi
52+ AC_MSG_RESULT([$BISON_LOCALEDIR])
53 AC_SUBST([BISON_LOCALEDIR])
54 if test -n "$BISON_LOCALEDIR"; then
55 dnl There is no need to enable internationalization if the user doesn't
56--
571.9.1
58