Lines Matching +full:post +full:- +full:require +full:- +full:hook
2 # Copyright Vladimir Prus 2002-2010.
3 # Copyright Dave Abrahams 2005-2006.
4 # Copyright Rene Rivera 2005-2007.
14 import build-system ;
28 import version : version-less ;
39 rule set-version ( version )
43 local version-tag =
45 if $(version-tag[3]) = 0
47 version-tag = $(version-tag[1-2]) ;
49 BOOST_VERSION_TAG = $(version-tag:J=_) ;
53 build-type = [ option.get build-type ] ;
54 build-type ?= minimal ;
55 if ! ( $(build-type) in complete minimal )
57 EXIT The value of the --build-type option should be either 'complete' or
64 layout = [ MATCH (versioned|tagged|system)(-(.+))? : $(layout) ] ;
67 layout-version = $(layout[3]) ;
69 if [ version-less [ regex.split $(layout-version) "[.]" ] : 1 66 ]
71 layout-version = 1.40 ;
73 else if [ version-less [ regex.split $(layout-version) "[.]" ] : 1 69 ]
75 layout-version = 1.66 ;
78 layout-version ?= 1.69 ;
95 layout-$(layout) = true ;
97 if $(layout) = system && $(build-type) = complete
99 ECHO error\: Cannot use --layout=system with --build-type complete. ;
100 ECHO error\: Please use either --layout=versioned or --layout=tagged ;
104 ECHO error\: Note that --layout=system is used by default on Unix
111 stage-locate = [ option.get stagedir ] ;
113 if $(stage-locate)
115 stage-locate = [ path.root [ path.make $(stage-locate) ] [ path.pwd ] ] ;
119 stage-locate = $(BOOST_ROOT)/stage ;
122 BOOST_STAGE_LOCATE = $(stage-locate) ;
125 build-id = [ option.get buildid ] ;
126 if $(build-id)
128 BUILD_ID = [ regex.replace $(build-id) "[*\\/:.\"\' ]" _ ] ;
132 python-id = [ option.get "python-buildid" ] ;
133 if $(python-id)
135 PYTHON_ID = [ regex.replace $(python-id) "[*\\/:.\"\']" _ ] ;
141 switch $(layout-version)
144 .format-name-args =
147 .format-name-args =
148 <base> <toolset> <threading> <runtime> <arch-and-model> ;
150 .format-name-args =
151 <base> <toolset> <threading> <runtime> <arch-and-model> ;
156 switch $(layout-version)
159 .format-name-args =
162 .format-name-args =
165 .format-name-args =
166 <base> <threading> <runtime> <arch-and-model> ;
171 .format-name-args = <base> ;
175 .format-name-error = true ;
186 rule tag ( name : type ? : property-set )
190 local args = $(.format-name-args) ;
193 args += -$(BOOST_VERSION_TAG) ;
195 local result = [ common.format-name
196 $(args) -$(BUILD_ID)
197 : $(name) : $(type) : $(property-set) ] ;
198 if $(.format-name-error)
206 # version suffix is not needed -- the linker expects the
210 ! [ $(property-set).get <target-os> ] in windows cygwin darwin aix &&
211 ! [ $(property-set).get <toolset> ] in pgi
221 # Appends value of --python-buildid if provided.
222 rule python-tag ( name : type ? : property-set )
230 local version = [ $(property-set).get <python> ] ;
232 local major-minor = [ MATCH "^([0-9]+)\.([0-9]+)" : $(version) ] ;
233 local suffix = $(major-minor:J="") ;
244 result = $(result)-$(PYTHON_ID) ;
249 return [ tag $(result) : $(type) : $(property-set) ] ;
256 # - 'stage-proper' that puts all libraries in stage/lib
257 # - 'install-proper' that install libraries and headers to system location
265 alias install-proper : libs/$(libraries)/build//install ;
266 $(p).mark-target-as-explicit install-proper ;
268 alias stage-proper : libs/$(libraries)/build//stage ;
269 $(p).mark-target-as-explicit stage-proper ;
275 # 3. Declare top-level targets 'stage' and 'install'. These examine the
276 # --build-type option and, in case it is 'complete', build the 'install-proper'
277 # and 'stage-proper' targets with a number of property sets.
281 class top-level-target : alias-target-class
286 : default-build * : usage-requirements * )
288 alias-target-class.__init__ $(name) : $(project) : $(sources) :
289 $(requirements) : $(default-build) : $(usage-requirements) ;
291 self.build-type = [ modules.peek boostcpp : build-type ] ;
296 # (.so in libfoo and .a in libfoo-dev).
298 self.minimal-properties = [ property-set.create <variant>release
299 <threading>multi <link>shared <link>static <runtime-link>shared ] ;
303 # runtime-link=dynamic, threading=multi, variant=(debug|release)
307 self.minimal-properties-win = [ property-set.create <variant>debug
308 <variant>release <threading>multi <link>static <runtime-link>shared
309 <address-model>32 <address-model>64 ] ;
311 self.complete-properties = [ property-set.create
315 <runtime-link>shared <runtime-link>static ] ;
317 self.complete-properties-win = [ property-set.create
321 <runtime-link>shared <runtime-link>static
322 <address-model>32 <address-model>64 ] ;
325 rule generate ( property-set )
327 modules.poke : top-level-targets : [ modules.peek : top-level-targets ]
330 local os = [ $(property-set).get <target-os> ] ;
337 os = [ feature.defaults <target-os> ] ;
341 local build-type-set ;
343 if $(self.build-type) = minimal
347 build-type-set = $(self.minimal-properties-win) ;
351 build-type-set = $(self.minimal-properties) ;
354 else if $(self.build-type) = complete
358 build-type-set = $(self.complete-properties-win) ;
362 build-type-set = $(self.complete-properties) ;
371 if $(build-type-set)
373 local expanded = [ targets.apply-default-build $(property-set)
374 : $(build-type-set) ] ;
380 # See comment in handle-static-runtime regarding this logic.
382 && [ $(p).get <runtime-link> ] = static
393 return [ build-multiple $(filtered) ] ;
397 rule build-multiple ( property-sets * )
399 local usage-requirements = [ property-set.empty ] ;
401 for local p in $(property-sets)
403 local r = [ alias-target-class.generate $(p) ] ;
406 usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;
407 result += $(r[2-]) ;
410 return $(usage-requirements) [ sequence.unique $(result) ] ;
418 targets.create-metatarget top-level-target : [ project.current ]
420 : install-proper
422 targets.create-metatarget top-level-target : [ project.current ]
424 : stage-proper headers
428 $(p).mark-target-as-explicit install stage ;
432 targets.create-metatarget top-level-target : [ project.current ]
441 # 4. Add hook to report configuration before the build, and confirmation with
448 $(p).mark-target-as-explicit explain ;
450 rule pre-build ( )
452 local tl = [ modules.peek : top-level-targets ] ;
458 configure.print-component-configuration ;
462 IMPORT $(__name__) : pre-build : : $(__name__).pre-build ;
463 build-system.set-pre-build-hook $(__name__).pre-build ;
465 rule post-build ( ok ? )
467 if forward in [ modules.peek : top-level-targets ]
471 local include-path = [ path.native $(BOOST_ROOT) ] ;
472 local stage-abs = [ path.native $(stage-locate)/lib ] ;
480 $(include-path)
484 $(stage-abs)
489 IMPORT $(__name__) : post-build : : $(__name__).post-build ;
490 build-system.set-post-build-hook $(__name__).post-build ;
495 # 5. Top-level setup.
499 # Decides which libraries are to be installed by looking at --with-<library>
500 # --without-<library> arguments. Returns the list of directories under "libs"
503 rule libraries-to-install ( existing-libs * )
506 local with-parameter = [ MATCH ^--with-(.*) : $(argv) ] ;
507 local without-parameter = [ MATCH ^--without-(.*) : $(argv) ] ;
509 if ! $(with-parameter) && ! $(without-parameter)
511 # Nothing is specified on command line. See if maybe project-config.jam
513 local libs = [ modules.peek project-config : libraries ] ;
514 with-parameter = [ MATCH ^--with-(.*) : $(libs) ] ;
515 without-parameter = [ MATCH ^--without-(.*) : $(libs) ] ;
519 if $(with-parameter) && $(without-parameter)
521 EXIT error\: both --with-<library> and --without-<library> specified ;
524 local wrong = [ set.difference $(with-parameter) : $(existing-libs) ] ;
527 EXIT error\: wrong library name '$(wrong[1])' in the --with-<library>
530 local wrong = [ set.difference $(without-parameter) : $(existing-libs) ] ;
533 EXIT error\: wrong library name '$(wrong[1])' in the --without-<library>
537 if $(with-parameter)
539 return [ set.intersection $(existing-libs) : $(with-parameter) ] ;
543 return [ set.difference $(existing-libs) : $(without-parameter) ] ;
547 rule declare-targets ( all-libraries * )
549 configure.register-components $(all-libraries) ;
552 libraries = [ libraries-to-install $(all-libraries) ] ;
553 configure.components-building $(libraries) ;
555 if [ option.get "show-libraries" : : true ]
557 ECHO The following libraries require building\: ;
560 ECHO " - $(l)" ;
570 # configure.builds, except we don't use address-model and
571 # architecture - as we're trying to detect them here.
573 rule toolset-properties ( properties * )
576 local toolset-version-property = "<toolset-$(toolset:G=):version>" ;
577 return [ property.select <target-os> <toolset> $(toolset-version-property) : $(properties) ] ;
580 feature.feature deduced-address-model : 32 64 : propagated optional composite hidden ;
581 feature.compose <deduced-address-model>32 : <address-model>32 ;
582 feature.compose <deduced-address-model>64 : <address-model>64 ;
584 rule deduce-address-model ( properties * )
587 local filtered = [ toolset-properties $(properties) ] ;
589 local idx = [ configure.find-builds "default address-model" : $(filtered)
590 : /boost/architecture//32 "32-bit"
591 : /boost/architecture//64 "64-bit" ] ;
598 # deduced default, so also pick whatever address-model is explicitly
600 … result = <deduced-address-model>$(result) [ property.select <address-model> : $(properties) ] ;
605 rule address-model ( )
607 return <conditional>@boostcpp.deduce-address-model ;
610 local deducable-architectures = arm mips1 power riscv s390x sparc x86 combined ;
611 feature.feature deduced-architecture : $(deducable-architectures) : propagated optional composite h…
612 for a in $(deducable-architectures)
614 feature.compose <deduced-architecture>$(a) : <architecture>$(a) ;
617 rule deduce-architecture ( properties * )
620 local filtered = [ toolset-properties $(properties) ] ;
622 local idx = [ configure.find-builds "default architecture" : $(filtered)
635 # See comment in deduce-address-model.
636 … result = <deduced-architecture>$(result) [ property.select <architecture> : $(properties) ] ;
643 return <conditional>@boostcpp.deduce-architecture ;