From c102fc222e9d74c08208a56b71baec782650328c Mon Sep 17 00:00:00 2001 From: Daniel Wallin Date: Mon, 16 Feb 2009 11:27:44 +0100 Subject: [PATCH] Add proper SONAME version and install/stage targets. This adds the complete luabind version string to the shared library names. It also adds a "d" suffix to the debug libraries. The build will now produce names like: libluabind.so.0.8.1 libluabindd.so.0.8.1 "bjam install" will build and install the libraries on the default prefix (/usr/local on *nix). The --prefix option can be used to change the prefix. The install also creates the unversioned symlinks: libluabind.so -> libluabind.so.0.8.1 libluabindd.so -> libluabindd.so.0.8.1 --- Jamroot | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/Jamroot b/Jamroot index a8c999d..b247a41 100755 --- a/Jamroot +++ b/Jamroot @@ -2,7 +2,11 @@ import docutils ; import os ; import errors ; import notfile ; +import package ; +import path ; +import virtual-target ; +VERSION = 0.8.0 ; BOOST_ROOT = [ os.environ BOOST_ROOT ] ; rule debug-message ( txt * ) @@ -109,6 +113,26 @@ else if [ os.name ] in LINUX MACOSX FREEBSD lib lua : m dl : $(lib-name) $(library:D) : : $(includes) ; } +rule tag-names ( name : type ? : property-set ) +{ + if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB && + [ $(property-set).get ] = debug + { + name = $(name)d ; + } + + local result = [ virtual-target.add-prefix-and-suffix $(name) : $(type) : $(property-set) ] ; + + if $(type) = SHARED_LIB && + ( ! ( [ $(property-set).get ] in windows cygwin darwin aix ) && + ! ( [ $(property-set).get ] in pgi ) ) + { + result = $(result).$(VERSION) ; + } + + return $(result) ; +} + SOURCES = class.cpp class_info.cpp @@ -134,7 +158,8 @@ SOURCES = usage-requirements = lua msvc,shared:/wd4251 - shared:LUABIND_DYNAMIC_LINK ; + shared:LUABIND_DYNAMIC_LINK + @tag-names ; lib luabind : src/$(SOURCES) @@ -201,3 +226,26 @@ html docs.html stage docs : docs.html : doc ; explicit docs docs.html make-version-file ; +headers = [ path.glob-tree luabind : *.hpp ] ; + +package.install install + : luabind + luabind + on + : + : luabind + : $(headers) + ; + +local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ; +stage-locate ?= stage ; + +install stage + : luabind + : $(stage-locate) + on + on + LIB + ; + +explicit stage ; -- 2.11.4.GIT