[MacPorts] #17405: different boost update

MacPorts noreply at macports.org
Thu Dec 4 10:17:26 PST 2008


#17405: different boost update
----------------------------------+-----------------------------------------
 Reporter:  andrew@…              |       Owner:  sanchom@…        
     Type:  enhancement           |      Status:  new              
 Priority:  Normal                |   Milestone:  Port Updates     
Component:  ports                 |     Version:  1.6.0            
 Keywords:                        |        Port:  boost            
----------------------------------+-----------------------------------------

Comment(by andrew@…):

 Even better - the whole boost-python interface appears to work.

 Makefile :
 {{{
 YFRM = /opt/local/Library/Frameworks/Python.framework/Versions/2.6
 PYINC = -I$(PYFRM)/include/python2.6
 -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
 MACPT = -I/opt/local/include -L/opt/local/lib
 LIBS = -dynamiclib -lboost_python-xgcc40-mt -lpython2.6

 hello.so : hello.cpp
         $(CXX) $(MACPT) $(PYINC) $? $(LIBS) -o $@

 .PHONY : test clean

 test : test.py
         ./test.py

 clean :
         rm -f hello.so
 }}}

 hello.cpp :
 {{{
 char const* greet()
 {
    return "hello, world";
 }

 #include <boost/python.hpp>

 BOOST_PYTHON_MODULE(hello)
 {
     using namespace boost::python;
     def("greet", greet);
 }
 }}}

 test.py :
 {{{
 #!/usr/bin/env python2.6

 import sys

 sys.path.append('.')

 import hello

 print hello.greet()
 }}}

-- 
Ticket URL: <http://trac.macports.org/ticket/17405#comment:6>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list