From fe0716d0378994caee61b6fd6ad15059a2fabdc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 14:19:47 +0200 Subject: [PATCH] build fixes for 5.1.17 CMakeLists.txt: use correct runtime library for RelWithDebugInfo target and always generate .map files scripts/make_win_bin_dist: use RelWithDebInfo target output if exists, include copy mysqld and mysqlmanager debug info in distribution --- CMakeLists.txt | 8 ++++++++ scripts/make_win_bin_dist | 28 +++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb4d77db73f..ab7a7887c94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,14 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) + STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO + ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) + STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO + ${CMAKE_C_FLAGS_RELWITHDEBINFO}) + + # generate .map files + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS") + # remove support for Exception handling STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..9916d71e724 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,6 +126,15 @@ if [ -e $DESTDIR ] ; then usage fi +# ---------------------------------------------------------------------- +# Adjust target name if needed, release with debug info has another name +# ---------------------------------------------------------------------- + +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + # ---------------------------------------------------------------------- # Copy executables, and client DLL (FIXME why?) # ---------------------------------------------------------------------- @@ -134,18 +143,20 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR mkdir $DESTDIR mkdir $DESTDIR/bin -cp client/$TARGET/*.exe $DESTDIR/bin/ -cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ -cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ +cp client/$TARGET/*.exe $DESTDIR/bin/ +cp extra/$TARGET/*.exe $DESTDIR/bin/ +cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp tests/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then @@ -342,6 +353,9 @@ done cp -pR sql/share $DESTDIR/ +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ----------------------------------------------------------------------