summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorLandry Breuil <landry@openbsd.org>2015-04-05 11:25:37 +0200
committerLandry Breuil <landry@openbsd.org>2015-04-05 11:25:37 +0200
commitd545b81973b7a0420aa68074e377cd73c428ae6a (patch)
treef71099e77332b9afb247c0b1e41b29c6831ab5f6 /setup.py
parentb960e1a70590619a04c568fb7019155055ea6518 (diff)
parentda53137e2fc1437de61c9b27ac071066693347e0 (diff)
downloadpsutil-d545b81973b7a0420aa68074e377cd73c428ae6a.tar.gz
Merge remote-tracking branch 'upstream/master' into openbsd
Conflicts: psutil/_psbsd.py
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py35
1 files changed, 25 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 3426d96b..fddb2b95 100644
--- a/setup.py
+++ b/setup.py
@@ -40,11 +40,20 @@ def get_description():
return f.read()
+VERSION = get_version()
+VERSION_MACRO = ('PSUTIL_VERSION', int(VERSION.replace('.', '')))
+
+
# POSIX
if os.name == 'posix':
+ libraries = []
+ if sys.platform.startswith("sunos"):
+ libraries.append('socket')
+
posix_extension = Extension(
- '_psutil_posix',
+ 'psutil._psutil_posix',
sources=['psutil/_psutil_posix.c'],
+ libraries=libraries,
)
# Windows
if sys.platform.startswith("win32"):
@@ -54,7 +63,7 @@ if sys.platform.startswith("win32"):
return '0x0%s' % ((maj * 100) + min)
extensions = [Extension(
- '_psutil_windows',
+ 'psutil._psutil_windows',
sources=[
'psutil/_psutil_windows.c',
'psutil/_psutil_common.c',
@@ -63,16 +72,18 @@ if sys.platform.startswith("win32"):
'psutil/arch/windows/security.c',
],
define_macros=[
+ VERSION_MACRO,
# be nice to mingw, see:
# http://www.mingw.org/wiki/Use_more_recent_defined_functions
('_WIN32_WINNT', get_winver()),
('_AVAIL_WINVER_', get_winver()),
+ ('_CRT_SECURE_NO_WARNINGS', None),
# see: https://github.com/giampaolo/psutil/issues/348
('PSAPI_VERSION', 1),
],
libraries=[
"psapi", "kernel32", "advapi32", "shell32", "netapi32", "iphlpapi",
- "wtsapi32",
+ "wtsapi32", "ws2_32",
],
# extra_compile_args=["/Z7"],
# extra_link_args=["/DEBUG"]
@@ -80,12 +91,13 @@ if sys.platform.startswith("win32"):
# OS X
elif sys.platform.startswith("darwin"):
extensions = [Extension(
- '_psutil_osx',
+ 'psutil._psutil_osx',
sources=[
'psutil/_psutil_osx.c',
'psutil/_psutil_common.c',
'psutil/arch/osx/process_info.c'
],
+ define_macros=[VERSION_MACRO],
extra_link_args=[
'-framework', 'CoreFoundation', '-framework', 'IOKit'
],
@@ -95,12 +107,13 @@ elif sys.platform.startswith("darwin"):
# FreeBSD
elif sys.platform.startswith("freebsd"):
extensions = [Extension(
- '_psutil_bsd',
+ 'psutil._psutil_bsd',
sources=[
'psutil/_psutil_bsd.c',
'psutil/_psutil_common.c',
'psutil/arch/bsd/process_info.c'
],
+ define_macros=[VERSION_MACRO],
libraries=["devstat"]),
posix_extension,
]
@@ -119,16 +132,18 @@ elif sys.platform.startswith("openbsd"):
# Linux
elif sys.platform.startswith("linux"):
extensions = [Extension(
- '_psutil_linux',
- sources=['psutil/_psutil_linux.c']),
+ 'psutil._psutil_linux',
+ sources=['psutil/_psutil_linux.c'],
+ define_macros=[VERSION_MACRO]),
posix_extension,
]
# Solaris
elif sys.platform.lower().startswith('sunos'):
extensions = [Extension(
- '_psutil_sunos',
+ 'psutil._psutil_sunos',
sources=['psutil/_psutil_sunos.c'],
- libraries=['kstat', 'nsl'],),
+ define_macros=[VERSION_MACRO],
+ libraries=['kstat', 'nsl', 'socket']),
posix_extension,
]
else:
@@ -138,7 +153,7 @@ else:
def main():
setup_args = dict(
name='psutil',
- version=get_version(),
+ version=VERSION,
description=__doc__.replace('\n', '').strip(),
long_description=get_description(),
keywords=[