summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-11-22 14:18:41 (GMT)
committerGitHub <noreply@github.com>2021-11-22 14:18:41 (GMT)
commitc6dec7e27a82cba33539d07ef8d7346e0a232421 (patch)
treea923e108b246ddec0a930387c9609688120c2fcf /setup.py
parent7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e (diff)
downloadcpython-c6dec7e27a82cba33539d07ef8d7346e0a232421.zip
cpython-c6dec7e27a82cba33539d07ef8d7346e0a232421.tar.gz
cpython-c6dec7e27a82cba33539d07ef8d7346e0a232421.tar.bz2
bpo-45847: Port nis module to PY_STDLIB_MOD (GH-29699)
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py44
1 files changed, 1 insertions, 43 deletions
diff --git a/setup.py b/setup.py
index b9b48b2..dd1a3df 100644
--- a/setup.py
+++ b/setup.py
@@ -1993,49 +1993,7 @@ class PyBuildExt(build_ext):
))
def detect_nis(self):
- if MS_WINDOWS or CYGWIN or HOST_PLATFORM == 'qnx6':
- self.missing.append('nis')
- return
-
- libs = []
- library_dirs = []
- includes_dirs = []
-
- # bpo-32521: glibc has deprecated Sun RPC for some time. Fedora 28
- # moved headers and libraries to libtirpc and libnsl. The headers
- # are in tircp and nsl sub directories.
- rpcsvc_inc = find_file(
- 'rpcsvc/yp_prot.h', self.inc_dirs,
- [os.path.join(inc_dir, 'nsl') for inc_dir in self.inc_dirs]
- )
- rpc_inc = find_file(
- 'rpc/rpc.h', self.inc_dirs,
- [os.path.join(inc_dir, 'tirpc') for inc_dir in self.inc_dirs]
- )
- if rpcsvc_inc is None or rpc_inc is None:
- # not found
- self.missing.append('nis')
- return
- includes_dirs.extend(rpcsvc_inc)
- includes_dirs.extend(rpc_inc)
-
- if self.compiler.find_library_file(self.lib_dirs, 'nsl'):
- libs.append('nsl')
- else:
- # libnsl-devel: check for libnsl in nsl/ subdirectory
- nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in self.lib_dirs]
- libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl')
- if libnsl is not None:
- library_dirs.append(os.path.dirname(libnsl))
- libs.append('nsl')
-
- if self.compiler.find_library_file(self.lib_dirs, 'tirpc'):
- libs.append('tirpc')
-
- self.add(Extension('nis', ['nismodule.c'],
- libraries=libs,
- library_dirs=library_dirs,
- include_dirs=includes_dirs))
+ self.addext(Extension('nis', ['nismodule.c']))
class PyBuildInstall(install):