]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Only build the 'dl' extension when sys.maxint equals 2**31-1.
authorGuido van Rossum <guido@python.org>
Thu, 12 Sep 2002 14:41:20 +0000 (14:41 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 12 Sep 2002 14:41:20 +0000 (14:41 +0000)
This module raises "SystemError: module dl requires sizeof(int) ==
sizeof(long) == sizeof(char*)" when compiled on 64-bit platforms.

setup.py

index 3341e46e9e39d8b0d01c60fe65edfb51a78e27f1..7e9d7fe6c5af047b2471e598bf3b32b87573ee5f 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -732,9 +732,11 @@ class PyBuildExt(build_ext):
                                ))                        
 
         # Dynamic loading module
-        dl_inc = find_file('dlfcn.h', [], inc_dirs)
-        if (dl_inc is not None) and (platform not in ['atheos']):
-            exts.append( Extension('dl', ['dlmodule.c']) )
+        if sys.maxint == 0x7fffffff:
+            # This requires sizeof(int) == sizeof(long) == sizeof(char*)
+            dl_inc = find_file('dlfcn.h', [], inc_dirs)
+            if (dl_inc is not None) and (platform not in ['atheos']):
+                exts.append( Extension('dl', ['dlmodule.c']) )
 
         # Platform-specific libraries
         if platform == 'linux2':