Skip to content

Commit f14edb9

Browse files
committed
Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows.
Visual Studio 2008 Express edition does not include message compiler mc.exe It is not possible to build MySQL server if only VC2008 Express is installed, because we use mc.exe to generate event log messages. This patch removes the mc.exe dependency. Generated files message.h, message.rc and MSG00001.bin are checked into source code repository. Instructions on how to add or change messages are added to messages.mc
1 parent 41f139b commit f14edb9

File tree

6 files changed

+70
-13
lines changed

6 files changed

+70
-13
lines changed

sql/CMakeLists.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
2828
${CMAKE_SOURCE_DIR}/bdb/build_win32
2929
${CMAKE_SOURCE_DIR}/bdb/dbinc)
3030

31-
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
32-
${CMAKE_SOURCE_DIR}/sql/message.h
33-
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
34-
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
31+
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
32+
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
3533
${CMAKE_SOURCE_DIR}/include/mysql_version.h
3634
${CMAKE_SOURCE_DIR}/sql/lex_hash.h
3735
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
@@ -120,13 +118,6 @@ ADD_CUSTOM_COMMAND(
120118
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
121119
)
122120

123-
# Windows message file
124-
ADD_CUSTOM_COMMAND(
125-
SOURCE ${PROJECT_SOURCE_DIR}/sql/message.mc
126-
OUTPUT message.rc message.h
127-
COMMAND mc ARGS ${PROJECT_SOURCE_DIR}/sql/message.mc
128-
DEPENDS ${PROJECT_SOURCE_DIR}/sql/message.mc)
129-
130121
# Gen_lex_hash
131122
# About "mysqlclient_notls", see note in "client/CMakeLists.txt"
132123
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
@@ -141,7 +132,7 @@ ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash)
141132

142133
# Remove the auto-generated files as part of 'Clean Solution'
143134
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
144-
"lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
135+
"lex_hash.h;sql_yacc.h;sql_yacc.cc")
145136

146137
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
147138
ADD_DEPENDENCIES(udf_example strings)

sql/MSG00001.bin

184 Bytes
Binary file not shown.

sql/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ DEFS = -DMYSQL_SERVER \
118118

119119
BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
120120
EXTRA_DIST = $(BUILT_SOURCES) nt_servc.cc nt_servc.h \
121-
message.mc examples/CMakeLists.txt CMakeLists.txt \
121+
message.mc message.h message.rc MSG00001.bin \
122+
examples/CMakeLists.txt CMakeLists.txt \
122123
udf_example.c udf_example.def
123124
DISTCLEANFILES = lex_hash.h sql_yacc.output
124125

sql/message.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
To change or add messages mysqld writes to the Windows error log, run
3+
mc.exe message.mc
4+
and checkin generated messages.h, messages.rc and msg000001.bin under the
5+
source control.
6+
mc.exe can be installed with Windows SDK, some Visual Studio distributions
7+
do not include it.
8+
*/
9+
//
10+
// Values are 32 bit values layed out as follows:
11+
//
12+
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
13+
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
14+
// +---+-+-+-----------------------+-------------------------------+
15+
// |Sev|C|R| Facility | Code |
16+
// +---+-+-+-----------------------+-------------------------------+
17+
//
18+
// where
19+
//
20+
// Sev - is the severity code
21+
//
22+
// 00 - Success
23+
// 01 - Informational
24+
// 10 - Warning
25+
// 11 - Error
26+
//
27+
// C - is the Customer code flag
28+
//
29+
// R - is a reserved bit
30+
//
31+
// Facility - is the facility code
32+
//
33+
// Code - is the facility's status code
34+
//
35+
//
36+
// Define the facility codes
37+
//
38+
39+
40+
//
41+
// Define the severity codes
42+
//
43+
44+
45+
//
46+
// MessageId: MSG_DEFAULT
47+
//
48+
// MessageText:
49+
//
50+
// %1For more information, see Help and Support Center at http://www.mysql.com.
51+
//
52+
//
53+
//
54+
#define MSG_DEFAULT 0xC0000064L
55+

sql/message.mc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
;/*
2+
; To change or add messages mysqld writes to the Windows error log, run
3+
; mc.exe message.mc
4+
; and checkin generated messages.h, messages.rc and msg000001.bin under the
5+
; source control.
6+
; mc.exe can be installed with Windows SDK, some Visual Studio distributions
7+
; do not include it.
8+
;*/
19
MessageId = 100
210
Severity = Error
311
Facility = Application

sql/message.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
LANGUAGE 0x9,0x1
2+
1 11 MSG00001.bin

0 commit comments

Comments
 (0)