@@ -178,9 +178,9 @@ def finalize_options (self):
178178 if os .name == 'os2' :
179179 self .library_dirs .append (os .path .join (sys .exec_prefix , 'Config' ))
180180
181- # for extensions under Cygwin Python's library directory must be
181+ # for extensions under Cygwin and AtheOS Python's library directory must be
182182 # appended to library_dirs
183- if sys .platform [:6 ] == 'cygwin' :
183+ if sys .platform [:6 ] == 'cygwin' or sys . platform [: 6 ] == 'atheos' :
184184 if string .find (sys .executable , sys .exec_prefix ) != - 1 :
185185 # building third party extensions
186186 self .library_dirs .append (os .path .join (sys .prefix , "lib" ,
@@ -656,6 +656,22 @@ def get_libraries (self, ext):
656656 # don't extend ext.libraries, it may be shared with other
657657 # extensions, it is a reference to the original list
658658 return ext .libraries + [pythonlib ]
659+ elif sys .platform [:6 ] == "atheos" :
660+ from distutils import sysconfig
661+
662+ template = "python%d.%d"
663+ pythonlib = (template %
664+ (sys .hexversion >> 24 , (sys .hexversion >> 16 ) & 0xff ))
665+ # Get SHLIBS from Makefile
666+ extra = []
667+ for lib in sysconfig .get_config_var ('SHLIBS' ).split ():
668+ if lib .startswith ('-l' ):
669+ extra .append (lib [2 :])
670+ else :
671+ extra .append (lib )
672+ # don't extend ext.libraries, it may be shared with other
673+ # extensions, it is a reference to the original list
674+ return ext .libraries + [pythonlib , "m" ] + extra
659675 else :
660676 return ext .libraries
661677
0 commit comments