|
@@ -6,6 +6,7 @@ import sys
|
|
|
import os
|
|
import os
|
|
|
import marshal
|
|
import marshal
|
|
|
import imp
|
|
import imp
|
|
|
|
|
+from distutils.sysconfig import get_python_inc, get_python_lib, get_python_version
|
|
|
|
|
|
|
|
import direct
|
|
import direct
|
|
|
from pandac.PandaModules import *
|
|
from pandac.PandaModules import *
|
|
@@ -36,7 +37,9 @@ linkDll = 'error'
|
|
|
Python = None
|
|
Python = None
|
|
|
|
|
|
|
|
# The directory that includes Python.h.
|
|
# The directory that includes Python.h.
|
|
|
-PythonIPath = None
|
|
|
|
|
|
|
+PythonIPath = get_python_inc()
|
|
|
|
|
+PythonLPath = get_python_lib()
|
|
|
|
|
+PythonVersion = get_python_version()
|
|
|
|
|
|
|
|
# The root directory of Microsoft Visual Studio (if relevant)
|
|
# The root directory of Microsoft Visual Studio (if relevant)
|
|
|
MSVS = None
|
|
MSVS = None
|
|
@@ -61,9 +64,9 @@ elif sys.platform == 'darwin':
|
|
|
|
|
|
|
|
else:
|
|
else:
|
|
|
# Linux
|
|
# Linux
|
|
|
- compileObj = "gcc -fPIC -c -o %(basename)s.o -O2 %(filename)s"
|
|
|
|
|
- linkExe = "gcc -o %(basename)s %(basename)s.o"
|
|
|
|
|
- linkDll = "gcc -shared -o %(basename)s.so %(basename)s.o"
|
|
|
|
|
|
|
+ compileObj = "gcc -fPIC -c -o %(basename)s.o -O2 %(filename)s -I %(pythonIPath)s"
|
|
|
|
|
+ linkExe = "gcc -o %(basename)s %(basename)s.o -lpython2.6 -L %(pythonLPath)s"
|
|
|
|
|
+ linkDll = "gcc -shared -o %(basename)s.so %(basename)s.o -lpython%(pythonVersion)s -L %(pythonLPath)s"
|
|
|
|
|
|
|
|
# The code from frozenmain.c in the Python source repository.
|
|
# The code from frozenmain.c in the Python source repository.
|
|
|
frozenMainCode = """
|
|
frozenMainCode = """
|
|
@@ -770,6 +773,8 @@ class Freezer:
|
|
|
'python' : Python,
|
|
'python' : Python,
|
|
|
'msvs' : MSVS,
|
|
'msvs' : MSVS,
|
|
|
'pythonIPath' : PythonIPath,
|
|
'pythonIPath' : PythonIPath,
|
|
|
|
|
+ 'pythonLPath' : PythonLPath,
|
|
|
|
|
+ 'pythonVersion' : PythonVersion,
|
|
|
'filename' : filename,
|
|
'filename' : filename,
|
|
|
'basename' : basename,
|
|
'basename' : basename,
|
|
|
}
|
|
}
|
|
@@ -792,6 +797,8 @@ class Freezer:
|
|
|
'python' : Python,
|
|
'python' : Python,
|
|
|
'msvs' : MSVS,
|
|
'msvs' : MSVS,
|
|
|
'pythonIPath' : PythonIPath,
|
|
'pythonIPath' : PythonIPath,
|
|
|
|
|
+ 'pythonLPath' : PythonLPath,
|
|
|
|
|
+ 'pythonVersion' : PythonVersion,
|
|
|
'filename' : filename,
|
|
'filename' : filename,
|
|
|
'basename' : basename,
|
|
'basename' : basename,
|
|
|
}
|
|
}
|