diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 1ead6c8f8..28ad9c0ae 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -17,6 +17,12 @@ import set ; import common ; import errors ; +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} + + feature.extend toolset : gcc ; import unix ; @@ -28,7 +34,6 @@ generators.override gcc.prebuilt : builtin.prebuilt ; generators.override gcc.searched-lib-generator : searched-lib-generator ; - # Make the "o" suffix used for gcc toolset on all # platforms type.set-generated-target-suffix OBJ : gcc : o ; @@ -60,11 +65,21 @@ rule init ( version ? : command * : options * ) # If gcc is installed in non-standard location, we'd need to # add LD_LIBRARY_PATH when running programs created with it - # (for unit-test/run rules). + # (for unit-test/run rules). if $(command) { - local path = [ common.get-absolute-tool-path $(command[-1]) ] ; - local lib_path = $(path:D)/lib ; + local root = [ feature.get-values : $(options) ] ; + if ! $(root) + { + root = [ common.get-absolute-tool-path $(command[-1]) ] ; + root = $(root:D) ; + } + local lib_path = $(root)/lib ; + if $(.debug-configuration) + { + ECHO "notice: gcc lib directory for version" $(condition) ; + ECHO "notice: is" $(lib_path) ; + } flags gcc.link RUN_PATH $(condition) : $(lib_path) ; }