Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edeea04

Browse files
committed
Mods to make WASTE module compile and link for MachoPython. Not tested
any further, yet.
1 parent 793ead5 commit edeea04

5 files changed

Lines changed: 29 additions & 3 deletions

File tree

Mac/Wastemods/WEObjectHandlers.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
Copyright © 1993-1998 Marco Piovanelli
66
All Rights Reserved
77
*/
8-
8+
#ifndef WITHOUT_FRAMEWORKS
9+
#include <Carbon/Carbon.h>
10+
#endif
911
#ifndef _WASTE_
1012
#include "WASTE.h"
1113
#endif

Mac/Wastemods/WETabHooks.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
*/
1111

1212

13+
#ifndef WITHOUT_FRAMEWORKS
14+
#include <Carbon/Carbon.h>
15+
#endif
1316
#ifndef _WASTE_
1417
#include "WASTE.h"
1518
#endif

Mac/Wastemods/WETabs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "WETabs.h"
1111
#include "WETabHooks.h"
1212

13-
#ifndef __ERRORS__
13+
#if !defined(__ERRORS__) && defined(WITHOUT_FRAMEWORKS)
1414
#include <Errors.h>
1515
#endif
1616

Mac/Wastemods/WETabs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
*/
1313

1414

15+
#ifndef WITHOUT_FRAMEWORKS
16+
#include <Carbon/Carbon.h>
17+
#endif
1518
#ifndef _WASTE_
1619
#include "WASTE.h"
1720
#endif

setup.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,25 @@ def detect_modules(self):
634634
## exts.append( Extension('_Scrap', ['scrap/_Scrapmodule.c']) )
635635
exts.append( Extension('_TE', ['te/_TEmodule.c'],
636636
extra_link_args=['-framework', 'Carbon']) )
637-
## exts.append( Extension('waste', ['waste/wastemodule.c']) )
637+
# As there is no standardized place (yet) to put user-installed
638+
# Mac libraries on OSX you should put a symlink to your Waste
639+
# installation in the same folder as your python source tree.
640+
# Or modify the next two lines:-)
641+
waste_incs = find_file("WASTE.h", [], ["../waste/C_C++ Headers"])
642+
waste_libs = find_library_file(self.compiler, "WASTE", [],
643+
["../waste/Static Libraries"])
644+
if waste_incs != None and waste_libs != None:
645+
exts.append( Extension('waste',
646+
['waste/wastemodule.c',
647+
'Mac/Wastemods/WEObjectHandlers.c',
648+
'Mac/Wastemods/WETabHooks.c',
649+
'Mac/Wastemods/WETabs.c'
650+
],
651+
include_dirs = waste_incs + ['Mac/Wastemods'],
652+
library_dirs = waste_libs,
653+
libraries = ['WASTE'],
654+
extra_link_args = ['-framework', 'Carbon'],
655+
) )
638656
exts.append( Extension('_Win', ['win/_Winmodule.c'],
639657
extra_link_args=['-framework', 'Carbon']) )
640658

0 commit comments

Comments
 (0)