From e813549942bcedf613910db54d9ce94f62ed349f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 11 Sep 2021 00:13:15 +0200 Subject: Backport "Fix generation of bison output for out-of-source builds."to 10.5 Apply 115fec58f16d3c49 to 10.5 --- .gitignore | 1 + sql/CMakeLists.txt | 5 +++-- sql/myskel.m4 | 18 ------------------ sql/myskel.m4.in | 13 +++++++++++++ 4 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 sql/myskel.m4 create mode 100644 sql/myskel.m4.in diff --git a/.gitignore b/.gitignore index d4c6aa55880..1f7f71191c5 100644 --- a/.gitignore +++ b/.gitignore @@ -193,6 +193,7 @@ sql/lex_token.h sql/gen_lex_token sql/gen_lex_hash sql/lex_hash.h +sql/myskel.m4 sql/mysql_tzinfo_to_sql sql/mysqld sql/sql_builtin.cc diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index eb6f3d4dfdd..5719d098383 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -352,12 +352,13 @@ IF (NOT BISON_FOUND) MESSAGE(FATAL_ERROR ${ERRMSG}) ENDIF() ELSE() + CONFIGURE_FILE(myskel.m4.in myskel.m4) BISON_TARGET(gen_mariadb_cc_hh ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.cc - COMPILE_FLAGS "-p MYSQL -S ${CMAKE_CURRENT_SOURCE_DIR}/myskel.m4") + COMPILE_FLAGS "-p MYSQL -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4") BISON_TARGET(gen_oracle_cc_hh ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.cc - COMPILE_FLAGS "-p ORA -S ${CMAKE_CURRENT_SOURCE_DIR}/myskel.m4") + COMPILE_FLAGS "-p ORA -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4") ENDIF() IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR) diff --git a/sql/myskel.m4 b/sql/myskel.m4 deleted file mode 100644 index b26fe46d342..00000000000 --- a/sql/myskel.m4 +++ /dev/null @@ -1,18 +0,0 @@ -# -# fix the #line directives in the generated .cc files -# to refer to the original sql_yacc.yy -# -m4_define([yyfile],m4_bpatsubst(__file__,[[a-z.0-9]+$],sql_yacc.yy)) - -m4_define([b4_syncline], -[m4_if(m4_index([$2],[.yy]),[-1], -[b4_sync_start([$1], [$2])[]dnl - -],[b4_sync_start([$1], ["yyfile"])[]dnl - -])]) - -# try both paths for different bison versions -m4_sinclude(skeletons/c-skel.m4) -m4_sinclude(c-skel.m4) - diff --git a/sql/myskel.m4.in b/sql/myskel.m4.in new file mode 100644 index 00000000000..13a39f9675c --- /dev/null +++ b/sql/myskel.m4.in @@ -0,0 +1,13 @@ +# +# fix the #line directives in the generated .cc files +# to refer to the original sql_yacc.yy +# +m4_define([b4_syncline], +[b4_sync_start([$1], m4_bpatsubst([$2],[@CMAKE_CURRENT_BINARY_DIR@/yy_[a-z]+\.yy],@CMAKE_CURRENT_SOURCE_DIR@/sql_yacc.yy))[]dnl + +]) + +# try both paths for different bison versions +m4_sinclude(skeletons/c-skel.m4) +m4_sinclude(c-skel.m4) + -- cgit v1.2.1