diff --git a/Jamfile b/Jamfile index 16919c5c9..c6bdc6aca 100755 --- a/Jamfile +++ b/Jamfile @@ -5,6 +5,8 @@ import modules ; import os ; import errors ; import feature : feature ; +import package ; +import virtual-target ; BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; CXXFLAGS = [ modules.peek : CXXFLAGS ] ; @@ -18,6 +20,8 @@ if $(BOOST_ROOT) use-project /boost : $(BOOST_ROOT) ; } +VERSION = 0.15 ; + # rule for linking the correct libraries depending # on features and target-os rule linking ( properties * ) @@ -204,6 +208,19 @@ rule building ( properties * ) return $(result) ; } +rule tag ( name : type ? : property-set ) +{ + name = [ virtual-target.add-prefix-and-suffix $(name) : $(type) : $(property-set) ] ; + + if $(type) = SHARED_LIB && + ( ! ( [ $(property-set).get ] in windows cygwin ) ) + { + name = $(name).$(VERSION) ; + } + + return $(name) ; +} + feature tcmalloc : no yes : composite propagated link-incompatible ; feature need-librt : no yes : composite propagated link-incompatible ; @@ -379,15 +396,15 @@ SOURCES = ; KADEMLIA_SOURCES = - kademlia/closest_nodes - kademlia/dht_tracker - kademlia/node - kademlia/refresh - kademlia/rpc_manager - kademlia/find_data - kademlia/node_id - kademlia/routing_table - kademlia/traversal_algorithm + closest_nodes + dht_tracker + node + refresh + rpc_manager + find_data + node_id + routing_table + traversal_algorithm ; ZLIB_SOURCES = @@ -433,6 +450,7 @@ local usage-requirements = gcc:-Wno-missing-braces system:$(CXXFLAGS) system:$(LDFLAGS) + @tag ; project torrent ; @@ -446,7 +464,7 @@ lib torrent BOOST_THREAD_USE_LIB multi shared:TORRENT_BUILDING_SHARED - on:src/$(KADEMLIA_SOURCES).cpp + on:src/kademlia/$(KADEMLIA_SOURCES).cpp logging:src/$(KADEMLIA_SOURCES).cpp shipped:zlib/$(ZLIB_SOURCES).c @building @@ -461,3 +479,14 @@ lib torrent $(usage-requirements) ; +headers = [ path.glob-tree include/libtorrent : *.hpp ] ; + +package.install install + : libtorrent + libtorrent + on + : + : torrent + : $(headers) + ; + diff --git a/set_version.py b/set_version.py index 74abbd4b6..4394e9211 100644 --- a/set_version.py +++ b/set_version.py @@ -7,20 +7,22 @@ def substitute_file(name): subst = '' f = open(name) for l in f: - if '#define LIBTORRENT_VERSION_MAJOR' in l: + if '#define LIBTORRENT_VERSION_MAJOR' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION_MAJOR %d\n' % version[0] - elif '#define LIBTORRENT_VERSION_MINOR' in l: + elif '#define LIBTORRENT_VERSION_MINOR' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION_MINOR %d\n' % version[1] - if '#define LIBTORRENT_VERSION_TINY' in l: + if '#define LIBTORRENT_VERSION_TINY' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION_TINY %d\n' % version[2] - elif '#define LIBTORRENT_VERSION' in l: + elif '#define LIBTORRENT_VERSION' in l and filename.endiswith('.hpp'): l = '#define LIBTORRENT_VERSION "%d.%d.%d.%d"\n' % (version[0], version[1], version[2], version[3]) - elif 'AC_INIT([libtorrent-rasterbar]' in l: + elif 'AC_INIT([libtorrent-rasterbar]' in l and filename.endiswith('.in'): l = 'AC_INIT([libtorrent-rasterbar], [%d.%d.%d], [arvid@cs.umu.se])\n' % (version[0], version[1], version[2]) - elif 'set (VERSION ' in l: + elif 'set (VERSION ' in l and filename.endiswith('.in'): l = 'set (VERSION "%d.%d.%d")\n' % (version[0], version[1], version[2]) - elif ':Version: ' in l: + elif ':Version: ' in l and filename.endiswith('.rst'): l = ':Version: %d.%d.%d\n' % (version[0], version[1], version[2]) + elif 'VERSION = ' in l and filename.endiswith('Jamfile'): + l = 'VERSION = %d.%d.%d ;\n' % (version[0], version[1], version[2]) subst += l