Commit 236a0a79 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

prettification of package names and fix compile bug on OSX/ppc

parent ada6e38d
EXTRA_DIST = \
cmake_parse_arguments.cmake \
package_name.cmake \
configurable_file_content.in \
check_minimal_version.cmake \
create_initial_db.cmake.in \
......
......@@ -97,53 +97,8 @@ IF(NOT COMPILATION_COMMENT)
ENDIF()
# Use meaningful package name for the binary package
IF(NOT CPACK_PACKAGE_FILE_NAME)
IF( NOT SYSTEM_NAME_AND_PROCESSOR)
IF(WIN32)
# CMake does not set CMAKE_SYSTEM_PROCESSOR correctly on Win64
# (uses x86). Besides, we try to be compatible with existing naming
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(SYSTEM_NAME_AND_PROCESSOR "winx64")
ELSE()
SET(SYSTEM_NAME_AND_PROCESSOR "win32")
ENDIF()
ELSE()
IF(NOT PLATFORM)
SET(PLATFORM ${CMAKE_SYSTEM_NAME})
ENDIF()
IF(NOT MACHINE)
SET(MACHINE ${CMAKE_SYSTEM_PROCESSOR})
IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT ${MACHINE} MATCHES "ia64")
# On almost every 64 bit machine (except IA64) it is possible
# to build 32 bit packages. Add -64bit suffix to differentiate
# between 32 and 64 bit packages.
SET(MACHINE ${MACHINE}-64bit)
ENDIF()
ENDIF()
SET(SYSTEM_NAME_AND_PROCESSOR "${PLATFORM}-${MACHINE}")
ENDIF()
ENDIF()
IF(SHORT_PRODUCT_TAG)
SET(PRODUCT_TAG "-${SHORT_PRODUCT_TAG}")
ELSEIF(MYSQL_SERVER_SUFFIX)
SET(PRODUCT_TAG "${MYSQL_SERVER_SUFFIX}") # Already has a leading dash
ELSE()
SET(PRODUCT_TAG)
ENDIF()
SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
# Sometimes package suffix is added (something like "-icc-glibc23")
IF(PACKAGE_SUFFIX)
SET(package_name "${package_name}${PACKAGE_SUFFIX}")
ENDIF()
STRING(TOLOWER ${package_name} package_name)
SET(CPACK_PACKAGE_FILE_NAME ${package_name})
ENDIF()
INCLUDE(package_name)
GET_PACKAGE_FILE_NAME(CPACK_PACKAGE_FILE_NAME)
IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME)
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mysql-${VERSION}")
......
......@@ -102,14 +102,12 @@ IF(MSVC)
ADD_DEFINITIONS(/wd4996)
ENDIF()
SET (PLATFORM X86)
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
# _WIN64 is defined by the compiler itself.
# Yet, we define it here again to work around a bug with Intellisense
# described here: http://tinyurl.com/2cb428.
# Syntax highlighting is important for proper debugger functionality.
ADD_DEFINITIONS("-D_WIN64")
SET (PLATFORM X64)
ENDIF()
ENDIF()
......
# Copyright (C) 2010 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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
# Produce meaningful package name for the binary package
# The logic is rather involved with special cases for different OSes
MACRO(GET_PACKAGE_FILE_NAME Var)
IF(NOT VERSION)
MESSAGE(FATAL_ERROR
"Variable VERSION needs to be set prior to calling GET_PACKAGE_FILE_NAME")
ENDIF()
IF(NOT SYSTEM_NAME_AND_PROCESSOR)
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1)
SET(DEFAULT_PLATFORM ${CMAKE_SYSTEM_NAME})
SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(64BIT 1)
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
SET(DEFAULT_PLATFORM "win")
IF(64BIT)
SET(DEFAULT_MACHINE "x64")
ELSE()
SET(DEFAULT_MACHINE "32")
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
SET(DEFAULT_MACHINE "i686")
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
# SunOS 5.10=> solaris10
STRING(REPLACE "5." "" VER "${CMAKE_SYSTEM_VERSION}")
SET(DEFAULT_PLATFORM "solaris${VER}")
IF(64BIT)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(DEFAULT_MACHINE "x86_64")
ELSE()
SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")
ENDIF()
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
STRING(REPLACE "B." "" VER "${CMAKE_SYSTEM_VERSION}")
SET(DEFAULT_PLATFORM "hpux${VER}")
IF(64BIT)
SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "AIX")
SET(DEFAULT_PLATFORM "${CMAKE_SYSTEM_NAME}5.${CMAKE_SYSTEM_VERSION}")
IF(64BIT)
SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
STRING(REGEX MATCH "[0-9]+\\.[0-9]+" VER "${CMAKE_SYSTEM_VERSION}")
SET(DEFAULT_PLATFORM "${CMAKE_SYSTEM_NAME}${VER}")
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64")
SET(DEFAULT_MACHINE "x86_64")
IF(NOT 64BIT)
SET(DEFAULT_MACHINE "i386")
ENDIF()
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
IF(${CMAKE_OSX_DEPLOYMENT_TARGET})
SET(VER "${CMAKE_OSX_DEPLOYMENT_TARGET}")
ELSE()
SET(VER "${CMAKE_SYSTEM_VERSION}")
ENDIF()
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VER "${VER}")
MATH(EXPR VER "${VER} -4")
SET(DEFAULT_PLATFORM "osx10.${VER}")
LIST(LENGTH CMAKE_OSX_ARCHITECTURES LEN)
IF(LEN GREATER 1)
SET(DEFAULT_MACHINE "universal")
ELSE()
SET(DEFAULT_MACHINE "${CMAKE_OSX_ARCHITECTURES}")
ENDIF()
IF(DEFAULT_MACHINE MATCHES "i386")
SET(DEFAULT_MACHINE "x86")
ENDIF()
ENDIF()
IF(NOT PLATFORM)
SET(PLATFORM ${DEFAULT_PLATFORM})
ENDIF()
IF(NOT MACHINE)
SET(MACHINE ${DEFAULT_MACHINE})
ENDIF()
IF(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE)
SET(SYSTEM_NAME_AND_PROCESSOR "${PLATFORM}-${MACHINE}")
ELSE()
SET(SYSTEM_NAME_AND_PROCESSOR "${PLATFORM}${MACHINE}")
ENDIF()
ENDIF()
IF(SHORT_PRODUCT_TAG)
SET(PRODUCT_TAG "-${SHORT_PRODUCT_TAG}")
ELSEIF(MYSQL_SERVER_SUFFIX)
SET(PRODUCT_TAG "${MYSQL_SERVER_SUFFIX}") # Already has a leading dash
ELSE()
SET(PRODUCT_TAG)
ENDIF()
SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
# Sometimes package suffix is added (something like "-icc-glibc23")
IF(PACKAGE_SUFFIX)
SET(package_name "${package_name}${PACKAGE_SUFFIX}")
ENDIF()
STRING(TOLOWER ${package_name} package_name)
SET(${Var} ${package_name})
ENDMACRO()
......@@ -105,7 +105,7 @@
warning: 'transparent_union' attribute ignored
*/
#if defined(__GNUC__) && !defined(__cplusplus) && \
! (defined(__APPLE__) && defined(_ARCH_PPC64))
! (defined(__APPLE__) && (defined(_ARCH_PPC64) ||defined (_ARCH_PPC)))
/*
we want to be able to use my_atomic_xxx functions with
both signed and unsigned integers. But gcc will issue a warning
......
......@@ -121,10 +121,13 @@ IF(NOT WITHOUT_DYNAMIC_PLUGINS)
FILE(TO_NATIVE_PATH ${LOC} LOC)
SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
ENDFOREACH (CORELIB ${MYSQLD_CORE_LIBS})
SET(_PLATFORM x86)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(_PLATFORM x64)
ENDIF()
ADD_CUSTOM_COMMAND(TARGET mysqld PRE_LINK
COMMAND echo ${PLATFORM} && cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
${PLATFORM} ${LIB_LOCATIONS} > mysqld.def
COMMAND echo ${_PLATFORM} && cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
${_PLATFORM} ${LIB_LOCATIONS} > mysqld.def
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ADD_DEPENDENCIES(sql GenError)
ENDIF()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment