aboutsummaryrefslogtreecommitdiffhomepage
path: root/setup.py
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <y-zeng@users.noreply.github.com>2017-03-24 14:52:04 -0700
committerGravatar GitHub <noreply@github.com>2017-03-24 14:52:04 -0700
commitf466ae116e7b9804458129e95d790e7f20042ffc (patch)
tree665cdc249fb47868eee5b9e56093b9083e6a3c8a /setup.py
parent7e6b7df8d6bbb80c19ae1736e0c35b4eab06c541 (diff)
parent0e8bc45783a6f5e310f3f7829bedb328507cca2e (diff)
Merge pull request #7771 from y-zeng/cares_buildin
Async DNS resolver with pre-configured c-ares
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 7656657c22..e050646475 100644
--- a/setup.py
+++ b/setup.py
@@ -52,6 +52,13 @@ PYTHON_STEM = os.path.join('src', 'python', 'grpcio')
CORE_INCLUDE = ('include', '.',)
BORINGSSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),)
ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),)
+CARES_INCLUDE = (
+ os.path.join('third_party', 'cares'),
+ os.path.join('third_party', 'cares', 'cares'),)
+if 'linux' in sys.platform:
+ CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_linux'),)
+if 'darwin' in sys.platform:
+ CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_darwin'),)
README = os.path.join(PYTHON_STEM, 'README.rst')
# Ensure we're in the proper directory whether or not we're being used by pip.
@@ -136,7 +143,8 @@ CYTHON_HELPER_C_FILES = ()
CORE_C_FILES = tuple(grpc_core_dependencies.CORE_SOURCE_FILES)
EXTENSION_INCLUDE_DIRECTORIES = (
- (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE)
+ (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE +
+ CARES_INCLUDE)
EXTENSION_LIBRARIES = ()
if "linux" in sys.platform:
@@ -150,13 +158,15 @@ DEFINE_MACROS = (
('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600),
('GPR_BACKWARDS_COMPATIBILITY_MODE', 1),)
if "win32" in sys.platform:
- DEFINE_MACROS += (('WIN32_LEAN_AND_MEAN', 1),)
+ DEFINE_MACROS += (('WIN32_LEAN_AND_MEAN', 1), ('CARES_STATICLIB', 1),)
if '64bit' in platform.architecture()[0]:
DEFINE_MACROS += (('MS_WIN64', 1),)
elif sys.version_info >= (3, 5):
# For some reason, this is needed to get access to inet_pton/inet_ntop
# on msvc, but only for 32 bits
DEFINE_MACROS += (('NTDDI_VERSION', 0x06000000),)
+else:
+ DEFINE_MACROS += (('HAVE_CONFIG_H', 1),)
LDFLAGS = tuple(EXTRA_LINK_ARGS)
CFLAGS = tuple(EXTRA_COMPILE_ARGS)