From 75d1962a247ed6f14d662984bc5497eb355639dc Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 6 Apr 2017 20:58:12 +0400 Subject: [PATCH] Using the -t command line to bison instead of %name-prefix Needed to compile on machines with older bison versions. Adding a new parameter "name_prefix" to RUN_BISON() cmake macro. --- cmake/bison.cmake | 4 ++-- sql/CMakeLists.txt | 2 ++ sql/sql_yacc.yy | 1 - sql/sql_yacc_ora.yy | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/bison.cmake b/cmake/bison.cmake index 9651fe70cbbfa..a6a6268c64422 100644 --- a/cmake/bison.cmake +++ b/cmake/bison.cmake @@ -40,7 +40,7 @@ ELSEIF(BISON_EXECUTABLE AND NOT BISON_USABLE) ENDIF() # Use bison to generate C++ and header file -MACRO (RUN_BISON input_yy output_cc output_h) +MACRO (RUN_BISON input_yy output_cc output_h name_prefix) IF(BISON_TOO_OLD) IF(EXISTS ${output_cc} AND EXISTS ${output_h}) SET(BISON_USABLE FALSE) @@ -50,7 +50,7 @@ MACRO (RUN_BISON input_yy output_cc output_h) ADD_CUSTOM_COMMAND( OUTPUT ${output_cc} ${output_h} - COMMAND ${BISON_EXECUTABLE} -y + COMMAND ${BISON_EXECUTABLE} -y -p ${name_prefix} --output=${output_cc} --defines=${output_h} ${input_yy} diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index a82aeb8f32e95..964cbd6894c51 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -279,12 +279,14 @@ RUN_BISON( ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h + MYSQL ) RUN_BISON( ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc_ora.yy ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.h + ORA ) # Gen_lex_hash diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c2f6157da52d0..1be67ac572961 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -852,7 +852,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %} %pure-parser /* We have threads */ -%name-prefix "MYSQL" %parse-param { THD *thd } %lex-param { THD *thd } /* diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 17eefce5a7290..42fc7e90fc24f 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -270,7 +270,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %} %pure-parser /* We have threads */ -%name-prefix "ORA" %parse-param { THD *thd } %lex-param { THD *thd } /*