~ubuntu-branches/ubuntu/trusty/mysql-5.5/trusty-updates

« back to all changes in this revision

Viewing changes to cmake/info_macros.cmake.in

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-04-20 09:30:47 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20150420093047-yd9g5p2hesgvlzwm
Tags: 5.5.43-0ubuntu0.14.04.1
* SECURITY UPDATE: Update to 5.5.43 to fix security issues (LP: #1444616)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2015-2365600.html
  - CVE-2015-0433
  - CVE-2015-0441
  - CVE-2015-0499
  - CVE-2015-0501
  - CVE-2015-0505
  - CVE-2015-2568
  - CVE-2015-2571
  - CVE-2015-2573

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 
1
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
2
2
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
23
23
# If further variables are used in this file, add them to this list.
24
24
 
25
25
SET(VERSION "@VERSION@")
 
26
SET(MAJOR_VERSION "@MAJOR_VERSION@")
 
27
SET(MINOR_VERSION "@MINOR_VERSION@")
 
28
SET(PATCH_VERSION "@PATCH_VERSION@")
26
29
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
27
30
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
28
31
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
29
32
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
30
 
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
 
33
SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@")
31
34
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
32
35
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
33
36
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
36
39
 
37
40
 
38
41
# Create an "INFO_SRC" file with information about the source (only).
39
 
# We use "bzr version-info", if possible, and the "VERSION" contents.
 
42
# We use "git log", if possible, and the "VERSION" contents.
40
43
#
41
 
# Outside development (BZR tree), the "INFO_SRC" file will not be modified
 
44
# Outside development (git tree), the "INFO_SRC" file will not be modified
42
45
# provided it exists (from "make dist" or a source tarball creation).
43
46
 
44
47
MACRO(CREATE_INFO_SRC target_dir)
45
48
  SET(INFO_SRC "${target_dir}/INFO_SRC")
46
49
 
47
 
  IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
48
 
    # Sources are in a BZR repository: Always update.
49
 
    EXECUTE_PROCESS(
50
 
      COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
 
50
  SET(PERLSCRIPT
 
51
    "use warnings; use POSIX qw(strftime); "
 
52
    "print strftime \"%F %T %z\", localtime;")
 
53
  EXECUTE_PROCESS(
 
54
    COMMAND perl -e "${PERLSCRIPT}"
 
55
    RESULT_VARIABLE result
 
56
    OUTPUT_VARIABLE bdate
 
57
    ERROR_VARIABLE error
 
58
  )
 
59
  IF(error)
 
60
    MESSAGE(STATUS "Could not determine build-date: <${error}>")
 
61
  ENDIF()
 
62
 
 
63
  IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
 
64
    # Sources are in a GIT repository: Always update.
 
65
    EXECUTE_PROCESS(
 
66
      COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
 
67
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
 
68
      OUTPUT_VARIABLE bname
 
69
    )
 
70
 
 
71
    EXECUTE_PROCESS(
 
72
      COMMAND ${GIT_EXECUTABLE} log -1
 
73
      --pretty="commit: %H%ndate: %ci%nbuild-date: ${bdate} %nshort: %h%nbranch: ${bname}"
 
74
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
51
75
      OUTPUT_VARIABLE VERSION_INFO
52
 
      RESULT_VARIABLE RESULT
53
76
    )
 
77
 
 
78
    ## Output from git is quoted with "", remove them.
 
79
    STRING(REPLACE "\"" "" VERSION_INFO "${VERSION_INFO}")
54
80
    FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n")
55
81
    # to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n")
56
82
    # For better readability ...
57
 
    FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
 
83
    FILE(APPEND ${INFO_SRC}
 
84
      "MySQL source ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}\n")
58
85
  ELSEIF(EXISTS ${INFO_SRC})
59
 
    # Outside a BZR tree, there is no need to change an existing "INFO_SRC",
 
86
    # Outside a git tree, there is no need to change an existing "INFO_SRC",
60
87
    # it cannot be improved.
61
88
  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC)
62
89
    # If we are building from a source distribution, it also contains "INFO_SRC".