| 1 | # Copyright (C) Reece H. Dunn 2005.
|
|---|
| 2 | # Based on the wix.jam file by Peter Foley.
|
|---|
| 3 | #
|
|---|
| 4 | # Use, modification and distribution is subject to the Boost Software
|
|---|
| 5 | # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
|
|---|
| 6 | # http://www.boost.org/LICENSE_1_0.txt)
|
|---|
| 7 |
|
|---|
| 8 | import feature : feature get-values ;
|
|---|
| 9 | import common ;
|
|---|
| 10 | import toolset : flags ;
|
|---|
| 11 | import type ;
|
|---|
| 12 | import generators ;
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | feature.extend toolset : wix ;
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | space = " " ;
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | type.register WXS : wxs ; # WiX Source file
|
|---|
| 22 | type.register WXI : wxi ; # WiX Include file
|
|---|
| 23 | type.register WXL : wxl ; # WiX Localisation file
|
|---|
| 24 | type.register WIXOBJ : wixobj ; # WiX Object file
|
|---|
| 25 | type.register WIXLIB : wixlib ; # WiX Library file
|
|---|
| 26 | type.register MSI : msi ; # Installer
|
|---|
| 27 | type.register MSM : msm ; # Merge Module
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | feature linkoptions : : free ;
|
|---|
| 31 | feature compileoptions : : free ;
|
|---|
| 32 |
|
|---|
| 33 | feature identical-rows : no yes : optional ;
|
|---|
| 34 | feature unresolved-references : no yes : optional ;
|
|---|
| 35 |
|
|---|
| 36 | feature search-path : : path free ;
|
|---|
| 37 |
|
|---|
| 38 | feature localisation : : path free ;
|
|---|
| 39 |
|
|---|
| 40 | rule init ( version ? : command * : options * )
|
|---|
| 41 | {
|
|---|
| 42 | compiler = candle ;
|
|---|
| 43 | linker = light ;
|
|---|
| 44 | local condition = [ common.check-init-parameters wix : version $(version) ] ;
|
|---|
| 45 |
|
|---|
| 46 | local prefix ;
|
|---|
| 47 |
|
|---|
| 48 | local wix-location = [ MATCH "^--wix=(.*)" : [ modules.peek : ARGV ] ] ;
|
|---|
| 49 | if $(wix-location) {
|
|---|
| 50 | prefix = $(wix-location)\\bin\\ ;
|
|---|
| 51 | } else {
|
|---|
| 52 | command = [ common.get-invocation-command wix : candle.exe : $(command) ] ;
|
|---|
| 53 | if $(command) {
|
|---|
| 54 | local abs-path = [ common.get-absolute-tool-path $(command[-1]) ] ;
|
|---|
| 55 | local prefix = $(abs-path)\\ ;
|
|---|
| 56 | } else {
|
|---|
| 57 | echo "Could not find WIX location (please use --wix=<path> to specify the location)" ;
|
|---|
| 58 | }
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | flags wix.compile .CC $(condition) : $(prefix)$(compiler) ;
|
|---|
| 62 | flags wix.link .LD $(condition) : $(prefix)$(linker) ;
|
|---|
| 63 |
|
|---|
| 64 | echo "Using WIX Compiler: $(prefix)$(compiler)" ;
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | ## Compiler
|
|---|
| 68 |
|
|---|
| 69 | generators.register-standard wix.compile.wxs : WXS : WIXOBJ ;
|
|---|
| 70 |
|
|---|
| 71 | flags wix.compile OPTIONS <compileoptions> ;
|
|---|
| 72 |
|
|---|
| 73 | flags wix.compile INCLUDES <include> ;
|
|---|
| 74 | flags wix.compile DEFINES <define> ;
|
|---|
| 75 |
|
|---|
| 76 | actions compile.wxs
|
|---|
| 77 | {
|
|---|
| 78 | echo "$(.CC)" -nologo "$(OPTIONS)" -d"$(DEFINES)" -I"$(INCLUDES)" -out "$(<)" "$(>)"
|
|---|
| 79 | "$(.CC)" -nologo "$(OPTIONS)" -d"$(DEFINES)" -I"$(INCLUDES)" -out "$(<)" "$(>)"
|
|---|
| 80 | }
|
|---|
| 81 |
|
|---|
| 82 | ## Linker
|
|---|
| 83 |
|
|---|
| 84 | generators.register-composing wix.link.msi : WIXOBJ WIXLIB : MSI ;
|
|---|
| 85 |
|
|---|
| 86 | flags wix.link OPTIONS <linkoptions> ;
|
|---|
| 87 | flags wix.link LOCALISATION <localisation> ;
|
|---|
| 88 | flags wix.link SEARCH_PATH <search-path> ;
|
|---|
| 89 |
|
|---|
| 90 | flags wix.link OPTIONS <identical-rows>yes : -ai ;
|
|---|
| 91 | flags wix.link OPTIONS <unresolved-references>yes : -au ;
|
|---|
| 92 |
|
|---|
| 93 | actions link.msi
|
|---|
| 94 | {
|
|---|
| 95 | echo "$(.LD)" -nologo -b$(space)"$(SEARCH_PATH)" "$(OPTIONS)" -loc$(space)"$(LOCALISATION)" -out "$(<)" "$(>)"
|
|---|
| 96 | "$(.LD)" -nologo -b$(space)"$(SEARCH_PATH)" "$(OPTIONS)" -loc$(space)"$(LOCALISATION)" -out "$(<)" "$(>)"
|
|---|
| 97 | }
|
|---|