]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - intl/configure
intl: Allow building both with old bison and bison >= 3 [PR92008]
[thirdparty/gcc.git] / intl / configure
index 870b29f7d3fe660ba3d16b50a0c2dbad62dd3a34..58cee2983a5b1daf1939e994deaaf3367366b778 100755 (executable)
@@ -622,6 +622,8 @@ ac_unique_file="gettext.c"
 ac_header_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+BISON3_NO
+BISON3_YES
 INCINTL
 LIBINTL_DEP
 MAINT
@@ -6791,6 +6793,31 @@ case $USE_INCLUDED_LIBINTL in
     ;;
 esac
 
+BISON3_YES='#'
+BISON3_NO=
+if test "$INTLBISON" != :; then
+  ac_bison3=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking bison 3 or later" >&5
+$as_echo_n "checking bison 3 or later... " >&6; }
+  ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+  case $ac_prog_version in
+    [3-9].*)
+      ac_prog_version="$ac_prog_version, bison3"; ac_bison3=yes;;
+    *) ac_prog_version="$ac_prog_version, old";;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
+$as_echo "$ac_prog_version" >&6; }
+  if test $ac_bison3 = yes; then
+
+$as_echo "#define HAVE_BISON3 1" >>confdefs.h
+
+    BISON3_YES=
+    BISON3_NO='#'
+  fi
+fi
+
+
+
 ac_config_files="$ac_config_files Makefile config.intl"
 
 cat >confcache <<\_ACEOF