Skip to content

Commit 115fec5

Browse files
committed
Fix generation of bison output for out-of-source builds.
Make sure the #line directives contain existing source file sql_yacc.yy. Before the patch #line directive would point out to non-existing path in current build directory.
1 parent 78084fa commit 115fec5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ sql/lex_token.h
197197
sql/gen_lex_token
198198
sql/gen_lex_hash
199199
sql/lex_hash.h
200+
sql/myskel.m4
200201
sql/mysql_tzinfo_to_sql
201202
sql/mysqld
202203
sql/sql_builtin.cc

sql/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,13 @@ IF (NOT BISON_FOUND)
356356
MESSAGE(FATAL_ERROR ${ERRMSG})
357357
ENDIF()
358358
ELSE()
359+
CONFIGURE_FILE(myskel.m4.in myskel.m4)
359360
BISON_TARGET(gen_mariadb_cc_hh ${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.yy
360361
${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.cc
361-
COMPILE_FLAGS "-p MYSQL -S ${CMAKE_CURRENT_SOURCE_DIR}/myskel.m4")
362+
COMPILE_FLAGS "-p MYSQL -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4")
362363
BISON_TARGET(gen_oracle_cc_hh ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.yy
363364
${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.cc
364-
COMPILE_FLAGS "-p ORA -S ${CMAKE_CURRENT_SOURCE_DIR}/myskel.m4")
365+
COMPILE_FLAGS "-p ORA -S ${CMAKE_CURRENT_BINARY_DIR}/myskel.m4")
365366
ENDIF()
366367

367368
IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR)

sql/myskel.m4 renamed to sql/myskel.m4.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# to refer to the original sql_yacc.yy
44
#
55
m4_define([b4_syncline],
6-
[b4_sync_start([$1], m4_bpatsubst([$2],[yy_[a-z]+\.yy],sql_yacc.yy))[]dnl
6+
[b4_sync_start([$1], m4_bpatsubst([$2],[@CMAKE_CURRENT_BINARY_DIR@/yy_[a-z]+\.yy],@CMAKE_CURRENT_SOURCE_DIR@/sql_yacc.yy))[]dnl
77

88
])
99

0 commit comments

Comments
 (0)