$OpenBSD: patch-setup_py,v 1.10 2015/11/28 12:31:14 sthen Exp $
--- setup.py.orig	Mon Oct 14 22:38:10 2013
+++ setup.py	Sat Nov 28 12:27:29 2015
@@ -132,19 +132,20 @@ class PCTBuildExt (build_ext):
                 # the libtomcrypt code.
                 self.__add_compiler_option("-O")
             else:
-                # Speed up execution by tweaking compiler options.  This
-                # especially helps the DES modules.
-                self.__add_compiler_option("-O3")
-                self.__add_compiler_option("-fomit-frame-pointer")
                 # Don't include debug symbols unless debugging
                 self.__remove_compiler_option("-g")
                 # Don't include profiling information (incompatible with
                 # -fomit-frame-pointer)
                 self.__remove_compiler_option("-pg")
+                # Honor CFLAGS
+                for opt in os.getenv('CFLAGS').split():
+                    self.__add_compiler_option(opt)
             if USE_GCOV:
                 self.__add_compiler_option("-fprofile-arcs")
                 self.__add_compiler_option("-ftest-coverage")
                 self.compiler.libraries += ['gcov']
+            if sys.platform.lower().startswith('openbsd'):
+                self.__add_compiler_option("-I${LOCALBASE}/include")
 
         # Call the superclass's build_extensions method
         build_ext.build_extensions(self)
@@ -375,9 +376,6 @@ kw = {'name':"pycrypto",
                       sources=["src/_fastmath.c"]),
 
             # Hash functions
-            Extension("Crypto.Hash._MD2",
-                      include_dirs=['src/'],
-                      sources=["src/MD2.c"]),
             Extension("Crypto.Hash._MD4",
                       include_dirs=['src/'],
                       sources=["src/MD4.c"]),
@@ -402,9 +400,10 @@ kw = {'name':"pycrypto",
             Extension("Crypto.Cipher._AES",
                       include_dirs=['src/'],
                       sources=["src/AES.c"]),
-            Extension("Crypto.Cipher._ARC2",
-                      include_dirs=['src/'],
-                      sources=["src/ARC2.c"]),
+# Patented
+#            Extension("Crypto.Cipher._ARC2",
+#                      include_dirs=['src/'],
+#                      sources=["src/ARC2.c"]),
             Extension("Crypto.Cipher._Blowfish",
                       include_dirs=['src/'],
                       sources=["src/Blowfish.c"]),
