first stab at installer rule in jamfile (headers are still copied to the wrong directory)
This commit is contained in:
parent
e3eb59f477
commit
96afdf8b22
49
Jamfile
49
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 <target-os> ] 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 =
|
|||
<toolset>gcc:<cflags>-Wno-missing-braces
|
||||
<boost>system:<cxxflags>$(CXXFLAGS)
|
||||
<boost>system:<linkflags>$(LDFLAGS)
|
||||
<tag>@tag
|
||||
;
|
||||
|
||||
project torrent ;
|
||||
|
@ -446,7 +464,7 @@ lib torrent
|
|||
<define>BOOST_THREAD_USE_LIB
|
||||
<threading>multi
|
||||
<link>shared:<define>TORRENT_BUILDING_SHARED
|
||||
<dht-support>on:<source>src/$(KADEMLIA_SOURCES).cpp
|
||||
<dht-support>on:<source>src/kademlia/$(KADEMLIA_SOURCES).cpp
|
||||
<dht-support>logging:<source>src/$(KADEMLIA_SOURCES).cpp
|
||||
<zlib>shipped:<source>zlib/$(ZLIB_SOURCES).c
|
||||
<conditional>@building
|
||||
|
@ -461,3 +479,14 @@ lib torrent
|
|||
$(usage-requirements)
|
||||
;
|
||||
|
||||
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;
|
||||
|
||||
package.install install
|
||||
: <install-header-subdir>libtorrent
|
||||
<install-source-root>libtorrent
|
||||
<install-no-version-symlinks>on
|
||||
:
|
||||
: torrent
|
||||
: $(headers)
|
||||
;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue