Browse Source

added PYTHON_FRAMEWORK

Dave Schuyler 22 years ago
parent
commit
9693d442cd

+ 2 - 0
dtool/LocalSetup.pp

@@ -15,6 +15,8 @@
 
 /* Define if we have Python installed.  */
 $[cdefine HAVE_PYTHON]
+/* Define if we have Python as a framework (Mac OS X).  */
+$[cdefine PYTHON_FRAMEWORK]
 
 /* Define if we have RAD game tools, Miles Sound System installed.  */
 $[cdefine HAVE_RAD_MSS]

+ 6 - 1
dtool/metalibs/dtoolconfig/pydtool.cxx

@@ -9,7 +9,12 @@
 #include "dtoolbase.h"
 
 #undef HAVE_LONG_LONG
-#include "Python.h"
+
+#ifdef PYTHON_FRAMEWORK
+  #include "Python/Python.h"
+#else
+  #include "Python.h"
+#endif
 
 extern "C" {
 

+ 6 - 2
dtool/src/interrogate/interfaceMakerPython.cxx

@@ -41,8 +41,12 @@ InterfaceMakerPython(InterrogateModuleDef *def) :
 void InterfaceMakerPython::
 write_includes(ostream &out) {
   InterfaceMaker::write_includes(out);
-  out << "#undef HAVE_LONG_LONG\n"
-      << "#include <Python.h>\n\n";
+  out << "#undef HAVE_LONG_LONG\n\n"
+      << "#if PYTHON_FRAMEWORK\n"
+      << "  #include \"Python/Python.h\"\n"
+      << "#else\n"
+      << "  #include \"Python.h\"\n"
+      << "#endif\n\n";
 }
 
 ////////////////////////////////////////////////////////////////////