List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:March 21 2007 9:07pm
Subject:bk commit into 5.0 tree (iggy:1.2416) BUG#24732
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of iggy. When iggy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-21 16:06:16-04:00, iggy@alf. +10 -0
  Bug#24732 Executables do not include Vista manifests
  - Added script to generate application specific manifest.
  - Added new CMake MACRO to add customer build events which will first
  generate a manifest and then embeds that manifest into an executable.

  BitKeeper/etc/ignore@stripped, 2007-03-21 16:06:10-04:00, iggy@alf. +2 -1
    Bug#24732 Executables do not include Vista manifests
    - Revise ignore rules to disallow auto-generatoed cmake files but to allow
    custom macros defined in a .cmake file.

  CMakeLists.txt@stripped, 2007-03-21 16:06:10-04:00, iggy@alf. +19 -0
    Bug#24732 Executables do not include Vista manifests
    - Check for Manifest Tool.  If present, manually embed custom manifest.
    - Set Processor architecture.

  client/CMakeLists.txt@stripped, 2007-03-21 16:06:11-04:00, iggy@alf. +13 -0
    Bug#24732 Executables do not include Vista manifests
    - Embed manifest with custom CMake MACRO for client executables.

  extra/CMakeLists.txt@stripped, 2007-03-21 16:06:11-04:00, iggy@alf. +7 -0
    Bug#24732 Executables do not include Vista manifests
    - Embed manifest with custom CMake MACRO for my_print_default executable.

  libmysql/CMakeLists.txt@stripped, 2007-03-21 16:06:11-04:00, iggy@alf. +5 -0
    Bug#24732 Executables do not include Vista manifests
    - Embed manifest with custom CMake MACRO for myTest executable.

  myisam/CMakeLists.txt@stripped, 2007-03-21 16:06:12-04:00, iggy@alf. +8 -0
    Bug#24732 Executables do not include Vista manifests
    - Embed manifest with custom CMake MACRO for myisam executables.

  server-tools/instance-manager/CMakeLists.txt@stripped, 2007-03-21 16:06:12-04:00, iggy@alf.
+5 -0
    Bug#24732 Executables do not include Vista manifests
    - Embed manifest with custom CMake MACRO for mysqlmanager executable.

  sql/CMakeLists.txt@stripped, 2007-03-21 16:06:13-04:00, iggy@alf. +5 -0
    Bug#24732 Executables do not include Vista manifests
    - Embed manifest with custom CMake MACRO for mysqld executable.

  win/create_manifest.js@stripped, 2007-03-21 16:06:13-04:00, iggy@alf. +85 -0
    Bug#24732 Executables do not include Vista manifests
    - Manifest generator.  This script generates a basic manifest.

  win/create_manifest.js@stripped, 2007-03-21 16:06:13-04:00, iggy@alf. +0 -0

  win/mysql_manifest.cmake@stripped, 2007-03-21 16:06:13-04:00, iggy@alf. +20 -0
    Bug#24732 Executables do not include Vista manifests
    - Define new CMake MACRO for adding Windows manifests to executables.

  win/mysql_manifest.cmake@stripped, 2007-03-21 16:06:13-04:00, iggy@alf. +0 -0

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	iggy
# Host:	alf.
# Root:	D:/src/mysql-5.0-maint_24732

--- 1.5/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.6/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -123,6 +123,25 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual St
 
 ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE")
 
+# Search for the Manifest tool. If found, manually embed a custom manifest.
+FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
+    PATHS
+	"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
+	"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
+	"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
+IF(HAVE_MANIFEST_TOOL)
+    MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
+    STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS 
+    	   ${CMAKE_EXE_LINKER_FLAGS})
+ENDIF(HAVE_MANIFEST_TOOL)
+
+# Set the processor architecture.
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
+	SET(PROCESSOR_ARCH "X64") 
+ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
+    SET(PROCESSOR_ARCH "X86")
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
+
 ADD_SUBDIRECTORY(vio)
 ADD_SUBDIRECTORY(dbug)
 ADD_SUBDIRECTORY(strings)

--- 1.4/client/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.5/client/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -12,6 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -94,4 +95,16 @@ TARGET_LINK_LIBRARIES(mysqlbinlog mysqlc
 
 ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
 TARGET_LINK_LIBRARIES(mysqladmin mysqlclient mysys dbug yassl taocrypt zlib wsock32)
+
+IF(HAVE_MANIFEST_TOOL)
+  MYSQL_EMBED_MANIFEST("mysql" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqltest" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqlcheck" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqldump" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqlimport" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysql_upgrade" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqlshow" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqlbinlog" "asInvoker")
+  MYSQL_EMBED_MANIFEST("mysqladmin" "asInvoker")
+ENDIF(HAVE_MANIFEST_TOOL)
 

--- 1.3/extra/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.4/extra/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -12,6 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -45,3 +46,9 @@ TARGET_LINK_LIBRARIES(perror strings mys
 
 ADD_EXECUTABLE(replace replace.c)
 TARGET_LINK_LIBRARIES(replace strings mysys dbug wsock32)
+
+IF(HAVE_MANIFEST_TOOL)
+  MYSQL_EMBED_MANIFEST("my_print_defaults" "asInvoker")
+  MYSQL_EMBED_MANIFEST("perror" "asInvoker")
+  MYSQL_EMBED_MANIFEST("replace" "asInvoker")
+ENDIF(HAVE_MANIFEST_TOOL)

--- 1.2/libmysql/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.3/libmysql/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -12,6 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
 # Need to set USE_TLS, since __declspec(thread) approach to thread local
 # storage does not work properly in DLLs.
@@ -67,3 +68,7 @@ TARGET_LINK_LIBRARIES(libmysql mysys str
 
 ADD_EXECUTABLE(myTest mytest.c)
 TARGET_LINK_LIBRARIES(myTest libmysql)
+
+IF(HAVE_MANIFEST_TOOL)
+  MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
+ENDIF(HAVE_MANIFEST_TOOL)

--- 1.2/myisam/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.3/myisam/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -12,6 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -39,3 +40,10 @@ TARGET_LINK_LIBRARIES(myisamlog myisam m
 
 ADD_EXECUTABLE(myisampack myisampack.c)
 TARGET_LINK_LIBRARIES(myisampack myisam mysys dbug strings zlib wsock32)
+
+IF(HAVE_MANIFEST_TOOL)
+  MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker")
+  MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker")
+  MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker")
+  MYSQL_EMBED_MANIFEST("myisampack" "asInvoker")
+ENDIF(HAVE_MANIFEST_TOOL)

--- 1.2/server-tools/instance-manager/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.3/server-tools/instance-manager/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -12,6 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
@@ -30,3 +31,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc co
 
 ADD_DEPENDENCIES(mysqlmanager GenError)
 TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32)
+
+IF(HAVE_MANIFEST_TOOL)
+  MYSQL_EMBED_MANIFEST("mysqlmanager" "asInvoker")
+ENDIF(HAVE_MANIFEST_TOOL)

--- 1.4/sql/CMakeLists.txt	2007-03-21 16:06:31 -04:00
+++ 1.5/sql/CMakeLists.txt	2007-03-21 16:06:31 -04:00
@@ -12,6 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
 SET(CMAKE_CXX_FLAGS_DEBUG 
     "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
@@ -83,6 +84,10 @@ ADD_EXECUTABLE(mysqld ../sql-common/clie
 
 TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl 
                       taocrypt strings vio regex wsock32)
+
+IF(HAVE_MANIFEST_TOOL)
+  MYSQL_EMBED_MANIFEST("mysqld" "requireAdministrator")
+ENDIF(HAVE_MANIFEST_TOOL)
 
 IF(WITH_EXAMPLE_STORAGE_ENGINE)
   TARGET_LINK_LIBRARIES(mysqld example)
--- New file ---
+++ win/create_manifest.js	07/03/21 16:06:13
/* 
  manifest.js - Writes a custom XML manifest for each executable/library
  6 command line options must be supplied: 
  name      - Name of the executable/library into which the mainfest will be 
              embedded.
  version   - Version of the executable 
  arch      - Architecture intended.
  type      - Application type.
  exe_level - Application execution level. 
              [asInvoker|highestAvailable|requireAdministrator]
  outfile   - Final destination where mainfest will be written.

  Example:  
  cscript manifest.js name=mysql version=5.0.32 arch=X86 type=win32 
                      exe_level=asInvoker outfile=out.xml
*/

try 
{
  var args = WScript.Arguments
  for (i=0; i < args.Count(); i++)
  {
    var parts = args.Item(i).split('=');
    switch (parts[0])
    {
      case "name":
           var app_name= parts[1];
           break;
      case "version":
           var app_version= parts[1];
           break;
      case "arch":
           var app_arch= parts[1];
           break;
      case "type":
           var app_type= parts[1];
           break;
      case "exe_level":
		   var app_exe_level= parts[1];
           break;
      case "outfile":
		   var manifest_file= parts[1];
           break;
	  default:
	       WScript.echo("Invalid argument supplied.");
    }
  }
  if (i != 6)
    throw new Error(1, "Incorrect number of arguments.");

  var manifest_xml= "<?xml version=\'1.0\' encoding=\'UTF-8\'
standalone=\'yes\'?>\r\n";
  manifest_xml+= "<assembly xmlns=\'urn:schemas-microsoft-com:asm.v1\'";
  manifest_xml+= " manifestVersion=\'1.0\'>\r\n";
  // Application Information 
  manifest_xml+= "\t<assemblyIdentity name=\'" + app_name + "\'";
  manifest_xml+= " version=\'" + app_version + "\'"; 
  manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
  // TOADD - Add publicKeyToken attribute once we have Authenticode key.
  manifest_xml+= " type=\'" + app_type + "\' />\r\n";
  // Identify the application security requirements.
  manifest_xml+= "\t<trustInfo xmlns=\'urn:schemas-microsoft-com:asm.v2\'>\r\n"; 
  manifest_xml+= "\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t";
  manifest_xml+= "<requestedExecutionLevel level=\'" + app_exe_level + "\'";
  manifest_xml+= " uiAccess=\'false\'/>\r\n";
  manifest_xml+= "\t\t\t</requestedPrivileges>\r\n\t\t</security>\r\n";
  manifest_xml+= "\t</trustInfo>\r\n</assembly>\r\n";

  // Write the valid XML to it's final destination.
  var outfileXML = WScript.CreateObject("Msxml2.DOMDocument.3.0");
  outfileXML.async = false;
  if (!outfileXML.loadXML(manifest_xml))
  {
     WScript.Echo(manifest_xml);
     throw new Error(2, "Invalid XML");
  }
  outfileXML.save(manifest_file);
  
  WScript.Echo("Success, created custom manifest!");
  WScript.Quit(0);
}
catch (e)
{
    WScript.Echo("Error: " + e.description);
	WScript.Quit(1);
}

--- New file ---
+++ win/mysql_manifest.cmake	07/03/21 16:06:13

# - ADD_WIN_MANIFEST(target_name required_privs)
# Create a manifest for target_name.  Set the execution level to require_privs
#
# NOTE. PROCESSOR_ARCH must be defined before this MACRO is called.

MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
  ADD_CUSTOM_COMMAND(
    TARGET ${_target_name}
    PRE_LINK
    COMMAND cscript.exe 
    ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName)
version=${VERSION} arch=${PROCESSOR_ARCH} type=$(PlatformName)
exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
    COMMENT "Generates the contents of the manifest contents.")
  ADD_CUSTOM_COMMAND(
    TARGET ${_target_name}
    POST_BUILD
    COMMAND mt.exe 
    ARGS -nologo -manifest $(IntDir)\\$(TargetFileName).intermediate.manifest
-outputresource:$(TargetPath) 
    COMMENT "Embeds the manifest contents.")
ENDMACRO(MYSQL_EMBED_MANIFEST)


--- 1.241/BitKeeper/etc/ignore	2007-03-21 16:06:31 -04:00
+++ 1.242/BitKeeper/etc/ignore	2007-03-21 16:06:31 -04:00
@@ -4,7 +4,8 @@
 *.bb
 *.bbg
 *.bin
-*.cmake
+*.vcproj.cmake
+cmake_install.cmake
 *.core
 *.d
 *.da
Thread
bk commit into 5.0 tree (iggy:1.2416) BUG#24732Ignacio Galarza21 Mar