[pypy-svn] r56637 - in pypy/dist/pypy: rlib translator/tool
hpk at codespeak.net
hpk at codespeak.net
Fri Jul 18 11:59:20 CEST 2008
Author: hpk
Date: Fri Jul 18 11:59:18 2008
New Revision: 56637
Modified:
pypy/dist/pypy/rlib/_rsocket_rffi.py
pypy/dist/pypy/translator/tool/cbuild.py
Log:
move defs for sunos5 libs needed for sockets to a better place (thanks, exarkun)
Modified: pypy/dist/pypy/rlib/_rsocket_rffi.py
==============================================================================
--- pypy/dist/pypy/rlib/_rsocket_rffi.py (original)
+++ pypy/dist/pypy/rlib/_rsocket_rffi.py Fri Jul 18 11:59:18 2008
@@ -7,11 +7,11 @@
from pypy.translator.tool.cbuild import ExternalCompilationInfo
from pypy.rlib.rarithmetic import intmask, r_uint
-import os
+import os,sys
_POSIX = os.name == "posix"
_MS_WINDOWS = os.name == "nt"
-
+_SOLARIS = sys.platform == "sunos5"
if _POSIX:
includes = ('sys/types.h',
@@ -36,6 +36,10 @@
HEADER = ''.join(['#include <%s>\n' % filename for filename in includes])
COND_HEADER = ''.join(['#ifdef %s\n#include <%s>\n#endif\n' % cond_include
for cond_include in cond_includes])
+
+if _SOLARIS:
+ libraries = libraries + ('socket', 'nsl')
+
if _MS_WINDOWS:
includes = ()
libraries = ('ws2_32',)
Modified: pypy/dist/pypy/translator/tool/cbuild.py
==============================================================================
--- pypy/dist/pypy/translator/tool/cbuild.py (original)
+++ pypy/dist/pypy/translator/tool/cbuild.py Fri Jul 18 11:59:18 2008
@@ -503,18 +503,15 @@
if not sys.platform in ('win32', 'darwin'): # xxx
if 'm' not in self.libraries:
self.libraries.append('m')
+ self.compile_extra += CFLAGS + ['-fomit-frame-pointer']
if 'pthread' not in self.libraries:
self.libraries.append('pthread')
-
- self.compile_extra += CFLAGS + ['-fomit-frame-pointer']
if sys.platform != 'sunos5':
self.compile_extra += ['-pthread']
self.link_extra += ['-pthread']
else:
self.compile_extra += ['-pthreads']
- # XXX probably socket and nsl should rather go
- # to be defined in the socket module
- self.link_extra += ['-lpthread', '-lsocket', '-lnsl']
+ self.link_extra += ['-lpthread']
if sys.platform == 'win32':
self.link_extra += ['/DEBUG'] # generate .pdb file
if sys.platform == 'darwin':
More information about the Pypy-commit
mailing list