add LLVM_VERSION_MAJOR and _MINOR defines
authorDylan Noblesmith <nobled@dreamwidth.org>
Mon, 13 Feb 2012 18:48:10 +0000 (18:48 +0000)
committerDylan Noblesmith <nobled@dreamwidth.org>
Mon, 13 Feb 2012 18:48:10 +0000 (18:48 +0000)
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

CMakeLists.txt
autoconf/configure.ac
cmake/modules/LLVMConfig.cmake.in
configure
include/llvm/Config/config.h.cmake
include/llvm/Config/config.h.in
include/llvm/Config/llvm-config.h.cmake
include/llvm/Config/llvm-config.h.in

index 522c91c495ffda115c8213b6a9f727163ecf987c..5313d110d2ce1490f5a961afff0bf75aa1b7b640 100644 (file)
@@ -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)
 
index 0691f1fd4d1e482ca7ad6fdd00ed27fa93eb3407..3a86531a9d9aeb80f49a0d828b6dc40e1f841201 100644 (file)
@@ -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.
index 6b202b2e7e8766e0e67a23e9f1845a2e18f2d795..443ec415328041d79a36f558a9556ca1a28ed8d1 100644 (file)
@@ -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@)
index 7acea4e63a17d5b0a05d879bd8dfe6ea80e1b699..060d1e63291652d69adc5f8c68d934756a5bcf05 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index 8d913e9a2f9af12d4bb34b017fad7aff431be273..c4750142522fe9eb6d0da6f38d5515755ec80d04 100644 (file)
 /* 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}
 
index 3b20355276bc1ed9b221e3c940331c7349b2bb40..1a996a20da5de42418c0cdd9b9bd6cab1d8eb74b 100644 (file)
 /* 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
 
index 0c5b542679b095dcfeea0aced53243db11df0903..3a55e6ba9227f0219ef63bec505d66decfd68ad1 100644 (file)
 /* 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
index 30a935bf9c22f1ba5bba3875ad72975eb5561548..2613366647192813d36315fbf0545ce277610451 100644 (file)
 /* 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