subproject libs/python ;

# bring in the rules for python
SEARCH on <module@>python.jam = $(BOOST_BUILD_PATH) ;
include <module@>python.jam ;

PYTHON_PROPERTIES 
  += <metrowerks><*><cxxflags>"-inline deferred" 
  <cxx><*><include>$(BOOST_ROOT)/boost/compatibility/cpp_c_headers
    <define>BOOST_PYTHON_DYNAMIC_LIB
    <define>BOOST_PYTHON_V2
    ;

{
    dll bpl
      : 
      src/converter/from_python.cpp
      src/converter/registry.cpp
      src/converter/type_id.cpp
      src/object/class.cpp
      src/object/function.cpp
      src/object/inheritance.cpp
      src/object/life_support.cpp
      src/errors.cpp
      src/module.cpp
      src/objects.cpp
      src/converter/builtin_converters.cpp
      :
      $(PYTHON_PROPERTIES)
        <define>BOOST_PYTHON_SOURCE
        ;

    # -------- general test -------
    extension m1 : test/m1.cpp <lib>bpl
      : 
      : debug-python
      ;

    extension m2 : test/m2.cpp <lib>bpl
      : 
      : debug-python ;

    boost-python-runtest try : test/newtest.py <lib>m1 <lib>m2 : : debug-python ;

    # ----------- builtin converters -----------
    
    extension builtin_converters_ext : test/test_builtin_converters.cpp <lib>bpl
      :
      : debug-python
      ;

    boost-python-runtest test_builtin_converters : test/test_builtin_converters.py
      <lib>builtin_converters_ext
      :
      : debug-python
      ;
    
    # ----------- pointer adoption -----------
    
    extension test_pointer_adoption_ext : test/test_pointer_adoption.cpp <lib>bpl
      :
      : debug-python
      ;

    boost-python-runtest test_pointer_adoption : test/test_pointer_adoption.py
      <lib>test_pointer_adoption_ext
      :
      : debug-python
      ;
}
