Skip to content

Commit

Permalink
Add patch level to llvm version in CMake and Autoconf
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202720 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tstellarAMD committed Mar 3, 2014
1 parent 7bc65d0 commit db3064e
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 26 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,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)
Expand Down Expand Up @@ -60,6 +61,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)
Expand Down
2 changes: 2 additions & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@

###########################################################################
Expand Down
11 changes: 10 additions & 1 deletion Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ else
Ranlib = ranlib
endif

AliasTool = ln -s
AliasTool = ln -sf

#----------------------------------------------------------
# Get the list of source files and compute object file
Expand Down Expand Up @@ -1151,15 +1151,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

#---------------------------------------------------------
Expand Down Expand Up @@ -1213,12 +1217,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)
Expand Down
19 changes: 16 additions & 3 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
54 changes: 33 additions & 21 deletions configure
Original file line number Diff line number Diff line change
@@ -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/>.
#
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -641,6 +641,8 @@ host_alias
target_alias
LLVM_VERSION_MAJOR
LLVM_VERSION_MINOR
LLVM_VERSION_PATCH
LLVM_VERSION_SUFFIX
LLVM_COPYRIGHT
CC
CFLAGS
Expand Down Expand Up @@ -1324,7 +1326,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]...

Expand Down Expand Up @@ -1390,7 +1392,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

Expand Down Expand Up @@ -1561,7 +1563,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,
Expand All @@ -1577,7 +1579,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 $@
Expand Down Expand Up @@ -1931,21 +1933,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'






Expand Down Expand Up @@ -19829,7 +19839,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
Expand Down Expand Up @@ -19882,7 +19892,7 @@ Report bugs to <[email protected]>."
_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'`\\"

Expand Down Expand Up @@ -20122,6 +20132,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
Expand Down Expand Up @@ -20178,8 +20190,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
Expand Down Expand Up @@ -20221,6 +20231,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
Expand Down Expand Up @@ -20316,8 +20328,6 @@ LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim
LLVM_INFODIR!$LLVM_INFODIR$ac_delim
LLVM_MANDIR!$LLVM_MANDIR$ac_delim
LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
ALL_BINDINGS!$ALL_BINDINGS$ac_delim
_ACEOF

if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
Expand Down Expand Up @@ -20359,6 +20369,8 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
ALL_BINDINGS!$ALL_BINDINGS$ac_delim
OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
RPATH!$RPATH$ac_delim
Expand All @@ -20368,7 +20380,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` = 7; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Expand Down
3 changes: 3 additions & 0 deletions include/llvm/Config/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,9 @@
/* Minor version of the LLVM API */
#undef LLVM_VERSION_MINOR

/* Patch version of the LLVM API */
#undef LLVM_VERSION_PATCH

/* The shared library extension */
#undef LTDL_SHLIB_EXT

Expand Down
2 changes: 2 additions & 0 deletions tools/llvm-shlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit db3064e

Please sign in to comment.