Skip to content

Commit f3031b8

Browse files
authored
bpo-32521: nis libtirpc (#5137)
glibc has removed Sun RPC. Use replacement libtirpc headers and library in nis module Signed-off-by: Christian Heimes <[email protected]>
1 parent ae12f5d commit f3031b8

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
2+
nis module.

setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,12 +1373,19 @@ class db_found(Exception): pass
13731373
# Sun yellow pages. Some systems have the functions in libc.
13741374
if (host_platform not in ['cygwin', 'qnx6'] and
13751375
find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
1376-
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
1377-
libs = ['nsl']
1378-
else:
1379-
libs = []
1376+
nis_libs = []
1377+
nis_includes = []
1378+
if self.compiler.find_library_file(lib_dirs, 'nsl'):
1379+
nis_libs.append('nsl')
1380+
if self.compiler.find_library_file(lib_dirs, 'tirpc'):
1381+
# Sun RPC has been moved from glibc to libtirpc
1382+
# rpcsvc/yp_prot.h is still in /usr/include, but
1383+
# rpc/rpc.h has been moved into tirpc/ subdir.
1384+
nis_libs.append('tirpc')
1385+
nis_includes.append('/usr/include/tirpc')
13801386
exts.append( Extension('nis', ['nismodule.c'],
1381-
libraries = libs) )
1387+
libraries = nis_libs,
1388+
include_dirs=nis_includes) )
13821389
else:
13831390
missing.append('nis')
13841391
else:

0 commit comments

Comments
 (0)