summaryrefslogtreecommitdiff
blob: 1aafd8022d563f0341e479433ea05ac569ed0c17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- setup.py
+++ setup.py
@@ -151,11 +151,12 @@
         if self.compiler.compiler_type == 'msvc':
             self.compiler.include_dirs.insert(0, "src/inc-msvc/")
 
-        # Detect libgmp and don't build _fastmath if it is missing.
-        lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
-        if not (self.compiler.find_library_file(lib_dirs, 'gmp')):
-            print >>sys.stderr, "warning: GMP library not found; Not building Crypto.PublicKey._fastmath."
-            self.__remove_extensions(["Crypto.PublicKey._fastmath"])
+        if os.environ.get("USE_GMP", "1") == "1":
+            # Detect libgmp and don't build _fastmath if it is missing.
+            lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
+            if not (self.compiler.find_library_file(lib_dirs, 'gmp')):
+                print >>sys.stderr, "error: GMP library not found."
+                sys.exit(1)
 
     def __remove_extensions(self, names):
         """Remove the specified extension from the list of extensions to build"""