From 4ee9e66d87cc9ee265b502f803c6884fa3f45940 Mon Sep 17 00:00:00 2001 From: Hakan Kuecuekyilmaz Date: Thu, 24 Jun 2010 22:40:30 +0200 Subject: [PATCH] Make MariaDB compile with VS 2010 Most of the changes are backports from MySQL 5.5. Please note that the 64-bit build fails with VS 2010 and the 32-bit build has problems running mysql-test-run.pl. * Added files for compiling with VS 2010 and added them to Makefile.am. * ifdef'ed ETIMEDOUT, because it is defined by VS 2010 now * Removed not needed /MAP's from cmake files --- CMakeLists.txt | 3 +-- include/my_pthread.h | 4 +++- sql/CMakeLists.txt | 1 - win/Makefile.am | 3 ++- win/build-vs10.bat | 18 ++++++++++++++++++ win/build-vs10_x64.bat | 18 ++++++++++++++++++ win/configure-mariadb.sh | 8 +++----- 7 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 win/build-vs10.bat create mode 100644 win/build-vs10_x64.bat diff --git a/CMakeLists.txt b/CMakeLists.txt index db7415ed0e5..e998fe1825b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,8 +116,7 @@ IF(MSVC) STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT}) - # generate map files, set stack size (see bug#20815) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS") + # set stack size (see bug#20815) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576") # remove support for Exception handling diff --git a/include/my_pthread.h b/include/my_pthread.h index 9b01146cdde..ee5a77f0216 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -128,7 +128,9 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp); void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ -#define ETIMEDOUT 145 /* Win32 doesn't have this */ +#ifndef ETIMEDOUT +#define ETIMEDOUT 145 +#endif #define getpid() GetCurrentThreadId() #define HAVE_LOCALTIME_R 1 #define _REENTRANT 1 diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 246b7033740..b7da65a9dda 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -18,7 +18,6 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi") -SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include diff --git a/win/Makefile.am b/win/Makefile.am index fceebb07a59..18bfe8ddf81 100644 --- a/win/Makefile.am +++ b/win/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \ build-vs9_x64.bat configure.js README mysql_manifest.cmake \ create_manifest.js create_def_file.js build-nmake.bat \ - build-nmake-x64.bat configure-mariadb.sh make_mariadb_win_dist + build-nmake-x64.bat configure-mariadb.sh make_mariadb_win_dist \ + build-vs10.bat build-vs10_x64.bat # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/win/build-vs10.bat b/win/build-vs10.bat new file mode 100644 index 00000000000..b67ac7e9753 --- /dev/null +++ b/win/build-vs10.bat @@ -0,0 +1,18 @@ +@echo off + +REM Copyright (C) 2010 Monty Program AB +REM +REM This program is free software; you can redistribute it and/or modify +REM it under the terms of the GNU General Public License as published by +REM the Free Software Foundation; version 2 of the License. +REM +REM This program is distributed in the hope that it will be useful, +REM but WITHOUT ANY WARRANTY; without even the implied warranty of +REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +REM GNU General Public License for more details. +REM +REM You should have received a copy of the GNU General Public License +REM along with this program; if not, write to the Free Software +REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +cmake -G "Visual Studio 10" + diff --git a/win/build-vs10_x64.bat b/win/build-vs10_x64.bat new file mode 100644 index 00000000000..f84e826ac65 --- /dev/null +++ b/win/build-vs10_x64.bat @@ -0,0 +1,18 @@ +@echo off + +REM Copyright (C) 2010 Monty Program AB +REM +REM This program is free software; you can redistribute it and/or modify +REM it under the terms of the GNU General Public License as published by +REM the Free Software Foundation; version 2 of the License. +REM +REM This program is distributed in the hope that it will be useful, +REM but WITHOUT ANY WARRANTY; without even the implied warranty of +REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +REM GNU General Public License for more details. +REM +REM You should have received a copy of the GNU General Public License +REM along with this program; if not, write to the Free Software +REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +cmake -G "Visual Studio 10 Win64" + diff --git a/win/configure-mariadb.sh b/win/configure-mariadb.sh index 294b1530788..b6063a20dc4 100644 --- a/win/configure-mariadb.sh +++ b/win/configure-mariadb.sh @@ -15,9 +15,7 @@ cscript win/configure.js \ WITH_FEDERATED_STORAGE_ENGINE \ WITH_MERGE_STORAGE_ENGINE \ WITH_PARTITION_STORAGE_ENGINE \ - WITH_MARIA_STORAGE_ENGINE \ - WITH_PBXT_STORAGE_ENGINE \ - WITH_XTRADB_STORAGE_ENGINE \ + WITH_MARIA_STORAGE_ENGINE \ + WITH_PBXT_STORAGE_ENGINE \ + WITH_XTRADB_STORAGE_ENGINE \ WITH_EMBEDDED_SERVER - -