Skip to content

Commit

Permalink
Added support for using 32-bit DMD2 on Mac OS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
dansanduleac committed Jun 2, 2011
1 parent 32d6e39 commit babddbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions dcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,16 @@ def _initialize(self):
# StackThreads support
self._st_support = True

# link with the relevant python libraries
if _isPlatMac:
frameworkSearchPath = sys.prefix[:sys.prefix.find('Python.framework')-1]
self._linkOpts += ['-L-F'+frameworkSearchPath, '-L-framework', '-LPython']
pass
else:
# TODO only if linux
#self._linkOpts = [self.library_option('python')]
pass

#def link_opts(self,

def _def_file(self, output_dir, output_filename):
Expand Down
6 changes: 4 additions & 2 deletions infrastructure/d/python_so_darwin_boilerplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ extern (C) void _moduleDtor();
extern (C) void _moduleUnitTests();


pragma(attribute, constructor) void _init() {
version(GNU) { pragma(attribute, constructor) }
void _init() {
gc_init();
//_moduleCtor(); // XXX PI does not work here... moded in PydMain
//_moduleUnitTests(); // idem
}

pragma(attribute, destructor) void _fini() {
version(GNU) { pragma(attribute, destructor) }
void _fini() {
_moduleDtor();
gc_term();
}
Expand Down

0 comments on commit babddbc

Please sign in to comment.