From e751d8f6bf3578fe0bf9d97ec0b2cc4c6a168f7a Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 24 Oct 2009 23:58:27 +0000 Subject: Update configure logic to detect LLVM version (for use in config.h). git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@85022 91177308-0d34-0410-b5e6-96231b3b80d8 --- autoconf/configure.ac | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'autoconf') diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 9c24a1ef..d1f5446e 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -88,7 +88,7 @@ else with_llvmobj=`llvm-config --obj-root` fi -dnl Try to validate directories +dnl Try to validate directories. if test ! -f ${with_llvmsrc}/Makefile.rules; then AC_MSG_ERROR([invalid llvmsrc directory: ${with_llvmsrc}]) fi @@ -96,7 +96,7 @@ if test ! -f ${with_llvmobj}/Makefile.config; then AC_MSG_ERROR([invalid llvmobj directory: ${with_llvmobj}]) fi -dnl Make the paths absolute +dnl Make the paths absolute. llvm_src=`cd $with_llvmsrc 2> /dev/null; pwd` llvm_obj=`cd $with_llvmobj 2> /dev/null; pwd` @@ -109,6 +109,37 @@ AC_MSG_RESULT([$llvm_obj]) AC_SUBST(LLVM_SRC,$llvm_src) AC_SUBST(LLVM_OBJ,$llvm_obj) +dnl Determine LLVM version. +AC_MSG_CHECKING([llvm package version]) +llvm_package_version=`grep PACKAGE_VERSION= $with_llvmsrc/configure | cut -d\' -f 2` +AC_MSG_RESULT([$llvm_package_version]) + +llvm_version_split=`python -c "import re; print '\t'.join(map(str, re.match('([[0-9]]+)[.]([[0-9]]+)(svn)?', \"$llvm_package_version\").groups()))"` + +AC_MSG_CHECKING([llvm version major]) +llvm_version_major=`echo "$llvm_version_split" | cut -f 1` +AC_MSG_RESULT([$llvm_version_major]) + +AC_MSG_CHECKING([llvm version minor]) +llvm_version_minor=`echo "$llvm_version_split" | cut -f 2` +AC_MSG_RESULT([$llvm_version_minor]) + +AC_MSG_CHECKING([llvm is release version]) +llvm_version_svn=`echo "$llvm_version_split" | cut -f 3` +if test "$llvm_version_svn" == "svn"; then + llvm_is_release=0 +else + llvm_is_release=1 +fi +AC_MSG_RESULT([$llvm_is_release]) + +AC_DEFINE_UNQUOTED(LLVM_VERSION_MAJOR, $llvm_version_major, [LLVM major version number]) +AC_SUBST(LLVM_VERSION_MAJOR,$llvm_version_major) +AC_DEFINE_UNQUOTED(LLVM_VERSION_MINOR, $llvm_version_minor, [LLVM minor version number]) +AC_SUBST(LLVM_VERSION_MINOR,$llvm_version_minor) +AC_DEFINE_UNQUOTED(LLVM_IS_RELEASE, $llvm_is_release, [LLVM version is release (instead of development)]) +AC_SUBST(LLVM_IS_RELEASE,$llvm_is_release) + dnl ************************************************************************** dnl User option to enable uClibc support. -- cgit 1.4.1