[PATCH] Add patch level to llvm version in CMake and Autoconf
Tom Stellard
thomas.stellard at amd.com
Fri Feb 21 11:00:15 PST 2014
The shared library generated by autoconf will now be called
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX).so
and a symlink named
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX).so will
also be created in the install directory.
---
CMakeLists.txt | 4 ++-
Makefile.config.in | 2 ++
Makefile.rules | 11 +++++++-
autoconf/configure.ac | 19 +++++++++++---
configure | 56 +++++++++++++++++++++++++----------------
include/llvm/Config/config.h.in | 3 +++
tools/llvm-shlib/Makefile | 2 ++
7 files changed, 70 insertions(+), 27 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd8b363..dc20b1f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,9 +12,10 @@ set(CMAKE_MODULE_PATH
set(LLVM_VERSION_MAJOR 3)
set(LLVM_VERSION_MINOR 5)
+set(LLVM_VERSION_PATCH 0)
if (NOT PACKAGE_VERSION)
- set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn")
+ set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}svn")
endif()
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
@@ -45,6 +46,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "LLVM")
set(CPACK_PACKAGE_VENDOR "LLVM")
set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${LLVM_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.TXT")
if(WIN32 AND NOT UNIX)
diff --git a/Makefile.config.in b/Makefile.config.in
index 7633be2..8a46b42 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -17,6 +17,8 @@ LLVMPackageName := @PACKAGE_TARNAME@
LLVMVersion := @PACKAGE_VERSION@
LLVM_VERSION_MAJOR := @LLVM_VERSION_MAJOR@
LLVM_VERSION_MINOR := @LLVM_VERSION_MINOR@
+LLVM_VERSION_PATCH := @LLVM_VERSION_PATCH@
+LLVM_VERSION_SUFFIX := @LLVM_VERSION_SUFFIX@
LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
###########################################################################
diff --git a/Makefile.rules b/Makefile.rules
index d668b23..770c0a6 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -783,7 +783,7 @@ else
Ranlib = ranlib
endif
-AliasTool = ln -s
+AliasTool = ln -sf
#----------------------------------------------------------
# Get the list of source files and compute object file
@@ -1147,15 +1147,19 @@ ifdef LIBRARYNAME
# Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
LIBRARYNAME := $(strip $(LIBRARYNAME))
+LIBRARYALIASNAME := $(strip $(LIBRARYALIASNAME))
ifdef LOADABLE_MODULE
BaseLibName.A := $(LIBRARYNAME).a
BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
+BaseAliasName.SO := $(LIBRARYALIASNAME)$(SHLIBEXT)
else
BaseLibName.A := lib$(LIBRARYNAME).a
BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
+BaseAliasName.SO := $(SharedPrefix)$(LIBRARYALIASNAME)$(SHLIBEXT)
endif
LibName.A := $(LibDir)/$(BaseLibName.A)
LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
+AliasName.SO := $(SharedLibDir)/$(BaseAliasName.SO)
LibName.O := $(LibDir)/$(LIBRARYNAME).o
#---------------------------------------------------------
@@ -1209,12 +1213,17 @@ else
DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
endif
DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
+DestSharedAlias := $(DestSharedLibDir)/$(BaseAliasName.SO)
install-local:: $(DestSharedLib)
$(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
$(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
$(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
+ifdef SHARED_ALIAS
+ $(Echo) Creating alias from $(DestSharedLib) to $(DestSharedAlias)
+ $(Verb) $(AliasTool) $(DestSharedLib) $(DestSharedAlias)
+endif
uninstall-local::
$(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index f376e03..4685649 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -31,9 +31,22 @@ dnl===
dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl address for reporting bugs.
-AC_INIT([LLVM],[3.5svn],[http://llvm.org/bugs/])
-LLVM_DEFINE_SUBST([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API])
-LLVM_DEFINE_SUBST([LLVM_VERSION_MINOR], [5], [Minor version of the LLVM API])
+
+AC_INIT([LLVM],[3.5.0svn],[http://llvm.org/bugs/])
+
+LLVM_VERSION_MAJOR=3
+LLVM_VERSION_MINOR=5
+LLVM_VERSION_PATCH=0
+LLVM_VERSION_SUFFIX=svn
+
+AC_DEFINE_UNQUOTED([LLVM_VERSION_MAJOR], $LLVM_VERSION_MAJOR, [Major version of the LLVM API])
+AC_DEFINE_UNQUOTED([LLVM_VERSION_MINOR], $LLVM_VERSION_MINOR, [Minor version of the LLVM API])
+AC_DEFINE_UNQUOTED([LLVM_VERSION_PATCH], $LLVM_VERSION_PATCH, [Patch version of the LLVM API])
+
+AC_SUBST([LLVM_VERSION_MAJOR])
+AC_SUBST([LLVM_VERSION_MINOR])
+AC_SUBST([LLVM_VERSION_PATCH])
+AC_SUBST([LLVM_VERSION_SUFFIX])
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/configure b/configure
index 46d557d..d23311f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for LLVM 3.5svn.
+# Generated by GNU Autoconf 2.60 for LLVM 3.5.0svn.
#
# Report bugs to <http://llvm.org/bugs/>.
#
@@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='LLVM'
PACKAGE_TARNAME='llvm'
-PACKAGE_VERSION='3.5svn'
-PACKAGE_STRING='LLVM 3.5svn'
+PACKAGE_VERSION='3.5.0svn'
+PACKAGE_STRING='LLVM 3.5.0svn'
PACKAGE_BUGREPORT='http://llvm.org/bugs/'
ac_unique_file="lib/IR/Module.cpp"
@@ -641,6 +641,8 @@ host_alias
target_alias
LLVM_VERSION_MAJOR
LLVM_VERSION_MINOR
+LLVM_VERSION_PATCH
+LLVM_VERSION_SUFFIX
LLVM_COPYRIGHT
CC
CFLAGS
@@ -1330,7 +1332,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures LLVM 3.5svn to adapt to many kinds of systems.
+\`configure' configures LLVM 3.5.0svn to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1396,7 +1398,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of LLVM 3.5svn:";;
+ short | recursive ) echo "Configuration of LLVM 3.5.0svn:";;
esac
cat <<\_ACEOF
@@ -1568,7 +1570,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-LLVM configure 3.5svn
+LLVM configure 3.5.0svn
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1584,7 +1586,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by LLVM $as_me 3.5svn, which was
+It was created by LLVM $as_me 3.5.0svn, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -1938,21 +1940,29 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+LLVM_VERSION_MAJOR=3
+LLVM_VERSION_MINOR=5
+LLVM_VERSION_PATCH=0
+LLVM_VERSION_SUFFIX=svn
-cat >>confdefs.h <<\_ACEOF
-#define LLVM_VERSION_MAJOR 3
-_ACEOF
-LLVM_VERSION_MAJOR='3'
+cat >>confdefs.h <<_ACEOF
+#define LLVM_VERSION_MAJOR $LLVM_VERSION_MAJOR
+_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define LLVM_VERSION_MINOR $LLVM_VERSION_MINOR
+_ACEOF
-cat >>confdefs.h <<\_ACEOF
-#define LLVM_VERSION_MINOR 5
+cat >>confdefs.h <<_ACEOF
+#define LLVM_VERSION_PATCH $LLVM_VERSION_PATCH
_ACEOF
-LLVM_VERSION_MINOR='5'
+
+
+
@@ -10710,7 +10720,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10713 "configure"
+#line 10723 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -23073,7 +23083,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by LLVM $as_me 3.5svn, which was
+This file was extended by LLVM $as_me 3.5.0svn, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23126,7 +23136,7 @@ Report bugs to <bug-autoconf at gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-LLVM config.status 3.5svn
+LLVM config.status 3.5.0svn
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
@@ -23366,6 +23376,8 @@ host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim
LLVM_VERSION_MAJOR!$LLVM_VERSION_MAJOR$ac_delim
LLVM_VERSION_MINOR!$LLVM_VERSION_MINOR$ac_delim
+LLVM_VERSION_PATCH!$LLVM_VERSION_PATCH$ac_delim
+LLVM_VERSION_SUFFIX!$LLVM_VERSION_SUFFIX$ac_delim
LLVM_COPYRIGHT!$LLVM_COPYRIGHT$ac_delim
CC!$CC$ac_delim
CFLAGS!$CFLAGS$ac_delim
@@ -23422,8 +23434,6 @@ ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim
-KEEP_SYMBOLS!$KEEP_SYMBOLS$ac_delim
-JIT!$JIT$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -23465,6 +23475,8 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+KEEP_SYMBOLS!$KEEP_SYMBOLS$ac_delim
+JIT!$JIT$ac_delim
TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
TARGETS_WITH_JIT!$TARGETS_WITH_JIT$ac_delim
ENABLE_DOCS!$ENABLE_DOCS$ac_delim
@@ -23560,8 +23572,6 @@ SHLIBPATH_VAR!$SHLIBPATH_VAR$ac_delim
LLVM_PREFIX!$LLVM_PREFIX$ac_delim
LLVM_BINDIR!$LLVM_BINDIR$ac_delim
LLVM_DATADIR!$LLVM_DATADIR$ac_delim
-LLVM_DOCSDIR!$LLVM_DOCSDIR$ac_delim
-LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -23603,6 +23613,8 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+LLVM_DOCSDIR!$LLVM_DOCSDIR$ac_delim
+LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim
LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim
LLVM_INFODIR!$LLVM_INFODIR$ac_delim
LLVM_MANDIR!$LLVM_MANDIR$ac_delim
@@ -23618,7 +23630,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 13; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in
index 8565696..069f1a4 100644
--- a/include/llvm/Config/config.h.in
+++ b/include/llvm/Config/config.h.in
@@ -642,6 +642,9 @@
/* Minor version of the LLVM API */
#undef LLVM_VERSION_MINOR
+/* Patch version of the LLVM API */
+#undef LLVM_VERSION_PATCH
+
/* Define if the OS needs help to load dependent libraries for dlopen(). */
#undef LTDL_DLOPEN_DEPLIBS
diff --git a/tools/llvm-shlib/Makefile b/tools/llvm-shlib/Makefile
index 317da51..cd26a24 100644
--- a/tools/llvm-shlib/Makefile
+++ b/tools/llvm-shlib/Makefile
@@ -10,10 +10,12 @@
LEVEL := ../..
LIBRARYNAME = LLVM-$(LLVMVersion)
+LIBRARYALIASNAME = LLVM-$(LLVM_VERSION_MAJOR).$(LLVM_VERSION_MINOR)$(LLVM_VERSION_SUFFIX)
NO_BUILD_ARCHIVE := 1
LINK_LIBS_IN_SHARED := 1
SHARED_LIBRARY := 1
+SHARED_ALIAS := 1
include $(LEVEL)/Makefile.config
--
1.8.1.4
More information about the llvm-commits
mailing list