mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 02:30:06 +01:00
initial cmake fileset. It is not production ready but stable enough to start working with
This commit is contained in:
parent
729f819d42
commit
3eb9e1702c
23 changed files with 779 additions and 0 deletions
7
win/build-vs71.bat
Normal file
7
win/build-vs71.bat
Normal file
|
@ -0,0 +1,7 @@
|
|||
@echo off
|
||||
win32\cmakefiles\deploy
|
||||
del cmakecache.txt
|
||||
copy win32\vs71cache.txt cmakecache.txt
|
||||
cmake -G "Visual Studio 7 .NET 2003"
|
||||
copy cmakecache.txt win32\vs71cache.txt
|
||||
|
6
win/build-vs8.bat
Normal file
6
win/build-vs8.bat
Normal file
|
@ -0,0 +1,6 @@
|
|||
@echo off
|
||||
win32\cmakefiles\deploy
|
||||
del cmakecache.txt
|
||||
copy win32\vs8cache.txt cmakecache.txt
|
||||
cmake -G "Visual Studio 8 2005"
|
||||
copy cmakecache.txt win32\vs8cache.txt
|
13
win/cmakefiles/base
Normal file
13
win/cmakefiles/base
Normal file
|
@ -0,0 +1,13 @@
|
|||
PROJECT(MySql)
|
||||
|
||||
EXEC_PROGRAM(cscript.exe win32 ARGS config-version.js OUT_VARIABLE out)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 -D_DEBUG")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 -D_DEBUG")
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 -DDBUG_OFF -DNDEBUG")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 -DDBUG_OFF -DNDEBUG")
|
||||
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__")
|
||||
|
||||
SUBDIRS(vio dbug strings regex mysys zlib storage/innobase storage/heap storage/myisam storage/myisammrg
|
||||
extra extra/yassl extra/yassl/taocrypt client sql)
|
8
win/cmakefiles/bdb
Normal file
8
win/cmakefiles/bdb
Normal file
|
@ -0,0 +1,8 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
|
||||
ADD_LIBRARY(bdb _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
|
||||
hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
|
||||
hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
|
||||
hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
|
45
win/cmakefiles/client
Normal file
45
win/cmakefiles/client
Normal file
|
@ -0,0 +1,45 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_CLIENT)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/extra/yassl/include ${CMAKE_SOURCE_DIR}/libmysql)
|
||||
ADD_LIBRARY(mysqlclient ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
|
||||
../strings/bmove_upp.c ../mysys/charset-def.c ../mysys/charset.c
|
||||
../sql-common/client.c ../strings/ctype-big5.c ../strings/ctype-bin.c
|
||||
../strings/ctype-cp932.c ../strings/ctype-czech.c ../strings/ctype-euc_kr.c
|
||||
../strings/ctype-eucjpms.c ../strings/ctype-extra.c ../strings/ctype-gb2312.c
|
||||
../strings/ctype-gbk.c ../strings/ctype-latin1.c ../strings/ctype-mb.c
|
||||
../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c
|
||||
../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c
|
||||
../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c
|
||||
../mysys/default.c ../libmysql/errmsg.c ../mysys/errors.c
|
||||
../libmysql/get_password.c ../strings/int2str.c ../strings/is_prefix.c
|
||||
../libmysql/libmysql.c ../mysys/list.c ../strings/llstr.c
|
||||
../strings/longlong2str.c ../libmysql/manager.c ../mysys/mf_cache.c
|
||||
../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c
|
||||
../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c
|
||||
../mysys/mf_pack.c ../mysys/mf_path.c ../mysys/mf_tempfile.c ../mysys/mf_unixpath.c
|
||||
../mysys/mf_wcomp.c ../mysys/mulalloc.c ../mysys/my_access.c ../mysys/my_alloc.c
|
||||
../mysys/my_chsize.c ../mysys/my_compress.c ../mysys/my_create.c
|
||||
../mysys/my_delete.c ../mysys/my_div.c ../mysys/my_error.c ../mysys/my_file.c
|
||||
../mysys/my_fopen.c ../mysys/my_fstream.c ../mysys/my_gethostbyname.c
|
||||
../mysys/my_getopt.c ../mysys/my_getwd.c ../mysys/my_init.c ../mysys/my_lib.c
|
||||
../mysys/my_malloc.c ../mysys/my_messnc.c ../mysys/my_net.c ../mysys/my_once.c
|
||||
../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c
|
||||
../mysys/my_realloc.c ../mysys/my_rename.c ../mysys/my_seek.c
|
||||
../mysys/my_static.c ../strings/my_strtoll10.c ../mysys/my_symlink.c
|
||||
../mysys/my_symlink2.c ../mysys/my_thr_init.c ../sql-common/my_time.c
|
||||
../strings/my_vsnprintf.c ../mysys/my_wincond.c ../mysys/my_winthread.c
|
||||
../mysys/my_write.c ../sql/net_serv.cc ../sql-common/pack.c ../sql/password.c
|
||||
../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c
|
||||
../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.c
|
||||
../strings/strfill.c ../mysys/string.c ../strings/strinstr.c ../strings/strmake.c
|
||||
../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c
|
||||
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
|
||||
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
|
||||
../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c
|
||||
${CMAKE_SOURCE_DIR}/include/mysql_version.h)
|
||||
|
||||
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc)
|
||||
LINK_DIRECTORIES(${MYSQL_BINARY_DIR}/mysys ${MYSQL_BINARY_DIR}/zlib)
|
||||
TARGET_LINK_LIBRARIES(mysql mysqlclient mysys yassl zlib dbug yassl taocrypt wsock32)
|
5
win/cmakefiles/dbug
Normal file
5
win/cmakefiles/dbug
Normal file
|
@ -0,0 +1,5 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX -D__WIN32__")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(dbug dbug.c factorial.c sanity.c)
|
19
win/cmakefiles/deploy.bat
Normal file
19
win/cmakefiles/deploy.bat
Normal file
|
@ -0,0 +1,19 @@
|
|||
@echo off
|
||||
copy base ..\..\cmakelists.txt
|
||||
copy client ..\..\client\cmakelists.txt
|
||||
copy dbug ..\..\dbug\cmakelists.txt
|
||||
copy extra ..\..\extra\cmakelists.txt
|
||||
copy mysys ..\..\mysys\cmakelists.txt
|
||||
copy regex ..\..\regex\cmakelists.txt
|
||||
copy sql ..\..\sql\cmakelists.txt
|
||||
copy strings ..\..\strings\cmakelists.txt
|
||||
copy vio ..\..\vio\cmakelists.txt
|
||||
copy zlib ..\..\zlib\cmakelists.txt
|
||||
copy yassl ..\..\extra\yassl\cmakelists.txt
|
||||
copy taocrypt ..\..\extra\yassl\taocrypt\cmakelists.txt
|
||||
copy bdb ..\..\storage\bdb\cmakelists.txt
|
||||
copy heap ..\..\storage\heap\cmakelists.txt
|
||||
copy innobase ..\..\storage\innobase\cmakelists.txt
|
||||
copy myisam ..\..\storage\myisam\cmakelists.txt
|
||||
copy myisammrg ..\..\storage\myisammrg\cmakelists.txt
|
||||
|
9
win/cmakefiles/extra
Normal file
9
win/cmakefiles/extra
Normal file
|
@ -0,0 +1,9 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
|
||||
ADD_EXECUTABLE(comp_err comp_err.c)
|
||||
TARGET_LINK_LIBRARIES(comp_err dbug mysys strings wsock32)
|
||||
|
||||
|
8
win/cmakefiles/heap
Normal file
8
win/cmakefiles/heap
Normal file
|
@ -0,0 +1,8 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(heap _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
|
||||
hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
|
||||
hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
|
||||
hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
|
41
win/cmakefiles/innobase
Normal file
41
win/cmakefiles/innobase
Normal file
|
@ -0,0 +1,41 @@
|
|||
#SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
#SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include include)
|
||||
SET_SOURCE_FILES_PROPERTIES(ib_config.h PROPERTIES GENERATED 1)
|
||||
ADD_LIBRARY(innobase ib_config.h btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
|
||||
buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
|
||||
data/data0data.c data/data0type.c
|
||||
dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
|
||||
dyn/dyn0dyn.c
|
||||
eval/eval0eval.c eval/eval0proc.c
|
||||
fil/fil0fil.c
|
||||
fsp/fsp0fsp.c
|
||||
fut/fut0fut.c fut/fut0lst.c
|
||||
ha/ha0ha.c ha/hash0hash.c
|
||||
ibuf/ibuf0ibuf.c
|
||||
pars/lexyy.c pars/pars0grm.c pars/pars0opt.c pars/pars0pars.c pars/pars0sym.c
|
||||
lock/lock0lock.c
|
||||
log/log0log.c log/log0recv.c
|
||||
mach/mach0data.c
|
||||
mem/mem0mem.c mem/mem0pool.c
|
||||
mtr/mtr0log.c mtr/mtr0mtr.c
|
||||
os/os0file.c os/os0proc.c os/os0sync.c os/os0thread.c
|
||||
page/page0cur.c page/page0page.c
|
||||
que/que0que.c
|
||||
read/read0read.c
|
||||
rem/rem0cmp.c rem/rem0rec.c
|
||||
row/row0ins.c row/row0mysql.c row/row0purge.c row/row0row.c row/row0sel.c row/row0uins.c
|
||||
row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c
|
||||
srv/srv0que.c srv/srv0srv.c srv/srv0start.c
|
||||
sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c
|
||||
thr/thr0loc.c
|
||||
trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
|
||||
usr/usr0sess.c
|
||||
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ib_config.h
|
||||
COMMAND echo /*Generated file*/ > ib_config.h
|
||||
)
|
14
win/cmakefiles/myisam
Normal file
14
win/cmakefiles/myisam
Normal file
|
@ -0,0 +1,14 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
|
||||
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
|
||||
mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c
|
||||
mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c
|
||||
mi_key.c mi_keycache.c mi_locking.c mi_log.c mi_open.c
|
||||
mi_packrec.c mi_page.c mi_panic.c mi_preload.c mi_range.c mi_rename.c
|
||||
mi_rfirst.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c
|
||||
mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c
|
||||
mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
|
||||
rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c)
|
9
win/cmakefiles/myisammrg
Normal file
9
win/cmakefiles/myisammrg
Normal file
|
@ -0,0 +1,9 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(myisammrg myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
|
||||
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
|
||||
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
|
||||
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
|
||||
myrg_write.c)
|
21
win/cmakefiles/mysys
Normal file
21
win/cmakefiles/mysys
Normal file
|
@ -0,0 +1,21 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c
|
||||
errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c
|
||||
mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c
|
||||
mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c
|
||||
mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_strip.c mf_tempdir.c
|
||||
mf_tempfile.c mf_unixpath.c mf_wcomp.c mf_wfile.c mulalloc.c my_access.c
|
||||
my_aes.c my_alarm.c my_alloc.c my_append.c my_bit.c my_bitmap.c my_chsize.c
|
||||
my_clock.c my_compress.c my_conio.c my_copy.c my_crc32.c my_create.c my_delete.c
|
||||
my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethostbyname.c
|
||||
my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c
|
||||
my_lib.c my_lock.c my_lockmem.c my_lread.c my_lwrite.c my_malloc.c my_messnc.c
|
||||
my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c
|
||||
my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c
|
||||
my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c
|
||||
my_windac.c my_winsem.c my_winthread.c my_write.c ptr_cmp.c queues.c raid.cc
|
||||
rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
|
||||
thr_rwlock.c tree.c typelib.c my_vle.c base64.c)
|
8
win/cmakefiles/regex
Normal file
8
win/cmakefiles/regex
Normal file
|
@ -0,0 +1,8 @@
|
|||
SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-DDBUG_OFF -DNDEBUG")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-DDBUG_OFF -DNDEBUG")
|
||||
|
||||
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(regex debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
|
118
win/cmakefiles/sql
Normal file
118
win/cmakefiles/sql
Normal file
|
@ -0,0 +1,118 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/zlib)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
|
||||
${CMAKE_SOURCE_DIR}/sql/message.h
|
||||
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
|
||||
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
|
||||
${CMAKE_SOURCE_DIR}/include/mysqld_error.h
|
||||
${CMAKE_SOURCE_DIR}/include/mysqld_ername.h
|
||||
${CMAKE_SOURCE_DIR}/include/sql_state.h
|
||||
${CMAKE_SOURCE_DIR}/include/mysql_version.h
|
||||
${CMAKE_SOURCE_DIR}/sql/handlerton.cc
|
||||
${CMAKE_SOURCE_DIR}/sql/lex_hash.h PROPERTIES GENERATED 1)
|
||||
ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE -DHAVE_ARCHIVE_DB -DHAVE_BLACKHOLE_DB -DHAVE_EXAMPLE_DB)
|
||||
ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DHAVE_FEDERATED_DB -DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN -DWITH_PARTITION_STORAGE_ENGINE -D_CRT_SECURE_NO_DEPRECATE)
|
||||
|
||||
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc
|
||||
field_conv.cc filesort.cc gstream.cc ha_blackhole.cc
|
||||
ha_federated.cc ha_heap.cc ha_innodb.cc ha_myisam.cc ha_myisammrg.cc
|
||||
ha_partition.cc handler.cc hash_filo.cc hash_filo.h hostname.cc
|
||||
init.cc item.cc item_buff.cc item_cmpfunc.cc item_create.cc item_func.cc item_geofunc.cc
|
||||
item_row.cc item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc item_uniq.cc
|
||||
key.cc log.cc lock.cc log_event.cc message.rc message.h mf_iocache.cc
|
||||
my_decimal.cc ../sql-common/my_time.c
|
||||
../storage/myisammrg/myrg_rnext_same.c mysqld.cc net_serv.cc nt_servc.cc nt_servc.h opt_range.cc opt_range.h
|
||||
opt_sum.cc ../sql-common/pack.c parse_file.cc password.c procedure.cc protocol.cc records.cc
|
||||
repl_failsafe.cc rpl_filter.cc set_var.cc slave.cc sp.cc sp_cache.cc sp_head.cc
|
||||
sp_pcontext.cc sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc sql_cache.cc
|
||||
sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h sql_cursor.cc sql_db.cc sql_delete.cc
|
||||
sql_derived.cc sql_do.cc sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc
|
||||
sql_lex.cc sql_list.cc sql_load.cc sql_manager.cc sql_map.cc sql_parse.cc sql_partition.cc
|
||||
sql_plugin.cc sql_prepare.cc sql_rename.cc sql_repl.cc sql_select.cc sql_show.cc
|
||||
sql_state.c sql_string.cc sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
|
||||
sql_update.cc sql_view.cc sql_yacc.h sql_yacc.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc
|
||||
uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc
|
||||
event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c
|
||||
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
|
||||
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
|
||||
${CMAKE_SOURCE_DIR}/include/mysqld_error.h
|
||||
${CMAKE_SOURCE_DIR}/include/mysqld_ername.h
|
||||
${CMAKE_SOURCE_DIR}/include/sql_state.h
|
||||
${CMAKE_SOURCE_DIR}/include/mysql_version.h
|
||||
${CMAKE_SOURCE_DIR}/sql/handlerton.cc
|
||||
${CMAKE_SOURCE_DIR}/sql/lex_hash.h)
|
||||
TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg innobase mysys yassl zlib dbug yassl taocrypt strings vio regex wsock32)
|
||||
|
||||
# Sql Parser custom command
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE ${CMAKE_SOURCE_DIR}/sql/sql_yacc.yy
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
|
||||
COMMAND bison.exe ARGS --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/sql/sql_yacc.yy)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
|
||||
COMMAND echo
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
|
||||
)
|
||||
|
||||
# Windows message file
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE ../VC++Files/sql/message.mc
|
||||
OUTPUT message.rc message.h
|
||||
COMMAND mc ARGS ../VC++Files/sql/message.mc
|
||||
DEPENDS ../VC++Files/sql/message.mc)
|
||||
|
||||
# MySql_version.h.
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE ${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/include/mysql_version.h
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/win32/config-version.js
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/include/mysql_version.h.in)
|
||||
|
||||
# Handlerton file
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE ${CMAKE_SOURCE_DIR}/sql/handlerton.cc.in
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/sql/handlerton.cc
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/win32/config-handlerton.js ARGS ${CMAKE_SOURCE_DIR}/win32/configure.data
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/sql/handlerton.cc.in)
|
||||
|
||||
# Error file
|
||||
GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE ${CMAKE_SOURCE_DIR}/sql/share/errmsg.txt
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/include/mysqld_error.h
|
||||
COMMAND ${COMP_ERR_EXE}
|
||||
ARGS --charset=${CMAKE_SOURCE_DIR}/sql/share/charsets
|
||||
--out-dir=${CMAKE_SOURCE_DIR}/sql/share/
|
||||
--header_file=${CMAKE_SOURCE_DIR}/include/mysqld_error.h
|
||||
--name_file=${CMAKE_SOURCE_DIR}/include/mysqld_ername.h
|
||||
--state_file=${CMAKE_SOURCE_DIR}/include/sql_state.h
|
||||
--in_file=${CMAKE_SOURCE_DIR}/sql/share/errmsg.txt
|
||||
DEPENDS ${COMP_ERR_EXE} share/errmsg.txt)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/include/mysqld_ername.h
|
||||
COMMAND echo
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/include/mysqld_error.h
|
||||
)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/include/sql_state.h
|
||||
COMMAND echo
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/include/mysqld_ername.h
|
||||
)
|
||||
|
||||
|
||||
# Gen_lex_hash
|
||||
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
|
||||
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
|
||||
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/sql/lex_hash.h
|
||||
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
|
||||
DEPENDS ${GEN_LEX_HASH_EXE}
|
||||
)
|
12
win/cmakefiles/strings
Normal file
12
win/cmakefiles/strings
Normal file
|
@ -0,0 +1,12 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(strings bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
|
||||
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
|
||||
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
|
||||
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c
|
||||
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c
|
||||
str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
|
||||
strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c my_strchr.c)
|
9
win/cmakefiles/taocrypt
Normal file
9
win/cmakefiles/taocrypt
Normal file
|
@ -0,0 +1,9 @@
|
|||
INCLUDE_DIRECTORIES(../mySTL include)
|
||||
ADD_LIBRARY(taocrypt src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp
|
||||
src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp
|
||||
src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp
|
||||
include/aes.hpp include/algebra.hpp include/arc4.hpp include/asn.hpp include/block.hpp
|
||||
include/coding.hpp include/des.hpp include/dh.hpp include/dsa.hpp include/dsa.hpp
|
||||
include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp
|
||||
include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
|
||||
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
|
9
win/cmakefiles/vio
Normal file
9
win/cmakefiles/vio
Normal file
|
@ -0,0 +1,9 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-DDBUG_OFF -DNDEBUG")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-DDBUG_OFF -DNDEBUG")
|
||||
|
||||
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
|
||||
ADD_LIBRARY(vio vio.c viosocket.c viossl.c viosslfactories.c)
|
6
win/cmakefiles/yassl
Normal file
6
win/cmakefiles/yassl
Normal file
|
@ -0,0 +1,6 @@
|
|||
ADD_DEFINITIONS("-DWIN32 -D_LIB")
|
||||
|
||||
INCLUDE_DIRECTORIES(include taocrypt/include mySTL)
|
||||
ADD_LIBRARY(yassl src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
|
||||
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
|
||||
src/yassl_imp.cpp src/yassl_int.cpp)
|
11
win/cmakefiles/zlib
Normal file
11
win/cmakefiles/zlib
Normal file
|
@ -0,0 +1,11 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG __WIN32__")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG __WIN32__")
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-DDBUG_OFF -DNDEBUG")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-DDBUG_OFF -DNDEBUG")
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_CLIENT -D_WINDOWS -D__WIN__)
|
||||
ADD_LIBRARY(zlib adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio.c infback.c inffast.c inffast.h
|
||||
inffixed.h inflate.c inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h zlib.h
|
||||
zutil.c zutil.h)
|
||||
|
171
win/config-handlerton.js
Normal file
171
win/config-handlerton.js
Normal file
|
@ -0,0 +1,171 @@
|
|||
// Configure.js
|
||||
|
||||
ForReading = 1;
|
||||
ForWriting = 2;
|
||||
ForAppending = 8;
|
||||
|
||||
try
|
||||
{
|
||||
// first we attempt to open the main configure.in file
|
||||
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
var args = WScript.Arguments
|
||||
|
||||
var datafile = fso.OpenTextFile(args.Item(0), ForReading);
|
||||
var extern_line = '';
|
||||
var address_line = '';
|
||||
while (! datafile.AtEndOfStream)
|
||||
{
|
||||
var line = datafile.ReadLine();
|
||||
if (line == "WITH_INNODB")
|
||||
{
|
||||
extern_line += ",innobase_hton";
|
||||
address_line += ",&innobase_hton";
|
||||
}
|
||||
else if (line == "WITH_PARTITION")
|
||||
{
|
||||
extern_line += ",partition_hton";
|
||||
address_line += ",&partition_hton";
|
||||
}
|
||||
}
|
||||
datafile.Close();
|
||||
|
||||
var infile = fso.OpenTextFile("..\\sql\\handlerton.cc.in", ForReading);
|
||||
var infile_contents = infile.ReadAll();
|
||||
infile.Close();
|
||||
infile_contents = infile_contents.replace("@mysql_se_decls@", extern_line);
|
||||
infile_contents = infile_contents.replace("@mysql_se_htons@", address_line);
|
||||
|
||||
var outfile = fso.CreateTextFile("..\\sql\\handlerton.cc", true)
|
||||
outfile.Write(infile_contents);
|
||||
outfile.Close();
|
||||
|
||||
fso = null;
|
||||
|
||||
WScript.Echo("done!");
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
WScript.Echo("Error: " + e.description);
|
||||
}
|
||||
|
||||
function ConfigureBDB()
|
||||
{
|
||||
// read in the Unix configure.in file
|
||||
var dbIncTS = fso.OpenTextFile("..\\bdb\\dbinc\\db.in", ForReading);
|
||||
var dbIn = dbIncTS.ReadAll();
|
||||
dbIncTS.Close();
|
||||
|
||||
dbIn = dbIn.replace("@DB_VERSION_MAJOR@", "$DB_VERSION_MAJOR");
|
||||
dbIn = dbIn.replace("@DB_VERSION_MINOR@", "$DB_VERSION_MINOR");
|
||||
dbIn = dbIn.replace("@DB_VERSION_PATCH@", "$DB_VERSION_PATCH");
|
||||
dbIn = dbIn.replace("@DB_VERSION_STRING@", "$DB_VERSION_STRING");
|
||||
|
||||
dbIn = dbIn.replace("@u_int8_decl@", "typedef unsigned char u_int8_t;");
|
||||
dbIn = dbIn.replace("@int16_decl@", "typedef short int16_t;");
|
||||
dbIn = dbIn.replace("@u_int16_decl@", "typedef unsigned short u_int16_t;");
|
||||
dbIn = dbIn.replace("@int32_decl@", "typedef int int32_t;");
|
||||
dbIn = dbIn.replace("@u_int32_decl@", "typedef unsigned int u_int32_t;");
|
||||
|
||||
dbIn = dbIn.replace("@u_char_decl@", "{\r\n#if !defined(_WINSOCKAPI_)\r\n" +
|
||||
"typedef unsigned char u_char;");
|
||||
dbIn = dbIn.replace("@u_short_decl@", "typedef unsigned short u_short;");
|
||||
dbIn = dbIn.replace("@u_int_decl@", "typedef unsigned int u_int;");
|
||||
dbIn = dbIn.replace("@u_long_decl@", "typedef unsigned long u_long;");
|
||||
|
||||
dbIn = dbIn.replace("@ssize_t_decl@", "#endif\r\n#if defined(_WIN64)\r\n" +
|
||||
"typedef __int64 ssize_t;\r\n#else\r\n" +
|
||||
"typedef int ssize_t;\r\n#endif");
|
||||
}
|
||||
|
||||
function ConfigureMySqlVersion()
|
||||
{
|
||||
// read in the Unix configure.in file
|
||||
var configureInTS = fso.OpenTextFile("..\\configure.in", ForReading);
|
||||
var configureIn = configureInTS.ReadAll();
|
||||
configureInTS.Close();
|
||||
|
||||
// read in the mysql_version.h.in file
|
||||
var mysqlTS = fso.OpenTextFile("..\\include\\mysql_version.h.in", ForReading);
|
||||
var mysqlin = mysqlTS.ReadAll();
|
||||
mysqlTS.Close();
|
||||
|
||||
mysqlin = mysqlin.replace("@PROTOCOL_VERSION@", GetValue(configureIn, "PROTOCOL_VERSION"));
|
||||
mysqlin = mysqlin.replace("@DOT_FRM_VERSION@", GetValue(configureIn, "DOT_FRM_VERSION"));
|
||||
mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"));
|
||||
mysqlin = mysqlin.replace("@MYSQL_UNIX_ADDR@", GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT"));
|
||||
mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", '');
|
||||
mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution');
|
||||
|
||||
|
||||
var version = GetVersion(configureIn);
|
||||
mysqlin = mysqlin.replace("@VERSION@", version);
|
||||
mysqlin = mysqlin.replace("@MYSQL_BASE_VERSION@", GetBaseVersion(version));
|
||||
mysqlin = mysqlin.replace("@MYSQL_VERSION_ID@", GetVersionId(version));
|
||||
|
||||
|
||||
var mysqlfile = fso.CreateTextFile("..\\include\\mysql_version.h", true);
|
||||
mysqlfile.Write(mysqlin);
|
||||
mysqlfile.Close();
|
||||
|
||||
}
|
||||
|
||||
function GetValue(str, key)
|
||||
{
|
||||
var pos = str.indexOf(key+'=');
|
||||
if (pos == -1) return null;
|
||||
pos += key.length + 1;
|
||||
var end = str.indexOf("\n", pos);
|
||||
if (str.charAt(pos) == "\"")
|
||||
pos++;
|
||||
if (str.charAt(end-1) == "\"")
|
||||
end--;
|
||||
return str.substring(pos, end);
|
||||
}
|
||||
|
||||
function GetVersion(str)
|
||||
{
|
||||
var key = "AM_INIT_AUTOMAKE(mysql, ";
|
||||
var pos = str.indexOf(key); //5.0.6-beta)
|
||||
if (pos == -1) return null;
|
||||
pos += key.length;
|
||||
var end = str.indexOf(")", pos);
|
||||
if (end == -1) return null;
|
||||
return str.substring(pos, end);
|
||||
}
|
||||
|
||||
function GetBaseVersion(version)
|
||||
{
|
||||
var dot = version.indexOf(".");
|
||||
if (dot == -1) return null;
|
||||
dot = version.indexOf(".", dot+1);
|
||||
if (dot == -1) dot = version.length;
|
||||
return version.substring(0, dot);
|
||||
}
|
||||
|
||||
function GetVersionId(version)
|
||||
{
|
||||
var dot = version.indexOf(".");
|
||||
if (dot == -1) return null;
|
||||
var major = parseInt(version.substring(0, dot), 10);
|
||||
|
||||
dot++;
|
||||
var nextdot = version.indexOf(".", dot);
|
||||
if (nextdot == -1) return null;
|
||||
var minor = parseInt(version.substring(dot, nextdot), 10);
|
||||
dot = nextdot+1;
|
||||
|
||||
var stop = version.indexOf("-", dot);
|
||||
if (stop == -1) stop = version.length;
|
||||
var build = parseInt(version.substring(dot, stop), 10);
|
||||
|
||||
var id = major;
|
||||
if (minor < 10)
|
||||
id += '0';
|
||||
id += minor;
|
||||
if (build < 10)
|
||||
id += '0';
|
||||
id += build;
|
||||
return id;
|
||||
}
|
||||
|
142
win/config-version.js
Normal file
142
win/config-version.js
Normal file
|
@ -0,0 +1,142 @@
|
|||
// Configure.js
|
||||
|
||||
ForReading = 1;
|
||||
ForWriting = 2;
|
||||
ForAppending = 8;
|
||||
|
||||
try
|
||||
{
|
||||
// first we attempt to open the main configure.in file
|
||||
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
ConfigureMySqlVersion();
|
||||
//ConfigureBDB();
|
||||
fso = null;
|
||||
|
||||
WScript.Echo("done!");
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
WScript.Echo("Error: " + e.description);
|
||||
}
|
||||
|
||||
function ConfigureBDB()
|
||||
{
|
||||
// read in the Unix configure.in file
|
||||
var dbIncTS = fso.OpenTextFile("..\\bdb\\dbinc\\db.in", ForReading);
|
||||
var dbIn = dbIncTS.ReadAll();
|
||||
dbIncTS.Close();
|
||||
|
||||
dbIn = dbIn.replace("@DB_VERSION_MAJOR@", "$DB_VERSION_MAJOR");
|
||||
dbIn = dbIn.replace("@DB_VERSION_MINOR@", "$DB_VERSION_MINOR");
|
||||
dbIn = dbIn.replace("@DB_VERSION_PATCH@", "$DB_VERSION_PATCH");
|
||||
dbIn = dbIn.replace("@DB_VERSION_STRING@", "$DB_VERSION_STRING");
|
||||
|
||||
dbIn = dbIn.replace("@u_int8_decl@", "typedef unsigned char u_int8_t;");
|
||||
dbIn = dbIn.replace("@int16_decl@", "typedef short int16_t;");
|
||||
dbIn = dbIn.replace("@u_int16_decl@", "typedef unsigned short u_int16_t;");
|
||||
dbIn = dbIn.replace("@int32_decl@", "typedef int int32_t;");
|
||||
dbIn = dbIn.replace("@u_int32_decl@", "typedef unsigned int u_int32_t;");
|
||||
|
||||
dbIn = dbIn.replace("@u_char_decl@", "{\r\n#if !defined(_WINSOCKAPI_)\r\n" +
|
||||
"typedef unsigned char u_char;");
|
||||
dbIn = dbIn.replace("@u_short_decl@", "typedef unsigned short u_short;");
|
||||
dbIn = dbIn.replace("@u_int_decl@", "typedef unsigned int u_int;");
|
||||
dbIn = dbIn.replace("@u_long_decl@", "typedef unsigned long u_long;");
|
||||
|
||||
dbIn = dbIn.replace("@ssize_t_decl@", "#endif\r\n#if defined(_WIN64)\r\n" +
|
||||
"typedef __int64 ssize_t;\r\n#else\r\n" +
|
||||
"typedef int ssize_t;\r\n#endif");
|
||||
}
|
||||
|
||||
function ConfigureMySqlVersion()
|
||||
{
|
||||
// read in the Unix configure.in file
|
||||
var configureInTS = fso.OpenTextFile("..\\configure.in", ForReading);
|
||||
var configureIn = configureInTS.ReadAll();
|
||||
configureInTS.Close();
|
||||
|
||||
// read in the mysql_version.h.in file
|
||||
var mysqlTS = fso.OpenTextFile("..\\include\\mysql_version.h.in", ForReading);
|
||||
var mysqlin = mysqlTS.ReadAll();
|
||||
mysqlTS.Close();
|
||||
|
||||
mysqlin = mysqlin.replace("@PROTOCOL_VERSION@", GetValue(configureIn, "PROTOCOL_VERSION"));
|
||||
mysqlin = mysqlin.replace("@DOT_FRM_VERSION@", GetValue(configureIn, "DOT_FRM_VERSION"));
|
||||
mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"));
|
||||
mysqlin = mysqlin.replace("@MYSQL_UNIX_ADDR@", GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT"));
|
||||
mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", '');
|
||||
mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution');
|
||||
|
||||
|
||||
var version = GetVersion(configureIn);
|
||||
mysqlin = mysqlin.replace("@VERSION@", version);
|
||||
mysqlin = mysqlin.replace("@MYSQL_BASE_VERSION@", GetBaseVersion(version));
|
||||
mysqlin = mysqlin.replace("@MYSQL_VERSION_ID@", GetVersionId(version));
|
||||
|
||||
|
||||
var mysqlfile = fso.CreateTextFile("..\\include\\mysql_version.h", true);
|
||||
mysqlfile.Write(mysqlin);
|
||||
mysqlfile.Close();
|
||||
|
||||
}
|
||||
|
||||
function GetValue(str, key)
|
||||
{
|
||||
var pos = str.indexOf(key+'=');
|
||||
if (pos == -1) return null;
|
||||
pos += key.length + 1;
|
||||
var end = str.indexOf("\n", pos);
|
||||
if (str.charAt(pos) == "\"")
|
||||
pos++;
|
||||
if (str.charAt(end-1) == "\"")
|
||||
end--;
|
||||
return str.substring(pos, end);
|
||||
}
|
||||
|
||||
function GetVersion(str)
|
||||
{
|
||||
var key = "AM_INIT_AUTOMAKE(mysql, ";
|
||||
var pos = str.indexOf(key); //5.0.6-beta)
|
||||
if (pos == -1) return null;
|
||||
pos += key.length;
|
||||
var end = str.indexOf(")", pos);
|
||||
if (end == -1) return null;
|
||||
return str.substring(pos, end);
|
||||
}
|
||||
|
||||
function GetBaseVersion(version)
|
||||
{
|
||||
var dot = version.indexOf(".");
|
||||
if (dot == -1) return null;
|
||||
dot = version.indexOf(".", dot+1);
|
||||
if (dot == -1) dot = version.length;
|
||||
return version.substring(0, dot);
|
||||
}
|
||||
|
||||
function GetVersionId(version)
|
||||
{
|
||||
var dot = version.indexOf(".");
|
||||
if (dot == -1) return null;
|
||||
var major = parseInt(version.substring(0, dot), 10);
|
||||
|
||||
dot++;
|
||||
var nextdot = version.indexOf(".", dot);
|
||||
if (nextdot == -1) return null;
|
||||
var minor = parseInt(version.substring(dot, nextdot), 10);
|
||||
dot = nextdot+1;
|
||||
|
||||
var stop = version.indexOf("-", dot);
|
||||
if (stop == -1) stop = version.length;
|
||||
var build = parseInt(version.substring(dot, stop), 10);
|
||||
|
||||
var id = major;
|
||||
if (minor < 10)
|
||||
id += '0';
|
||||
id += minor;
|
||||
if (build < 10)
|
||||
id += '0';
|
||||
id += build;
|
||||
return id;
|
||||
}
|
||||
|
88
win/configure.js
Normal file
88
win/configure.js
Normal file
|
@ -0,0 +1,88 @@
|
|||
// Configure.js
|
||||
|
||||
ForReading = 1;
|
||||
ForWriting = 2;
|
||||
ForAppending = 8;
|
||||
|
||||
try
|
||||
{
|
||||
// first we attempt to open the main configure.in file
|
||||
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
var args = WScript.Arguments
|
||||
|
||||
var configfile = fso.CreateTextFile("configure.data", true);
|
||||
for (i=0; i < args.Count(); i++)
|
||||
{
|
||||
configfile.WriteLine(args.Item(i));
|
||||
}
|
||||
configfile.Close();
|
||||
|
||||
fso = null;
|
||||
|
||||
WScript.Echo("done!");
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
WScript.Echo("Error: " + e.description);
|
||||
}
|
||||
|
||||
function GetValue(str, key)
|
||||
{
|
||||
var pos = str.indexOf(key+'=');
|
||||
if (pos == -1) return null;
|
||||
pos += key.length + 1;
|
||||
var end = str.indexOf("\n", pos);
|
||||
if (str.charAt(pos) == "\"")
|
||||
pos++;
|
||||
if (str.charAt(end-1) == "\"")
|
||||
end--;
|
||||
return str.substring(pos, end);
|
||||
}
|
||||
|
||||
function GetVersion(str)
|
||||
{
|
||||
var key = "AM_INIT_AUTOMAKE(mysql, ";
|
||||
var pos = str.indexOf(key); //5.0.6-beta)
|
||||
if (pos == -1) return null;
|
||||
pos += key.length;
|
||||
var end = str.indexOf(")", pos);
|
||||
if (end == -1) return null;
|
||||
return str.substring(pos, end);
|
||||
}
|
||||
|
||||
function GetBaseVersion(version)
|
||||
{
|
||||
var dot = version.indexOf(".");
|
||||
if (dot == -1) return null;
|
||||
dot = version.indexOf(".", dot+1);
|
||||
if (dot == -1) dot = version.length;
|
||||
return version.substring(0, dot);
|
||||
}
|
||||
|
||||
function GetVersionId(version)
|
||||
{
|
||||
var dot = version.indexOf(".");
|
||||
if (dot == -1) return null;
|
||||
var major = parseInt(version.substring(0, dot), 10);
|
||||
|
||||
dot++;
|
||||
var nextdot = version.indexOf(".", dot);
|
||||
if (nextdot == -1) return null;
|
||||
var minor = parseInt(version.substring(dot, nextdot), 10);
|
||||
dot = nextdot+1;
|
||||
|
||||
var stop = version.indexOf("-", dot);
|
||||
if (stop == -1) stop = version.length;
|
||||
var build = parseInt(version.substring(dot, stop), 10);
|
||||
|
||||
var id = major;
|
||||
if (minor < 10)
|
||||
id += '0';
|
||||
id += minor;
|
||||
if (build < 10)
|
||||
id += '0';
|
||||
id += build;
|
||||
return id;
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue