Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/Jamfile @ 25

Last change on this file since 25 was 12, checked in by landauf, 16 years ago

added boost

File size: 9.9 KB
Line 
1#~ Copyright 2003-2005, Rene Rivera.
2#~ Distributed under the Boost Software License, Version 1.0.
3#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
4
5if --help in $(ARGV)
6{
7    ECHO "
8Usage:
9    bjam [options] [install|stage]
10
11    * install               Installs to the configured location(s).
12    * stage                 Stages the build products only to common stage
13                            location.
14
15Options:
16    --help                  This message.
17   
18    -sTOOLS=<toolsets>      Indicates the tools to build with.
19   
20    --show-libraries        Displays the list of Boost libraries that require
21                            build and installation steps, then exit.
22
23    --layout=<layout>       Determines what kind of build layout to use. This
24                            allows one to control the naming of the resulting
25                            libraries, and the locations of the installed
26                            files. Default is 'versioned'. Possible values:
27                           
28                                versioned - Uses the Boost standard names
29                                which include version number for Boost the
30                                release and version and name of the
31                                compiler as part of the library names. Also
32                                installs the includes to a versioned
33                                sub-directory.
34                               
35                                system - Builds an install without the
36                                Boost standard names, and does not install
37                                includes to a versioned sub-directory. This
38                                is intended for system integrators to build
39                                for packaging of distributions.
40
41Locations:
42    --prefix=PREFIX         Install architecture independent files here.
43                            Default; C:\\Boost on Win32
44                            Default; /usr/local on Unix. Linux, etc.
45                           
46    --exec-prefix=EPREFIX   Install architecture dependent files here.
47                            Default; PREFIX
48                           
49    --libdir=DIR            Install libraries here.
50                            Default; EPREFIX/lib
51                           
52    --includedir=DIR        Install source headers here.
53                            Default; PREFIX/include
54                           
55    --builddir=DIR          Build in this location instead of building
56                            within the distribution tree. Recommended!
57                           
58    --stagedir=DIR          When staging only, stage to the location.
59                            Default; ./stage
60
61Features:
62    --with-<library>        Build, stage, or install the specified <library>
63                            If used, the default becomes to only build
64                            indicated libraries.
65                           
66    --without-<library>     Do not build, stage, or install the specified
67                            <library>. By default all libraries attempt to
68                            build.
69                           
70    --with-python-root[=PYTHON_ROOT]
71                            Build Boost.Python libraries with the Python
72                            devel packages located at PYTHON_ROOT.
73                            Default PYTHON_ROOT; C:\\Python24 on Win32.
74                            Default PYTHON_ROOT; /usr on Unix, Linux, Cygwin, etc.
75                           
76    --with-python-version[=2.4]
77                            Build Boost.Python libraries with the Python
78                            version indicated.
79                            Default; 2.4.
80                           
81    --with-pydebug          Build Boost.Python libraries using the
82                            Python debug runtime.
83" ;
84    EXIT "" ;
85}
86
87local with-install = ;
88local with-stage = ;
89
90# build only, or build+install
91if install in $(ARGV)
92{
93    with-install = install ;
94    with-stage = ;
95}
96
97# stage only? (no install, only build and stage to a common dir)
98if stage in $(ARGV)
99{
100    with-stage = stage ;
101    with-install = ;
102}
103
104# what kind of layout are we doing?
105local layout = [ MATCH "^--layout=(.*)" : $(ARGV) ] ;
106layout ?= versioned ;
107layout-$(layout) = true ;
108
109# possible stage only location
110local stage-locate = [ MATCH "^--stagedir=(.*)" : $(ARGV) ] ;
111stage-locate ?= stage ;
112
113# architecture independent files
114local boost-locate = [ unless $(with-stage) : [ MATCH "^--prefix=(.*)" : $(ARGV) ] : $(stage-locate) ] ;
115if $(NT) { boost-locate ?= C:\\Boost ; }
116else if $(UNIX) { boost-locate ?= /usr/local ; }
117
118# architecture dependent files
119local exec-locate = [ MATCH "^--exec-prefix=(.*)" : $(ARGV) ] ;
120exec-locate ?= $(boost-locate) ;
121
122# object code libraries
123local lib-locate = [ MATCH "^--libdir=(.*)" : $(ARGV) ] ;
124lib-locate ?= $(exec-locate)/lib ;
125
126# where to build
127local all-locate = [ MATCH "^--builddir=(.*)" : $(ARGV) ] ;
128ALL_LOCATE_TARGET ?= $(all-locate) ;
129
130# source header files
131local include-locate = [ MATCH "^--includedir=(.*)" : $(ARGV) ] ;
132include-locate ?= $(boost-locate)/include ;
133
134# location of python
135local python-root = [ MATCH "^--with-python-root=(.*)" : $(ARGV) ] ;
136PYTHON_ROOT ?= $(python-root) ;
137
138# version of python
139local python-version = [ MATCH "^--with-python-version=(.*)" : $(ARGV) ] ;
140PYTHON_VERSION ?= $(python-version) ;
141
142# variant for pydebug build
143local with-debug-python ;
144if --with-pydebug in $(ARGV)
145{
146    with-debug-python = debug-python ;
147}
148
149# libraries to disable building, etc.
150local without-libraries = [ MATCH "^--without-(.*)" : $(ARGV) ] ;
151
152# libraries to enable
153local with-libraries ;
154for local arg in $(ARGV)
155{
156    switch $(arg)
157    {
158        case --with-python-root=* : local _ ;
159        case --with-python-version=* : local _ ;
160        case --with-pydebug : local _ ;
161       
162        case --with-* :
163        with-libraries += [ MATCH "^--with-(.*)" : $(arg) ] ;
164    }
165}
166
167#
168project-root ;
169
170# bring in the rules for python
171import python ;
172
173# print out libraries to build/install
174if --show-libraries in $(ARGV)
175{
176    local library-jamfiles ;
177    library-jamfiles =
178        [ MATCH ^(.*build[/\\:]$(JAMFILE))$ :
179            [ glob-tree $(BOOST_ROOT)/libs : $(JAMFILE) ] ] ;
180    libraries =
181        [ MATCH ^.*libs[/\\:]([^/\\:]*)[/\\:]build[/\\:]Jamfile$ :
182            $(library-jamfiles) ] ;
183    EXIT $(libraries) ;
184}
185
186#
187local version-tag = [ MATCH "^([^.]+)[.]([^.]+)[.]([^.]+)" : $(BOOST_VERSION) ] ;
188if $(version-tag[3]) = 0
189{
190    version-tag = $(version-tag[1-2]) ;
191}
192version-tag = $(version-tag:J="_") ;
193
194#
195install-subinclude
196    [ MATCH ^(.*build[/\\:]$(JAMFILE))$ : [ glob-tree $(BOOST_ROOT)/libs : $(JAMFILE) ] ]
197    : <exclude>$(without-libraries) <include>$(with-libraries) ;
198
199local lib-sources = [ install-sources lib ] ;
200
201if $(lib-sources)
202{
203    local gNOWARN_INCOMPATIBLE_BUILDS = TRUE ;
204    local gUNVERSIONED_VARIANT_TAG = [ cond $(layout-system) : TRUE ] ;
205   
206    local lib-build =
207        debug release
208        [ cond $(with-debug-python) : debug-python ]
209        [ cond $(NT) : <runtime-link>static/dynamic ]
210        <threading>single/multi
211        ;
212    local lib-target =
213        [ cond $(with-install) : install : all ]
214        [ cond $(with-stage) : stage : all ]
215        ;
216    local lib-dest-files = [
217        stage $(lib-locate:D=)
218            :
219                $(lib-sources)
220            :
221                <locate>$(lib-locate:D)
222                common-variant-tag
223                <target>$(lib-target)
224            :
225                $(lib-build)
226                [ unless $(with-install) $(with-stage) : <suppress>true ]
227        ] ;
228    if ! $(gIN_LIB_INCLUDE) && $(layout-versioned)
229    {
230        local unversioned-files ;
231        if $(with-install) || $(with-stage)
232        {
233            if $(NT)
234            {
235                local version-files = [ MATCH "(.*[.]lib)" : $(lib-dest-files) ] ;
236                local noversion-files ;
237                for local version-file in $(version-files)
238                {
239                    local noversion-file =
240                        [ MATCH "(.*)-[0-9_]+([.]lib)" : $(version-file) ] ;
241                    noversion-file = $(noversion-file[1])$(noversion-file[2]) ;
242                    MakeLocate $(noversion-file) : [ FDirName [ split-path $(lib-locate) ] ] ;
243                    HardLink $(noversion-file) : $(version-file) ;
244                    noversion-files += $(noversion-file) ;
245                }
246                declare-fake-targets $(lib-target) : $(noversion-files) ;
247            }
248            else if $(UNIX)
249            {
250                local so-version-files = [ MATCH "(.*[.]so[.0-9]+)" : $(lib-dest-files) ] ;
251                so-version-files ?= [ MATCH "(.*[.]so)" : $(lib-dest-files) ] ;
252                local version-files = $(so-version-files) [ MATCH "(.*[.]a)" : $(lib-dest-files) ] ;
253                local noversion-files ;
254                for local version-file in $(version-files)
255                {
256                    local noversion-file =
257                        [ MATCH "(.*)-[0-9_]+([.]so)[.0-9]*" : $(version-file) ]
258                        [ MATCH "(.*)-[0-9_]+([.]a)" : $(version-file) ] ;
259                    noversion-file = $(noversion-file[1])$(noversion-file[2]) ;
260                    MakeLocate $(noversion-file) : [ FDirName [ split-path $(lib-locate) ] ] ;
261                    HardLink $(noversion-file) : $(version-file) ;
262                    noversion-files += $(noversion-file) ;
263                }
264                declare-fake-targets $(lib-target) : $(noversion-files) ;
265            }
266        }
267    }
268}
269
270stage [ cond $(layout-versioned) : $(include-locate:D=)/boost-$(version-tag) : $(include-locate:D=) ]
271    :
272        [ glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ]
273        [ glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc ]
274    :
275        <locate>$(include-locate:D)
276        <tree-subdirs>$(BOOST_ROOT)
277        [ cond $(with-install) : <target>install : <target>all ]
278    :
279        [ unless $(with-install) : <suppress>true ]
280    ;
Note: See TracBrowser for help on using the repository browser.