]> granicus.if.org Git - python/commitdiff
Mods to make WASTE module compile and link for MachoPython. Not tested
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 9 Dec 2001 23:08:54 +0000 (23:08 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 9 Dec 2001 23:08:54 +0000 (23:08 +0000)
any further, yet.

Mac/Wastemods/WEObjectHandlers.h
Mac/Wastemods/WETabHooks.h
Mac/Wastemods/WETabs.c
Mac/Wastemods/WETabs.h
setup.py

index d73a490c4220a877f3652726d56b869fe3e06422..ac6e567b2ce8b78d145ea34d17642633c82b761b 100644 (file)
@@ -5,7 +5,9 @@
        Copyright © 1993-1998 Marco Piovanelli
        All Rights Reserved
 */
-
+#ifndef WITHOUT_FRAMEWORKS
+#include <Carbon/Carbon.h>
+#endif
 #ifndef _WASTE_
 #include "WASTE.h"
 #endif
index 6405426f0657c3d28a8538e256613417cc003f2e..635db74ffce56d101b96062b0cf08431a483ebc2 100644 (file)
@@ -10,6 +10,9 @@
  */
 
 
+#ifndef WITHOUT_FRAMEWORKS
+#include <Carbon/Carbon.h>
+#endif
 #ifndef _WASTE_
 #include "WASTE.h"
 #endif
index 6f59e371cae38093d01d9a334c70de3675b2d374..1a0291eb0bebc08ce9028f72e4ca925f019b4e64 100644 (file)
@@ -10,7 +10,7 @@
 #include "WETabs.h"
 #include "WETabHooks.h"
 
-#ifndef __ERRORS__
+#if !defined(__ERRORS__) && defined(WITHOUT_FRAMEWORKS)
 #include <Errors.h>
 #endif
 
index 4a91d7cd37394bbd32b58ebc3bf228d7499352ee..0b2c0f3633df54af6693858c918d134170a13503 100644 (file)
@@ -12,6 +12,9 @@
  */
 
 
+#ifndef WITHOUT_FRAMEWORKS
+#include <Carbon/Carbon.h>
+#endif
 #ifndef _WASTE_
 #include "WASTE.h"
 #endif
index 693d64c9783c854b7a001c7401d4c6d1bc135e9d..bf1099c21a48925263ec840b8e9c7dbdc438f039 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -634,7 +634,25 @@ class PyBuildExt(build_ext):
 ##              exts.append( Extension('_Scrap', ['scrap/_Scrapmodule.c']) )
                 exts.append( Extension('_TE', ['te/_TEmodule.c'],
                        extra_link_args=['-framework', 'Carbon']) )
-##              exts.append( Extension('waste', ['waste/wastemodule.c']) )
+                # As there is no standardized place (yet) to put user-installed
+                # Mac libraries on OSX you should put a symlink to your Waste
+                # installation in the same folder as your python source tree.
+                # Or modify the next two lines:-)
+                waste_incs = find_file("WASTE.h", [], ["../waste/C_C++ Headers"])
+                waste_libs = find_library_file(self.compiler, "WASTE", [],
+                        ["../waste/Static Libraries"])
+                if waste_incs != None and waste_libs != None:
+                    exts.append( Extension('waste', 
+                                   ['waste/wastemodule.c',
+                                    'Mac/Wastemods/WEObjectHandlers.c',
+                                    'Mac/Wastemods/WETabHooks.c',
+                                    'Mac/Wastemods/WETabs.c'
+                                   ],
+                                   include_dirs = waste_incs + ['Mac/Wastemods'],
+                                   library_dirs = waste_libs,
+                                   libraries = ['WASTE'],
+                                   extra_link_args = ['-framework', 'Carbon'],
+                    ) )
                 exts.append( Extension('_Win', ['win/_Winmodule.c'],
                        extra_link_args=['-framework', 'Carbon']) )