diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 14c01eeb7..6318f5056 100644 --- a/v2/tools/python.jam +++ b/v2/tools/python.jam @@ -622,7 +622,7 @@ local rule system-library-dependencies ( target-os ) # Declare a target to represent Python's library, returning the target # name. -local rule declare-libpython-target ( version ? : sys.platform : requirements * ) +local rule declare-libpython-target ( version ? : sys.platform ? : requirements * ) { # Compute the representation of Python version in the name of # Python's library file. @@ -804,17 +804,35 @@ local rule configure ( } } - # Declare the "python" target. This should really be called python_for_embedding + # See if we can find a framework directory on darwin + local framework-directory ; if $(target-os) = darwin { # Search upward for the framework directory - local fwk = $(libraries[-1]) ; - while $(fwk:D=) && $(fwk:D=) != Python.framework + local framework-directory = $(libraries[-1]) ; + while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework { - fwk = $(fwk:D) ; + framework-directory = $(framework-directory:D) ; } - debug-message framework directory is \"$(fwk)\" ; + if $(framework-directory) = Python.framework + { + debug-message framework directory is \"$(fwk)\" ; + } + else + { + debug-message no framework directory found; using library path ; + framework-directory = ; + } + } + + # + # Declare the "python" target. This should really be called + # python_for_embedding + # + + if $(framework-directory) + { alias python : : $(target-requirements)