From 93eaf5fe5f8538b4c0ed5496fb522566f46e3a28 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 4 Dec 2019 15:04:18 -0300 Subject: [PATCH] Testing for pw3270's SDK path when building on windows. --- setup.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 6558d99..54a3e4e 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,22 @@ -from distutils.core import setup, Extension +from distutils.core import setup, Extension, os +import platform + +include_dirs = ['src/include'] +library_dirs = [] + +if platform.system() == 'Windows': + include_dirs.append(os.getenv('PW3270_SDK_PATH') + '/include') + library_dirs.append(os.getenv('PW3270_SDK_PATH') + '/lib') tn3270 = Extension( 'tn3270', define_macros = [ - ('PACKAGE_NAME', '\"python-tn3270\"'), + ('PACKAGE_NAME', '\"python3-tn3270\"'), ('PACKAGE_VERSION', '\"5.2\"') ], - include_dirs = ['src/include'], + include_dirs = include_dirs, libraries = ['ipc3270'], + library_dirs=library_dirs, sources = [ 'src/action/type.c', 'src/module/init.c', @@ -35,7 +44,7 @@ setup ( name = 'tn3270', description = 'Python bindings for lib3270/pw3270.', author = 'Perry Werneck', author_email = 'perry.werneck@gmail.com', - url = 'https://github.com/PerryWerneck/python-tn3270', + url = 'https://github.com/PerryWerneck/python3-tn3270', long_description = ''' This is an extension allowing tn3270 acess for python applications using lib3270 directly or ipc calls to an enabled pw3270 window. -- libgit2 0.21.2