Skip to content

Commit ce46ec6

Browse files
committed
WL#5161 : Cross-platform build with CMake
--BZR-- revision-id: [email protected] property-branch-nick: mysql-next-mr property-file-info: ld7:file_id44:buildcmake-20091108233336-m9ewbh1c209yaw0h-17:message66:WL#5161 : Documentation on how to build with CMake on Unix/Windows4:path11:BUILD-CMAKEed7:file_id64:sp1f-makefile.am-20020102192940-dza66ux2yxyklupzjz4q3km3hvye5rnj7:message12:Add new file4:path17:BUILD/Makefile.amed7:file_id63:sp1f-autorun.sh-20050518112313-ieijgm4pelky4zldb7pwqwmsxgzyvrhz7:message125:WL#5161 : use choose_configure instead of autotools configure script property-file-info: (choose configure will call cmake if cmake is available)4:path16:BUILD/autorun.shed7:file_id53:choose_configure.sh-20091108233336-m9ewbh1c209yaw0h-57:message125:WL#5161 : use choose_configure instead of autotools configure script property-file-info: (choose configure will call cmake if cmake is available)4:path25:BUILD/choose_configure.shed7:file_id67:sp1f-cmakelists.txt-20060831175236-433hkm7nrqfjbwios4ancgytabw354nr7:message194:WL#5161 : Rewrite top-level CMakeLists.txt. property-file-info: Remove Windows specifics property-file-info: - compiler flags handling moved to configure.cmake property-file-info: - storage engine/plugin stuff moved into cmake/plugin.cmake property-file-info: - copy docs property-file-info: 4:path14:CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-jbbpiygwpgybyqknlavdxxupbrjonu7h7:message15:Added new files4:path11:Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060831175236-tdyayhfqw2zme3vhwbn6l2lno4em3u3t7:message98:WL#5161 : Rewrite CMakeLists.txt to be platform-independent property-file-info: Handle packagng (add INSTALL commands)4:path21:client/CMakeLists.txted7:file_id45:makefile.am-20091108233336-m9ewbh1c209yaw0h-67:message125:WL#5161 : use choose_configure instead of autotools configure script property-file-info: (choose configure will call cmake if cmake is available)4:path17:cmake/Makefile.amed7:file_id49:abi_check.cmake-20091108233336-m9ewbh1c209yaw0h-77:message40:Custom targets for abi_check (for cmake)4:path21:cmake/abi_check.cmakeed7:file_id45:bison.cmake-20091108233336-m9ewbh1c209yaw0h-87:message92:- Check bison availability property-file-info: - Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)4:path17:cmake/bison.cmakeed7:file_id43:cat.cmake-20091108233336-m9ewbh1c209yaw0h-97:message39:Add helper script to concatenate files.4:path15:cmake/cat.cmakeed7:file_id55:character_sets.cmake-20091108233336-m9ewbh1c209yaw0h-107:message51:Handle configuration parameters WITH_EXTRA_CHARSETS4:path26:cmake/character_sets.cmakeed7:file_id55:check_minimal_versio-20091108233336-m9ewbh1c209yaw0h-117:message60:Helper script to check the minimum required version of cmake4:path33:cmake/check_minimal_version.cmakeed7:file_id47:configure.pl-20091108233336-m9ewbh1c209yaw0h-127:message59:Add perl script to convert ./configure parameters for cmake4:path18:cmake/configure.pled7:file_id55:create_initial_db.cm-20091108233336-m9ewbh1c209yaw0h-147:message112:Add script helper to create initial database. property-file-info: (on Windows, we pack initial db with the redistribution property-file-info: package) property-file-info: 4:path32:cmake/create_initial_db.cmake.ined7:file_id53:do_abi_check.cmake-20091108233336-m9ewbh1c209yaw0h-157:message17:Perform abi check4:path24:cmake/do_abi_check.cmakeed7:file_id47:dtrace.cmake-20091108233336-m9ewbh1c209yaw0h-167:message103:Handle dtrace in CMake Build. property-file-info: Check for dtrace availablility, property-file-info: run dtrace -G on solaris in prelink step property-file-info: 4:path18:cmake/dtrace.cmakeed7:file_id55:dtrace_prelink.cmake-20091108233336-m9ewbh1c209yaw0h-177:message105:Run dtrace -G on Solaris in pre-link step, property-file-info: link the object it creates together with library or property-file-info: executable4:path26:cmake/dtrace_prelink.cmakeed7:file_id55:install_macros.cmake-20091108233336-m9ewbh1c209yaw0h-187:message78:Helper macros for packaging property-file-info: (install pdb on Windows, install symlinks on Unix)4:path26:cmake/install_macros.cmakeed7:file_id53:make_dist.cmake.in-20091108233336-m9ewbh1c209yaw0h-197:message112:"make dist" - property-file-info: - pack autotools ./configure script with the source property-file-info: (renamed to configure.am) property-file-info: - pack bison output4:path24:cmake/make_dist.cmake.ined7:file_id55:merge_archives_unix.-20091108233336-m9ewbh1c209yaw0h-207:message40:script to merge static libraries on Unix4:path34:cmake/merge_archives_unix.cmake.ined7:file_id45:misc.cmake-20091108233336-m9ewbh1c209yaw0h-217:message337:Build helper macros property-file-info: - MERGE_STATIC_LIBS property-file-info: We use it when building client library and embedded property-file-info: (avoid recompilation) property-file-info: property-file-info: - Convert source file paths to absolute names. property-file-info: We use it in to locate files of a different project, property-file-info: when the files need to be recompiled (e.g in embedded property-file-info: several storage engines are recompiled with property-file-info: -DEMBEDDED_LIBRARY) property-file-info: property-file-info: 4:path16:cmake/misc.cmakeed7:file_id54:mysql_version.cmake-20091108233336-m9ewbh1c209yaw0h-227:message60:Extract version info from configure.in property-file-info: Handle package names.4:path25:cmake/mysql_version.cmakeed7:file_id47:plugin.cmake-20091108233336-m9ewbh1c209yaw0h-237:message113:Rewrote storage/mysql_storage_engine.cmake to handle property-file-info: other types of plugins and do it in OS-independent manner. property-file-info: 4:path18:cmake/plugin.cmakeed7:file_id49:readline.cmake-20091108233336-m9ewbh1c209yaw0h-247:message55:Macros to handle WITH_READLINE/WITH_LIBEDIT parameters property-file-info: 4:path20:cmake/readline.cmakeed7:file_id44:ssl.cmake-20091108233336-m9ewbh1c209yaw0h-257:message40:Add macros to handle WITH_SSL parameter.4:path15:cmake/ssl.cmakeed7:file_id52:stack_direction.c-20091108233336-m9ewbh1c209yaw0h-267:message32:Helper to check stack direction.4:path23:cmake/stack_direction.ced7:file_id45:zlib.cmake-20091108233336-m9ewbh1c209yaw0h-277:message40:Add macros to handle WITH_ZLIB parameter4:path16:cmake/zlib.cmakeed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-347:message25:Build libedit with cmake.4:path37:cmd-line-utils/libedit/CMakeLists.txted7:file_id64:sp1f-makefile.am-20030118162814-qgzt264ki5avaszfmezvvzuwbb6mymto7:message12:Add new file4:path34:cmd-line-utils/libedit/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-357:message26:Build readline with CMake.4:path38:cmd-line-utils/readline/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-og5ztj2mtew2ehpnqudt5gbyws5wvmfu7:message12:Add new file4:path35:cmd-line-utils/readline/Makefile.amed7:file_id48:config.h.cmake-20091108233336-m9ewbh1c209yaw0h-37:message41:WL#5161 : Add config.h template for cmake4:path14:config.h.cmakeed7:file_id49:configure.cmake-20091108233336-m9ewbh1c209yaw0h-47:message41:WL#5161 : Add platform tests ( for cmake)4:path15:configure.cmakeed7:file_id65:sp1f-configure.in-19700101030959-mgdpoxtnh2ewmvusvfpkreuhwvffkcjw7:message24:Added new subdirectories4:path12:configure.ined7:file_id67:sp1f-cmakelists.txt-20060831175236-d5bv3fgibf4p4ql4ntcr4ypt63z5zfi67:message7:WL#51614:path19:dbug/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175236-uva2lw4uramzkyx4a5w66os4jz5cv7g57:message7:WL#51614:path20:extra/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-xjxcqitzywtqhrevp5syq2kjpjabnvhl7:message7:WL#51614:path26:extra/yassl/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-ewydqdjmnnisumb2tchnxjj6yzqrzyga7:message7:WL#51614:path35:extra/yassl/taocrypt/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-42ptynoryou25hajenjryzqyuvicbucw7:message12:Add new file4:path19:include/Makefile.amed7:file_id63:sp1f-keycache.h-20031120200620-epdbaok2tbq7pk52iejznbrk32ulro777:message57:remove configure-win.h and remove HUGE_PTR defined there.4:path18:include/keycache.hed7:file_id64:sp1f-my_global.h-20010915021246-4vawdgfw4vg3tuxq6mejt7lrchcnceha7:message53:use my_config.h for Windows, not config-win.h anymore4:path19:include/my_global.hed7:file_id65:sp1f-my_pthread.h-19700101030959-z4yp3kljwx5fgmhlyvumtwxuw73xgrjn7:message166:- Move thread_safe_increment from config-win.h to other headers property-file-info: (config-win.h is not used anymore) property-file-info: - Declare pthread_cancel on Windows (it is used in daemon_example) property-file-info: 4:path20:include/my_pthread.hed7:file_id61:sp1f-my_sys.h-19700101030959-lyllvna5vzqfcjnmlcrutgqocylhtb547:message136:Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and property-file-info: with this define malloc.h is not included automatically via windows.h) property-file-info: 4:path16:include/my_sys.hed7:file_id61:sp1f-plugin.h-20051105112032-xacmvx22ghtcgtqhu6v56b4bneqtx7l57:message46:Handle pure-C plugins with Microsoft compiler.4:path22:include/mysql/plugin.hed7:file_id64:sp1f-thr_alarm.h-19700101030959-5xf2x5lk6zzkymh6eg5zkd6n73vwp5u37:message168:remove rf_SetTimer that used to be defined in config-win.h property-file-info: Replace with UINT_PTR (we do not use config-win.h anymore property-file-info: and typedef was needed in this single place only) property-file-info: property-file-info: 4:path19:include/thr_alarm.hed7:file_id67:sp1f-cmakelists.txt-20060831175237-3bbprkzqdl3gopcnlt3evmaikau67bcq7:message144:Avoid pointless recompilation of source files property-file-info: in client library if possible. Merge static property-file-info: libs (dbug, mysys) to create static client property-file-info: library.4:path23:libmysql/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060403082523-x3vxka3k56u2wpzwcrlpykznlz2akpxd7:message147:Avoid pointless recompilation of source files property-file-info: when building embedded. Instead, merge dbug and property-file-info: mysys (and some other static libs) into embedded. property-file-info: property-file-info: 4:path24:libmysqld/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060403082846-qs2z7khuwbdcejrq62ruchgkp4vewfxd7:message28:Embedded compilation on Unix4:path33:libmysqld/examples/CMakeLists.txted7:file_id63:sp1f-lib_sql.cc-20010411110351-gt5febleap73tqvapkesopvqtuht5sf57:message227:Do not define THD::clear_error() in lib_sql.cc property-file-info: for embedded. Instead, use the same inline property-file-info: definition from sql_class.h as in none-embedded property-file-info: case (fixes duplicate symbol errors on Windows property-file-info: and removes pointless #ifdef EMBEDDED) property-file-info: property-file-info: 4:path20:libmysqld/lib_sql.cced7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-297:message18:Install man files.4:path18:man/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-aebuhyyaw7p6br3cp7egpta7aihvrxne7:message13:Add new file.4:path15:man/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-307:message24:Install mysql-test files4:path25:mysql-test/CMakeLists.txted7:file_id64:sp1f-makefile.am-20001206082022-36vvdlhec52v4kcxab5ees7yomxvj4dl7:message13:Add new files4:path22:mysql-test/Makefile.amed7:file_id69:sp1f-configfactory.pm-20071212171904-umibosyolpj2kzgk32rt5p6pl6vztmaq7:message47:Allow testing with mtr in out-of-source builds.4:path34:mysql-test/lib/My/ConfigFactory.pmed7:file_id60:sp1f-find.pm-20071212171904-3nin2m6xbsz6zv3pxhb4wi2zfvqw7o2p7:message208:the build configurations are now also available on Unix property-file-info: Xcode on Mac uses the Release, RelwithDebinfo and Debug property-file-info: subdirectories for executables. Earlier, build configurations property-file-info: were available only on Windows. property-file-info: 4:path25:mysql-test/lib/My/Find.pmed7:file_id67:sp1f-safeprocess.pm-20071212171904-5dvgbxdpklkwzt5ti7tudtpid4iugxmy7:message47:Allow testing with mtr in out-of-source builds.4:path32:mysql-test/lib/My/SafeProcess.pmed7:file_id67:sp1f-cmakelists.txt-20071219115802-ib3pbtm2nik64roqjtf46iyhxwtyypdl7:message27:Port CMakeLists.txt to Unix4:path44:mysql-test/lib/My/SafeProcess/CMakeLists.txted7:file_id69:sp1f-safe_kill_win.cc-20071212171905-p26lghnyebz5xacmoguzikby3mb4dmhf7:message63:add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)4:path46:mysql-test/lib/My/SafeProcess/safe_kill_win.cced7:file_id72:sp1f-safe_process_win.cc-20071212171905-5fxmtbbzzyquscvb7nvjxobmzfwasomh7:message181:Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN) property-file-info: define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined property-file-info: (can happen using MinGW compiler that comes with old SDK) property-file-info: property-file-info: 4:path49:mysql-test/lib/My/SafeProcess/safe_process_win.cced7:file_id50:mtr.outofsource-20091108233336-m9ewbh1c209yaw0h-317:message47:Allow testing with mtr in out-of-source builds.4:path28:mysql-test/mtr.out-of-sourceed7:file_id68:sp1f-mysqltestrun.pl-20041230152716-xjnn5ndv4rr4by6ijmj5a4ysubxc7qh37:message99:Allow testing with mtr in out-of-source builds. property-file-info: Use common find_plugin macro for Windows and unix. property-file-info: 4:path28:mysql-test/mysql-test-run.pled7:file_id54:fulltext_plugin.test-20081217120757-fsqqz6xvatgamkzx-17:message41:This test can now run on Windows as well.4:path33:mysql-test/t/fulltext_plugin.tested7:file_id67:sp1f-cmakelists.txt-20060831175237-shgpjtu5x7rmyswxjiriviagwnm5kvpd7:message27:Port CMakeLists.txt to Unix4:path20:mysys/CMakeLists.txted7:file_id64:sp1f-my_create.c-19700101030959-tlvq5kmde7ugiyusb6omv4ihazkudamc7:message51:config-win.h is dead => NO_OPEN_3 is never defined.4:path17:mysys/my_create.ced7:file_id68:sp1f-my_getsystime.c-20040302212107-h5blakn74xewolernjfpc23tn623kllm7:message65:config-win.h is dead => define OFFSET_TO_EPOCH where it is used. property-file-info: 4:path21:mysys/my_getsystime.ced7:file_id67:sp1f-my_winthread.c-19700101030959-rvu37ehbcbsxvwhztjz3v3hjruvag5in7:message50:Add win32 pthread_cancel - used by daemon_example4:path20:mysys/my_winthread.ced7:file_id65:sp1f-mysys_priv.h-19700101030959-nsrypet4lo2zuzwvmnrc4mwla2cctlor7:message94:config-win.h is dead => include <sys/stat.h> where it is used property-file-info: fix prototype of my_win_(f)stat property-file-info: 4:path18:mysys/mysys_priv.hed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-367:message33:Compile daemon_example with CMake4:path36:plugin/daemon_example/CMakeLists.txted7:file_id64:sp1f-makefile.am-20061111012154-qsjmuxl7tumesqnmmnvrlpe523w362jw7:message12:Add new file4:path33:plugin/daemon_example/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-377:message36:Compile full-text example with CMake4:path30:plugin/fulltext/CMakeLists.txted7:file_id64:sp1f-makefile.am-20051228120521-dpalabwkf3gshnf5da4ayskzncyrx2mf7:message13:Add new file.4:path27:plugin/fulltext/Makefile.amed7:file_id48:cmakelists.txt-20091023072134-d0eqs83uimdpj3e6-17:message47:Fix semisync to use common macro for plugins. property-file-info: 4:path30:plugin/semisync/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-6kmn7fqqj7jzzviead26v47chae5xab37:message155:Use absolute filenames, when adding regex library property-file-info: (we recompile files in embedded, and want to locate property-file-info: sources via GET_TARGET_PROPERTY( ... SOURCES ..)) property-file-info: property-file-info: 4:path20:regex/CMakeLists.txted7:file_id61:sp1f-regex2.h-19700101030959-67uigg2fesmxlf3z5wshwaomtlthy6sl7:message63:Remove pointless typedef (produces error with MinGW compiler) property-file-info: property-file-info: 4:path14:regex/regex2.hed7:file_id67:sp1f-cmakelists.txt-20070418112138-acihcbj7ovt6jifuq7fzvs4mdjxtqvsz7:message33:Add configure/install for scripts4:path22:scripts/CMakeLists.txted7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-327:message23:install sql-bench files4:path24:sql-bench/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-3gc5367dma4sqfsibuahsx3ln7tctxlt7:message12:Add new file4:path21:sql-bench/Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060831175237-esoeu5kpdtwjvehkghwy6fzbleniq2wy7:message27:Port CmakeLists.txt to Unix4:path18:sql/CMakeLists.txted7:file_id64:sp1f-nt_servc.cc-19700101030959-swh3zcmhgdgkqj3b5b46ljjlc6alrc4l7:message41:compile server with -DWIN32_LEAN_AND_MEAN4:path15:sql/nt_servc.cced7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-387:message16:Install charsets4:path24:sql/share/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-maua2sjxeswwnetoodq7c3xj5oe7b4w47:message12:Add new file4:path21:sql/share/Makefile.amed7:file_id70:sp1f-sql_builtin.cc.in-20060413204924-2uqxqmqkyuh3wtmodadlo23ag3lchfp67:message33:Handle pure-C plugins on Windows.4:path21:sql/sql_builtin.cc.ined7:file_id64:sp1f-sql_class.h-19700101030959-jnqnbrjyqsvgncsibnumsmg3lyi7pa5s7:message137:Use the same clear_error macro in embedded and not embedded. property-file-info: Fixes pointless #ifdef and avoids duplicate symbols when linking property-file-info: on Windows.4:path15:sql/sql_class.hed7:file_id64:sp1f-makefile.am-20050427083011-jlriqujeui2dc4l2de5cnr5inqi5brlh7:message56:storage/mysql_storage_engine.cmake => cmake/plugin.cmake4:path19:storage/Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060324221904-eeglvbzhfjgzaeenavdxsdvjzfjatvre7:message73:Add names for static and dynamic plugin libraries. property-file-info: Link archive with zlib4:path30:storage/archive/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060420173724-gg6gu4cuiqwxpd6ka6x7buomhimxobqu7:message58:Add names for static and dynamic storage property-file-info: engine libraries4:path32:storage/blackhole/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060328160515-6sggqkwlvxuf7dhyxybb6wrwk5mmv2kb7:message57:Add names for static and dynamic storage engine property-file-info: libraries4:path26:storage/csv/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060323153445-xanvnlbevotxrbaqm6juwff7tups33xi7:message59:Add names for static and dynamic storage engine property-file-info: libraries property-file-info: 4:path30:storage/example/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060819155453-lvbabhbwyj6n6qzjroyxasefis7wczs57:message59:Add names for static and dynamic storage engine property-file-info: libraries property-file-info: 4:path32:storage/federated/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-jypsui3hkl5zmg3rmmc4zu5637tte33m7:message59:Add names for static and dynamic storage engine property-file-info: libraries property-file-info: 4:path27:storage/heap/CMakeLists.txted7:file_id48:cmakelists.txt-20090215021022-15ov21fvravqaicb-27:message32:Better port for ibmdb2i plugin property-file-info: property-file-info: 4:path30:storage/ibmdb2i/CMakeLists.txted7:file_id48:cmakelists.txt-20090527093836-7v4wb2xxka10h4d0-27:message80:Run system checks. property-file-info: property-file-info: Add names for static and dynamic storage engine property-file-info: libraries. property-file-info: 4:path31:storage/innobase/CMakeLists.txted7:file_id48:page0page.ic-20090527093836-7v4wb2xxka10h4d0-1757:message33:Fix compile error on OpenSolaris.4:path37:storage/innobase/include/page0page.iced7:file_id67:sp1f-cmakelists.txt-20060831175237-isyf2yt2n4jgrnjcfu6r2327heoabcyx7:message27:Port CmakeLists.txt to Unix4:path29:storage/myisam/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-gqsbop4ddbjqltn5seo4t7sgbrurfvi37:message59:Add names for static and dynamic storage engine property-file-info: libraries property-file-info: 4:path32:storage/myisammrg/CMakeLists.txted7:file_id54:mysql_storage_engine-20090610083740-kj4pwd9fzdgs1ocd-17:message56:storage/mysql_storage_engine.cmake => cmake/plugin.cmake4:path34:storage/mysql_storage_engine.cmakeed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-337:message54:Configure and install some files from support-files. property-file-info: 4:path28:support-files/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-277rra4r5vvtfge67hzsdpbpm2puxyqy7:message12:Add new file4:path25:support-files/Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060831175237-s2uudcsvsmg2idjj3uv2gk56hocgttv67:message127:In general case, mysqlclient library can be dependent property-file-info: on C++ runtime(if it includes yassl and is not compiled property-file-info: with gcc or MSVC)4:path20:tests/CMakeLists.txted7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-397:message14:Add unit tests4:path29:unittest/mysys/CMakeLists.txted7:file_id64:sp1f-makefile.am-20060404161610-vihzdr4qjuef3o5tlkhxxs3o74qy7bln7:message12:Add new file4:path26:unittest/mysys/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-407:message26:Add library for unit tests4:path29:unittest/mytap/CMakeLists.txted7:file_id64:sp1f-makefile.am-20060404161607-pmcjv74iwo633ms2jr4ibem4466jdltk7:message12:Add new file4:path26:unittest/mytap/Makefile.amed7:file_id58:sp1f-tap.c-20060404161607-zis77xthewrsxcegtxfzy7wixxez6grt7:message47:fix function definitions to match declarations property-file-info: 4:path20:unittest/mytap/tap.ced7:file_id52:create_def_file.js-20090610083754-xik69w7ypq7btk2m-17:message89:Fix link error with intel compiler (icl property-file-info: defines of special label for exception handler) property-file-info: 4:path22:win/create_def_file.jsee testament3-sha1: 537b237a2bb4d88329b167db78f8c923823a4f69
1 parent d28886e commit ce46ec6

File tree

111 files changed

+6265
-1030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+6265
-1030
lines changed

.bzrfileids

2.74 KB
Binary file not shown.

BUILD-CMAKE

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
How to Build MySQL server with CMake
2+
3+
WHAT YOU NEED
4+
---------------------------------------------------------------
5+
CMake version 2.6 or later installed on your system.
6+
7+
HOW TO INSTALL:
8+
9+
Linux distributions:
10+
shell> sudo apt-get install cmake
11+
12+
The above works on do Debian/Ubuntu based distributions.On others, command
13+
line needs to be modified to e.g "yum install" on Fedora or "zypper install"
14+
on OpenSUSE.
15+
16+
OpenSolaris:
17+
shell> pfexec pkgadd install SUNWCMake
18+
19+
Windows and Mac OSX:
20+
Download and install the latest distribution from
21+
http://www.cmake.org/cmake/resources/software.html.On Windows, download
22+
installer exe file and run it. On Mac, download the .dmg image and open it.
23+
24+
Other Unixes:
25+
Precompiled packages for other Unix flavors (HPUX, AIX) are available from
26+
http://www.cmake.org/cmake/resources/software.html
27+
28+
Alternatively, you can build from source, source package is also available on
29+
CMake download page.
30+
31+
32+
Compiler Tools
33+
--------------
34+
You will need a working compiler and make utility on your OS.
35+
On Windows, install Visual Studio (Express editions will work too).
36+
On Mac OSX, install Xcode tools.
37+
38+
39+
40+
BUILD
41+
---------------------------------------------------------------
42+
Ensure that compiler and cmake are in PATH.
43+
The following description assumes that current working directory
44+
is the source directory.
45+
46+
47+
- Generic build on Unix, using "Unix Makefiles" generator
48+
49+
shell>cmake .
50+
shell>make
51+
52+
Note: by default, cmake build is less verbose than automake build. Use
53+
"make VERBOSE=1" if you want to see add command lines for each compiled source.
54+
55+
- Windows, using "Visual Studio 9 2008" generator
56+
shell>cmake . -G "Visual Studio 9 2008"
57+
shell>devenv MySQL.sln /build /relwithdebinfo
58+
(alternatively, open MySQL.sln and build using the IDE)
59+
60+
- Windows, using "NMake Makefiles" generator
61+
shell>cmake . -G "NMake Makefiles"
62+
shell>nmake
63+
64+
- Mac OSX build with Xcode
65+
shell>cmake . -G Xcode
66+
shell>xcodebuild -configuration Relwithdebinfo
67+
(alternatively, open MySQL.xcodeproj and build using the IDE)
68+
69+
Command line build with CMake 2.8
70+
After creating project with cmake -G as above, issue
71+
cmake . --build
72+
this works with any CMake generator.
73+
74+
For Visual Studio and Xcode you might want to add an extra
75+
configuration parameter, to avoid building all configurations.
76+
77+
cmake . --build --config Relwithdebinfo
78+
79+
80+
Building "out-of-source"
81+
---------------------------------------------------------------
82+
Building out-of-source provides additional benefits. For example it allows to
83+
build both Release and Debug configurations using the single source tree.Or
84+
build the same source with different version of the same compiler or with
85+
different compilers. Also you will prevent polluting the source tree with the
86+
objects and binaries produced during the make.
87+
88+
Here is an example on how to do it (generic Unix), assuming the source tree is
89+
in directory named src and the current working directory is source root.
90+
91+
shell>mkdir ../build # build directory is called build
92+
shell>cd ../build
93+
shell>cmake ../src
94+
95+
Note: if a directory was used for in-source build, out-of-source will
96+
not work. To reenable out-of-source build, remove <source-root>/CMakeCache.txt
97+
file.
98+
99+
100+
CONFIGURATION PARAMETERS
101+
---------------------------------------------------------------
102+
The procedure above will build with default configuration.
103+
104+
Let's you want to change the configuration parameters and have archive
105+
storage engine compiled into the server instead of building it as pluggable
106+
module.
107+
108+
1)You can provide parameters on the command line, like
109+
110+
shell> cmake . -DWITH_ARCHIVE_STORAGE_ENGINE=1
111+
112+
This can be done during the initial configuration or any time later.
113+
114+
Note, that parameters are "sticky", that is they are remebered in the CMake
115+
cache (CMakeCache.txt file in the build directory)
116+
117+
2) Configuration using cmake-gui (Windows, OSX, or Linux with cmake-gui
118+
installed)
119+
120+
From the build directory, issue
121+
shell> cmake-gui .
122+
123+
- Check the WITH_INNOBASE_STORAGE_ENGINE checkbox
124+
- Click on "Configure" button
125+
- Click on "Generate" button
126+
- Close cmake-gui
127+
shell> make
128+
129+
3)Using ccmake (Unix)
130+
ccmake is curses-based GUI application that provides the same functionality
131+
as cmake-gui. It is less user-friendly compared to cmake-gui but works also
132+
on exotic Unixes like HPUX, AIX or Solaris.
133+
134+
Besides storage engines, probably the most important parameter from a
135+
developer's point of view is WITH_DEBUG (this allows to build server with
136+
dbug tracing library and with debug compile flags).
137+
138+
After changing the configuration, recompile using
139+
shell> make
140+
141+
142+
Listing configuration parameters
143+
---------------------------------------------------------------
144+
shell> cmake -L
145+
146+
Gives a brief overview of important configuration parameters (dump to stdout)
147+
148+
shell> cmake -LH
149+
150+
Does the same but also provides a short help text for each parameter.
151+
152+
shell> cmake -LAH
153+
154+
Dumps all config parameters (including advanced) to the stdout.
155+
156+
PACKAGING
157+
---------------------------------------------------------------
158+
-- Binary distribution --
159+
Packaging in form of tar.gz archives (or .zip on Windows) is also supported
160+
To create a tar.gz package,
161+
162+
1)If you're using "generic" Unix build with makefiles
163+
164+
shell> make package
165+
this will create a tar.gz file in the top level build directory.
166+
167+
2)On Windows, using "NMake Makefiles" generator
168+
169+
shell> nmake package
170+
171+
3)On Windows, using "Visual Studio" generator
172+
173+
shell> devenv mysql.sln /build relwithdebinfo /project package
174+
175+
Note On Windows, 7Zip or Winzip must be installed and 7z.exe rsp winzip.exe
176+
need to be in the PATH.
177+
178+
179+
Another way to build packages is calling cpack executable directly like
180+
shell> cpack -G TGZ --config CPackConfig.cmake
181+
(-G TGZ is for tar.gz generator, there is also -GZIP)
182+
183+
-- Source distribution --
184+
"make dist" target is provided.
185+
186+
ADDITIONAL MAKE TARGETS: "make install" AND "make test"
187+
----------------------------------------------------------------
188+
install target also provided for Makefile based generators. Installation
189+
directory can be controlled using configure-time parameter
190+
CMAKE_INSTALL_PREFIX (default is /usr/local. It is also possible to install to
191+
non-configured directory, using
192+
193+
shell> make install DESTDIR="/some/absolute/path"
194+
195+
"make test" runs unit tests (uses CTest for it)
196+
"make test-force" runs mysql-test-run.pl tests with --test-force parameter
197+
198+
FOR PROGRAMMERS: WRITING PLATFORM CHECKS
199+
--------------------------------------------------------------
200+
If you modify MySQL source and want to add a new platform check,please read
201+
http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks first. In MySQL, most of
202+
the platform tests are implemented in config.cmake and the template header file
203+
is config.h.cmake
204+
205+
Bigger chunks of functionality, for example non-trivial macros are implemented
206+
in files <src-root>/cmake subdirectory.
207+
208+
For people with autotools background, it is important to remember CMake does
209+
not provide autoheader functionality. That is, when you add a check
210+
211+
CHECK_FUNCTION_EXISTS(foo HAVE_FOO)
212+
to config.cmake, then you will also need to add
213+
#cmakedefine HAVE_FOO 1
214+
to config.h.cmake
215+
216+
Troubleshooting platform checks
217+
--------------------------------
218+
If you suspect that a platform check returned wrong result, examine
219+
<build-root>/CMakeFiles/CMakeError.log and
220+
<build-root>/CMakeFiles/CMakeOutput.log
221+
These files they contain compiler command line, and exact error messages.
222+
223+
Troubleshooting CMake code
224+
----------------------------------
225+
While there are advanced flags for cmake like -debug-trycompile and --trace,
226+
a simple and efficient way to debug to add
227+
MESSAGE("interesting variable=${some_invariable}")
228+
to the interesting places in CMakeLists.txt
229+
230+
231+
Tips:
232+
- When using Makefile generator it is easy to examine which compiler flags are
233+
used to build. For example, compiler flags for mysqld are in
234+
<build-root>/sql/CMakeFiles/mysqld.dir/flags.make and the linker command line
235+
is in <build-root>/sql/CMakeFiles/mysqld.dir/link.txt
236+
237+
- CMake caches results of platform checks in CMakeCache.txt. It is a nice
238+
feature because tests do not rerun when reconfiguring (e.g when a new test was
239+
added).The downside of caching is that when a platform test was wrong and was
240+
later corrected, the cached result is still used. If you encounter this
241+
situation, which should be a rare occation, you need either to remove the
242+
offending entry from CMakeCache.txt (if test was for HAVE_FOO, remove lines
243+
containing HAVE_FOO from CMakeCache.txt) or just remove the cache file.

BUILD/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
EXTRA_DIST = FINISH.sh \
2121
SETUP.sh \
2222
autorun.sh \
23+
choose_configure.sh \
2324
build_mccge.sh \
2425
check-cpu \
2526
cleanup \

BUILD/autorun.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ do
2020
done
2121
IFS="$save_ifs"
2222

23+
rm -rf configure
2324
aclocal || die "Can't execute aclocal"
2425
autoheader || die "Can't execute autoheader"
2526
# --force means overwrite ltmain.sh script if it already exists
@@ -29,3 +30,9 @@ $LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
2930
# and --force to overwrite them if they already exist
3031
automake --add-missing --force --copy || die "Can't execute automake"
3132
autoconf || die "Can't execute autoconf"
33+
# Do not use autotools generated configure directly. Instead, use a script
34+
# that will either call CMake or original configure shell script at build
35+
# time (CMake is preferred if installed).
36+
mv configure configure.am
37+
cp BUILD/choose_configure.sh configure
38+
chmod a+x configure

BUILD/choose_configure.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
# Choose whether to use autoconf created configure
3+
# of perl script that calls cmake.
4+
5+
# Ensure cmake and perl are there
6+
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
7+
perl --version >/dev/null 2>&1 || HAVE_CMAKE=no
8+
if test "$HAVE_CMAKE" = "no"
9+
then
10+
sh ./configure.am $@
11+
else
12+
perl ./cmake/configure.pl $@
13+
fi
14+

0 commit comments

Comments
 (0)