Skip to content
Snippets Groups Projects
Commit 546c735f authored by pospelov's avatar pospelov
Browse files

Attempt to make Py++ working from linux

parent 2fef3fb6
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import os import os
import sys import sys
import glob import glob
import subprocess
from pyplusplus import module_builder from pyplusplus import module_builder
from pyplusplus.module_builder import call_policies from pyplusplus.module_builder import call_policies
from pyplusplus import messages from pyplusplus import messages
...@@ -454,10 +455,34 @@ def MakePythonAPI(OutputTempDir): ...@@ -454,10 +455,34 @@ def MakePythonAPI(OutputTempDir):
#GCCXML_CXXFLAGS="" #GCCXML_CXXFLAGS=""
#myIncludes.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7') #myIncludes.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7')
#myIncludes.append('/opt/local/include/')
#---------------------------------------------------------------
# getting paths
#---------------------------------------------------------------
myIncludes.append(sys.prefix +"/include/python"+ sys.version[:3]) myIncludes.append(sys.prefix +"/include/python"+ sys.version[:3])
myIncludes.append('/opt/local/include/') # looking for general headers
mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin', cflags="-m64") proc = subprocess.Popen(["which g++"], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
path = out.strip()
if path.endswith("bin/g++"):
myIncludes.append(path[:-7]+"include")
else:
exit("Can't find g++")
# looking for gccxml
proc = subprocess.Popen(["which gccxml"], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
path = out.strip()
if path.endswith("/gccxml"):
mygccxml = path[:-7]
else:
exit("No gccxml!")
print myIncludes
print mygccxml
mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path=mygccxml, cflags="-m64")
#mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin', cflags="-m64")
#mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin') #mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin')
# --------------------------------------------------------- # ---------------------------------------------------------
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import os import os
import sys import sys
import glob import glob
import subprocess
from pyplusplus import module_builder from pyplusplus import module_builder
from pyplusplus.module_builder import call_policies from pyplusplus.module_builder import call_policies
from pyplusplus import messages from pyplusplus import messages
...@@ -111,9 +112,37 @@ def MakePythonAPI(OutputTempDir): ...@@ -111,9 +112,37 @@ def MakePythonAPI(OutputTempDir):
multiple_files_t.HEADER_EXT='.pypp.h' multiple_files_t.HEADER_EXT='.pypp.h'
multiple_files_t.SOURCE_EXT='.pypp.cpp' multiple_files_t.SOURCE_EXT='.pypp.cpp'
myIncludes.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7')
myIncludes.append('/opt/local/include/') #---------------------------------------------------------------
mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin', cflags="-m64") # getting paths
#---------------------------------------------------------------
myIncludes.append(sys.prefix +"/include/python"+ sys.version[:3])
# looking for general headers
proc = subprocess.Popen(["which g++"], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
path = out.strip()
if path.endswith("bin/g++"):
myIncludes.append(path[:-7]+"include")
else:
exit("Can't find g++")
# looking for gccxml
proc = subprocess.Popen(["which gccxml"], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
path = out.strip()
if path.endswith("/gccxml"):
mygccxml = path[:-7]
else:
exit("No gccxml!")
print myIncludes
print mygccxml
mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path=mygccxml, cflags="-m64")
#myIncludes.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7')
#myIncludes.append('/opt/local/include/')
#mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin', cflags="-m64")
#mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin') #mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin')
# --------------------------------------------------------- # ---------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment