Skip to content

Commit

Permalink
allow adding dll-path to usage requirements of searched libraries (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras authored May 23, 2024
1 parent 5cde9e8 commit 9242cd5
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/build/ac.jam
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ class ac-library : basic-target
self.target = $(target) ;
}

rule add-usage-requirements ( properties * )
{
self.extra-ureqs += $(properties) ;
}

rule check-not-configured ( )
{
if $(self.include-path) || $(self.library-path) || $(self.library-name) || $(self.target)
Expand All @@ -194,7 +199,8 @@ class ac-library : basic-target
{
if $(self.target)
{
return [ $(self.target).generate $(property-set) ] ;
local result = [ $(self.target).generate $(property-set) ] ;
return [ $(result[1]).add-raw $(self.extra-ureqs) ] $(result[2-]) ;
}
else
{
Expand Down Expand Up @@ -252,7 +258,8 @@ class ac-library : basic-target
local library = [ ac.construct-library $(lookup[2]) :
[ $(property-set).refine [ property-set.create $(lookup[3]) ] ] : $(library-path) ] ;
configure.log-library-search-result $(name) : "yes (cached)" $(min) ;
return [ $(library[1]).add-raw <include>$(includes) ] $(library[2-]) ;
return [ $(library[1]).add-raw <include>$(includes)
$(self.extra-ureqs) ] $(library[2-]) ;
}
}
else
Expand All @@ -269,7 +276,8 @@ class ac-library : basic-target
library = [ ac.construct-library $(library[1]) :
[ $(property-set).refine [ property-set.create $(library[2]) ] ] : $(library-path) ] ;
configure.log-library-search-result $(name) : "yes" $(min) ;
return [ $(library[1]).add-raw <include>$(includes) ] $(library[2-]) ;
return [ $(library[1]).add-raw <include>$(includes)
$(self.extra-ureqs) ] $(library[2-]) ;
}
else
{
Expand Down
5 changes: 5 additions & 0 deletions src/tools/bzip2.jam
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default library name.
# <include>
# The directory containing the bzip headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables BZIP2_LIBRARY_PATH, BZIP2_NAME, and BZIP2_INCLUDE will
Expand Down Expand Up @@ -117,6 +120,7 @@ rule init (
local include-path = [ feature.get-values <include> : $(options) ] ;
local source-path = [ feature.get-values <source> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;
local tag = [ feature.get-values <tag> : $(options) ] ;
local build-name = [ feature.get-values <build-name> : $(options) ] ;

Expand Down Expand Up @@ -239,6 +243,7 @@ rule init (
$(include-path) : $(library-path) : $(library-name) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
targets.main-target-alternative $(mt) ;
}
.configured.$(condition) = true ;
Expand Down
5 changes: 5 additions & 0 deletions src/tools/libjpeg.jam
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default library name.
# <include>
# The directory containing the libjpeg headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables LIBJPEG_LIBRARY_PATH, LIBJPEG_NAME, and LIBJPEG_INCLUDE will
Expand Down Expand Up @@ -123,6 +126,7 @@ rule init (
local include-path = [ feature.get-values <include> : $(options) ] ;
local source-path = [ feature.get-values <source> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;
local tag = [ feature.get-values <tag> : $(options) ] ;
local build-name = [ feature.get-values <build-name> : $(options) ] ;

Expand Down Expand Up @@ -208,6 +212,7 @@ rule init (
local mt = [ new ac-library libjpeg : $(.project) : $(condition) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
if $(target)
{
$(mt).set-target $(target) ;
Expand Down
5 changes: 5 additions & 0 deletions src/tools/libpng.jam
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default library name.
# <include>
# The directory containing the libpng headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables LIBPNG_LIBRARY_PATH, LIBPNG_NAME, and LIBPNG_INCLUDE will
Expand Down Expand Up @@ -118,6 +121,7 @@ rule init (
local include-path = [ feature.get-values <include> : $(options) ] ;
local source-path = [ feature.get-values <source> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;
local tag = [ feature.get-values <tag> : $(options) ] ;
local build-name = [ feature.get-values <build-name> : $(options) ] ;

Expand Down Expand Up @@ -204,6 +208,7 @@ rule init (
local mt = [ new ac-library libpng : $(.project) : $(condition) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
if $(target)
{
$(mt).set-target $(target) ;
Expand Down
5 changes: 5 additions & 0 deletions src/tools/libtiff.jam
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default library name.
# <include>
# The directory containing the libtiff headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables LIBTIFF_LIBRARY_PATH, LIBTIFF_NAME, and LIBTIFF_INCLUDE will
Expand Down Expand Up @@ -117,6 +120,7 @@ rule init (
local include-path = [ feature.get-values <include> : $(options) ] ;
local source-path = [ feature.get-values <source> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;
local tag = [ feature.get-values <tag> : $(options) ] ;
local build-name = [ feature.get-values <build-name> : $(options) ] ;

Expand Down Expand Up @@ -202,6 +206,7 @@ rule init (
local mt = [ new ac-library libtiff : $(.project) : $(condition) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
if $(target)
{
$(mt).set-target $(target) ;
Expand Down
5 changes: 5 additions & 0 deletions src/tools/lzma.jam
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default library name.
# <include>
# The directory containing the lzma headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables LZMA_LIBRARY_PATH, LZMA_NAME, and LZMA_INCLUDE will
Expand Down Expand Up @@ -89,6 +92,7 @@ rule init (
local library-path = [ feature.get-values <search> : $(options) ] ;
local include-path = [ feature.get-values <include> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;

if ! $(options)
{
Expand Down Expand Up @@ -128,6 +132,7 @@ rule init (
$(include-path) : $(library-path) : $(library-name) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
targets.main-target-alternative $(mt) ;
}
.configured.$(condition) = true ;
Expand Down
6 changes: 6 additions & 0 deletions src/tools/openssl.jam
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default name of crypto library.
# <include>
# The directory containing the openssl headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables OPENSSL_LIBRARY_PATH, OPENSSL_NAME, and OPENSSL_INCLUDE will
Expand Down Expand Up @@ -90,6 +93,7 @@ rule init (
local include-path = [ feature.get-values <include> : $(options) ] ;
local ssl-name = [ feature.get-values <ssl-name> : $(options) ] ;
local crypto-name = [ feature.get-values <crypto-name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;

if ! $(library-path) && ! $(include-path) && ! $(source-path) && ! $(ssl-name) && ! $(crypto-name)
{
Expand Down Expand Up @@ -132,11 +136,13 @@ rule init (
$(include-path) : $(library-path) ] ;
$(ssl_lib).set-header openssl/ssl.h ;
$(ssl_lib).set-default-names $(ssl-name) ;
$(ssl_lib).add-usage-requirements $(dll-paths) ;

local crypto_lib = [ new ac-library crypto : $(.project) : $(condition) :
$(include-path) : $(library-path) ] ;
$(crypto_lib).set-header openssl/crypto.h ;
$(crypto_lib).set-default-names $(crypto-name) ;
$(crypto_lib).add-usage-requirements $(dll-paths) ;

targets.main-target-alternative $(ssl_lib) ;
targets.main-target-alternative $(crypto_lib) ;
Expand Down
5 changes: 5 additions & 0 deletions src/tools/zlib.jam
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ if --debug-configuration in [ modules.peek : ARGV ]
# Overrides the default library name.
# <include>
# The directory containing the zlib headers.
# <dll-path>
# Extra directories to add to library search paths of consumers during
# runtime (multiple instances are allowed).
#
# If none of these options is specified, then the environmental
# variables ZLIB_LIBRARY_PATH, ZLIB_NAME, and ZLIB_INCLUDE will
Expand Down Expand Up @@ -116,6 +119,7 @@ rule init (
local include-path = [ feature.get-values <include> : $(options) ] ;
local source-path = [ feature.get-values <source> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;
local tag = [ feature.get-values <tag> : $(options) ] ;
local build-name = [ feature.get-values <build-name> : $(options) ] ;

Expand Down Expand Up @@ -208,6 +212,7 @@ rule init (
local mt = [ new ac-library zlib : $(.project) : $(condition) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
if $(target)
{
$(mt).set-target $(target) ;
Expand Down
2 changes: 2 additions & 0 deletions src/tools/zstd.jam
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ rule init (
local library-path = [ feature.get-values <search> : $(options) ] ;
local include-path = [ feature.get-values <include> : $(options) ] ;
local library-name = [ feature.get-values <name> : $(options) ] ;
local dll-paths = [ property.select <dll-path> : $(options) ] ;

condition = [ property-set.create $(requirements) ] ;
condition = [ property-set.create [ $(condition).base ] ] ;
Expand Down Expand Up @@ -94,6 +95,7 @@ rule init (
$(include-path) : $(library-path) : $(library-name) ] ;
$(mt).set-header $(header) ;
$(mt).set-default-names $(names) ;
$(mt).add-usage-requirements $(dll-paths) ;
targets.main-target-alternative $(mt) ;
}
.configured.$(condition) = true ;
Expand Down

0 comments on commit 9242cd5

Please sign in to comment.