diff options
author | Dylan Noblesmith <nobled@dreamwidth.org> | 2012-02-13 18:48:10 +0000 |
---|---|---|
committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2012-02-13 18:48:10 +0000 |
commit | fde8237cd9c7e0eb503e6c53994c9c9d19cbb4c6 (patch) | |
tree | 3c55ba867738db4cce7c1216d82da4c9be6ed9ff | |
parent | 3ed4dee530984b7087dd3bbf4cfd8a3f1947c8e0 (diff) | |
download | llvm-fde8237cd9c7e0eb503e6c53994c9c9d19cbb4c6.tar.gz llvm-fde8237cd9c7e0eb503e6c53994c9c9d19cbb4c6.tar.bz2 llvm-fde8237cd9c7e0eb503e6c53994c9c9d19cbb4c6.tar.xz |
add LLVM_VERSION_MAJOR and _MINOR defines
This is useful for clients that want to maintain compatibility
across multiple releases of LLVM. Currently users like Klee and
Mesa all have to roll their own 'parse llvm-config --version
output and generate defines' solution.
Also reuse the new macros so that version information is less
redundant/likely to fall out of sync again in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150405 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | autoconf/configure.ac | 2 | ||||
-rw-r--r-- | cmake/modules/LLVMConfig.cmake.in | 2 | ||||
-rwxr-xr-x | configure | 12 | ||||
-rw-r--r-- | include/llvm/Config/config.h.cmake | 6 | ||||
-rw-r--r-- | include/llvm/Config/config.h.in | 6 | ||||
-rw-r--r-- | include/llvm/Config/llvm-config.h.cmake | 6 | ||||
-rw-r--r-- | include/llvm/Config/llvm-config.h.in | 6 |
8 files changed, 45 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 522c91c495..5313d110d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) -set(PACKAGE_VERSION "3.1svn") +set(LLVM_VERSION_MAJOR 3) +set(LLVM_VERSION_MINOR 1) + +set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn") set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -411,8 +414,8 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ # TODO: make and install documentation. set(CPACK_PACKAGE_VENDOR "LLVM") -set(CPACK_PACKAGE_VERSION_MAJOR 3) -set(CPACK_PACKAGE_VERSION_MINOR 1) +set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR}) add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH) include(CPack) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 0691f1fd4d..3a86531a9d 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -32,6 +32,8 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl address for reporting bugs. AC_INIT([LLVM],[3.1svn],[http://llvm.org/bugs/]) +AC_DEFINE([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API]) +AC_DEFINE([LLVM_VERSION_MINOR], [1], [Minor version of the LLVM API]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in index 6b202b2e7e..443ec41532 100644 --- a/cmake/modules/LLVMConfig.cmake.in +++ b/cmake/modules/LLVMConfig.cmake.in @@ -1,5 +1,7 @@ # This file provides information and services to the final user. +set(LLVM_VERSION_MAJOR @LLVM_VERSION_MAJOR@) +set(LLVM_VERSION_MINOR @LLVM_VERSION_MINOR@) set(LLVM_PACKAGE_VERSION @PACKAGE_VERSION@) set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@) @@ -1898,6 +1898,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +cat >>confdefs.h <<\_ACEOF +#define LLVM_VERSION_MAJOR 3 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define LLVM_VERSION_MINOR 1 +_ACEOF + + LLVM_COPYRIGHT="Copyright (c) 2003-2012 University of Illinois at Urbana-Champaign." @@ -10453,7 +10463,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10456 "configure" +#line 10466 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index 8d913e9a2f..c475014252 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -617,6 +617,12 @@ /* Installation prefix directory */ #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" +/* Major version of the LLVM API */ +#cmakedefine LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR} + +/* Minor version of the LLVM API */ +#cmakedefine LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR} + /* Define if the OS needs help to load dependent libraries for dlopen(). */ #cmakedefine LTDL_DLOPEN_DEPLIBS ${LTDL_DLOPEN_DEPLIBS} diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 3b20355276..1a996a20da 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -615,6 +615,12 @@ /* Installation prefix directory */ #undef LLVM_PREFIX +/* Major version of the LLVM API */ +#undef LLVM_VERSION_MAJOR + +/* Minor version of the LLVM API */ +#undef LLVM_VERSION_MINOR + /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake index 0c5b542679..3a55e6ba92 100644 --- a/include/llvm/Config/llvm-config.h.cmake +++ b/include/llvm/Config/llvm-config.h.cmake @@ -106,4 +106,10 @@ /* Installation prefix directory */ #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" +/* Major version of the LLVM API */ +#cmakedefine LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR} + +/* Minor version of the LLVM API */ +#cmakedefine LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR} + #endif diff --git a/include/llvm/Config/llvm-config.h.in b/include/llvm/Config/llvm-config.h.in index 30a935bf9c..2613366647 100644 --- a/include/llvm/Config/llvm-config.h.in +++ b/include/llvm/Config/llvm-config.h.in @@ -106,4 +106,10 @@ /* Installation prefix directory */ #undef LLVM_PREFIX +/* Major version of the LLVM API */ +#undef LLVM_VERSION_MAJOR + +/* Minor version of the LLVM API */ +#undef LLVM_VERSION_MINOR + #endif |