]> granicus.if.org Git - python/commitdiff
spwdmodule.c should only be built when either HAVE_GETSPNAM or HAVE_GETSPENT is
authorBrett Cannon <bcannon@gmail.com>
Wed, 16 Feb 2005 00:07:19 +0000 (00:07 +0000)
committerBrett Cannon <bcannon@gmail.com>
Wed, 16 Feb 2005 00:07:19 +0000 (00:07 +0000)
defined.

Misc/NEWS
setup.py

index ac8f8ee7a734d2f0c21fcef6818fc5abd1f53966..88a2fe6a3e99cf8d4a6e90444edd1aa881ec09cf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -152,6 +152,9 @@ Library
 Build
 -----
 
+- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
+  defined.  Discovered as a result of not being able to build on OS X.
+
 - setup.py now uses the directories specified in LDFLAGS using the -L option
   and in CPPFLAGS using the -I option for adding library and include
   directories, respectively, for compiling extension modules against.  This has
index 360c4763f43e98f4a80abfbef44de636e77a3c9e..9b41f4c20c2301c738423fe2ae2fc9fb30dff340 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -384,12 +384,14 @@ class PyBuildExt(build_ext):
         # fcntl(2) and ioctl(2)
         exts.append( Extension('fcntl', ['fcntlmodule.c']) )
         if platform not in ['mac']:
-                # pwd(3)
+            # pwd(3)
             exts.append( Extension('pwd', ['pwdmodule.c']) )
             # grp(3)
             exts.append( Extension('grp', ['grpmodule.c']) )
             # spwd, shadow passwords
-            exts.append( Extension('spwd', ['spwdmodule.c']) )
+            if (sysconfig.get_config_var('HAVE_GETSPNAM') or
+                    sysconfig.get_config_var('HAVE_GETSPENT')):
+                exts.append( Extension('spwd', ['spwdmodule.c']) )
         # select(2); not on ancient System V
         exts.append( Extension('select', ['selectmodule.c']) )