Commit edabb125 authored by Anel Husakovic's avatar Anel Husakovic

MDEV-21286: bison warnings on ubuntu 20.04 on deprecated directive in sql_yacc.yy

Results with
```
%define api.pure                                    /* We have threads */
```
in `<build-dir>/sql/[yy_mariadb|yy_oracle].yy` files.

Reviewed by: wlad@mariadb.com
parent de2b5795
...@@ -65,6 +65,8 @@ ADD_CUSTOM_COMMAND( ...@@ -65,6 +65,8 @@ ADD_CUSTOM_COMMAND(
DEPENDS gen_lex_token DEPENDS gen_lex_token
) )
FIND_PACKAGE(BISON 2.0)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy
${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy
...@@ -72,6 +74,7 @@ ADD_CUSTOM_COMMAND( ...@@ -72,6 +74,7 @@ ADD_CUSTOM_COMMAND(
"-DOUT1=${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy" "-DOUT1=${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy"
"-DOUT2=${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy" "-DOUT2=${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy"
"-DIN=${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy" "-DIN=${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy"
"-DBISON_VERSION=${BISON_VERSION}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/gen_yy_files.cmake -P ${CMAKE_CURRENT_SOURCE_DIR}/gen_yy_files.cmake
COMMENT "Building yy_mariadb.yy and yy_oracle.yy from sql_yacc.yy" COMMENT "Building yy_mariadb.yy and yy_oracle.yy from sql_yacc.yy"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy
...@@ -321,8 +324,6 @@ IF(WITH_MYSQLD_LDFLAGS) ...@@ -321,8 +324,6 @@ IF(WITH_MYSQLD_LDFLAGS)
ENDIF() ENDIF()
FIND_PACKAGE(BISON 2.0)
# Handle out-of-source build from source package with possibly broken # Handle out-of-source build from source package with possibly broken
# bison. Copy bison output to from source to build directory, if not already # bison. Copy bison output to from source to build directory, if not already
......
...@@ -5,6 +5,9 @@ file(READ "${IN}" data) ...@@ -5,6 +5,9 @@ file(READ "${IN}" data)
file(WRITE "${OUT1}" "") file(WRITE "${OUT1}" "")
file(WRITE "${OUT2}" "") file(WRITE "${OUT2}" "")
set(where 0) set(where 0)
if(NOT(BISON_VERSION VERSION_LESS "3.0.0"))
string(REPLACE "\n%pure-parser" "\n%define api.pure" data "${data}")
endif()
string(REGEX REPLACE "/\\* sql_yacc\\.yy \\*/" "/* DON'T EDIT THIS FILE. IT'S GENERATED. EDIT sql_yacc.yy INSTEAD */" data "${data}") string(REGEX REPLACE "/\\* sql_yacc\\.yy \\*/" "/* DON'T EDIT THIS FILE. IT'S GENERATED. EDIT sql_yacc.yy INSTEAD */" data "${data}")
while(NOT data STREQUAL "") while(NOT data STREQUAL "")
string(REGEX MATCH "^(%[ie][^\n]*\n)|((%[^ie\n]|[^%\n])[^\n]*\n)+|\n+" line "${data}") string(REGEX MATCH "^(%[ie][^\n]*\n)|((%[^ie\n]|[^%\n])[^\n]*\n)+|\n+" line "${data}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment