Add "name of struct" as first arg to comp_sql
Fix "make distcheck" scripts/CMakeLists.txt: Add "name of struct" as first arg to comp_sql scripts/comp_sql.c: Add "name of struct" as first arg to comp_sql
This commit is contained in:
parent
09e6e6618f
commit
b44eee2a67
@ -22,6 +22,7 @@ GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION)
|
|||||||
|
|
||||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c
|
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c
|
||||||
COMMAND ${COMP_SQL_EXE}
|
COMMAND ${COMP_SQL_EXE}
|
||||||
|
mysql_fix_privilege_tables
|
||||||
mysql_fix_privilege_tables.sql
|
mysql_fix_privilege_tables.sql
|
||||||
mysql_fix_privilege_tables_sql.c
|
mysql_fix_privilege_tables_sql.c
|
||||||
DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql)
|
DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql)
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
|
|
||||||
## Process this file with automake to create Makefile.in
|
## Process this file with automake to create Makefile.in
|
||||||
|
|
||||||
|
BUILT_SOURCES = mysql_fix_privilege_tables.sql \
|
||||||
|
mysql_fix_privilege_tables_sql.c
|
||||||
|
|
||||||
|
noinst_PROGRAMS = comp_sql
|
||||||
|
|
||||||
bin_SCRIPTS = @server_scripts@ \
|
bin_SCRIPTS = @server_scripts@ \
|
||||||
msql2mysql \
|
msql2mysql \
|
||||||
mysql_config \
|
mysql_config \
|
||||||
@ -94,7 +99,8 @@ CLEANFILES = @server_scripts@ \
|
|||||||
mysql_upgrade_shell \
|
mysql_upgrade_shell \
|
||||||
mysqld_multi \
|
mysqld_multi \
|
||||||
make_win_src_distribution \
|
make_win_src_distribution \
|
||||||
mysql_fix_privilege_tables.sql
|
mysql_fix_privilege_tables.sql \
|
||||||
|
mysql_fix_privilege_tables_sql.c
|
||||||
|
|
||||||
# mysqlbug should be distributed built so that people can report build
|
# mysqlbug should be distributed built so that people can report build
|
||||||
# failures with it.
|
# failures with it.
|
||||||
@ -111,6 +117,17 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \
|
|||||||
@echo "Building $@";
|
@echo "Building $@";
|
||||||
@cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@
|
@cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build mysql_fix_privilege_tables_sql.c from
|
||||||
|
# mysql_fix_privileges_tables.sql using comp_sql
|
||||||
|
#
|
||||||
|
mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT)
|
||||||
|
$(top_builddir)/scripts/comp_sql$(EXEEXT) \
|
||||||
|
mysql_fix_privilege_tables \
|
||||||
|
$(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@
|
||||||
|
|
||||||
|
|
||||||
SUFFIXES = .sh
|
SUFFIXES = .sh
|
||||||
|
|
||||||
.sh:
|
.sh:
|
||||||
@ -167,18 +184,5 @@ SUFFIXES = .sh
|
|||||||
@MV@ $@-t $@
|
@MV@ $@-t $@
|
||||||
|
|
||||||
|
|
||||||
BUILT_SOURCES = mysql_fix_privilege_tables_sql.c
|
|
||||||
noinst_PROGRAMS = comp_sql
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build mysql_fix_privilege_tables_sql.c from
|
|
||||||
# mysql_fix_privileges_tables.sql using comp_sql
|
|
||||||
#
|
|
||||||
mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT)
|
|
||||||
$(top_builddir)/scripts/comp_sql$(EXEEXT) \
|
|
||||||
mysql_fix_privilege_tables.sql $@
|
|
||||||
|
|
||||||
|
|
||||||
# Don't update the files from bitkeeper
|
# Don't update the files from bitkeeper
|
||||||
%::SCCS/s.%
|
%::SCCS/s.%
|
||||||
|
@ -58,12 +58,12 @@ static void die(const char *fmt, ...)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char buff[512];
|
char buff[512];
|
||||||
char* infile_name= argv[1];
|
char* struct_name= argv[1];
|
||||||
char* outfile_name= argv[2];
|
char* infile_name= argv[2];
|
||||||
char* end= infile_name;
|
char* outfile_name= argv[3];
|
||||||
|
|
||||||
if (argc != 3)
|
if (argc != 4)
|
||||||
die("Usage: comp_sql <sql_filename> <c_filename>");
|
die("Usage: comp_sql <struct_name> <sql_filename> <c_filename>");
|
||||||
|
|
||||||
/* Open input and output file */
|
/* Open input and output file */
|
||||||
if (!(in= fopen(infile_name, "r")))
|
if (!(in= fopen(infile_name, "r")))
|
||||||
@ -71,10 +71,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!(out= fopen(outfile_name, "w")))
|
if (!(out= fopen(outfile_name, "w")))
|
||||||
die("Failed to open output file '%s'", outfile_name);
|
die("Failed to open output file '%s'", outfile_name);
|
||||||
|
|
||||||
while(*end && *end != '.')
|
fprintf(out, "const char* %s={\n\"", struct_name);
|
||||||
end++;
|
|
||||||
*end= 0;
|
|
||||||
fprintf(out, "const char* %s={\n\"", infile_name);
|
|
||||||
|
|
||||||
while (fgets(buff, sizeof(buff), in))
|
while (fgets(buff, sizeof(buff), in))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user