From: Kevin Murray <spam@kdmurray.id.au>
Date: Tue, 15 Nov 2016 19:21:24 +1100
Subject: use libsww as library, not embedded src

---
 setup.py | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/setup.py b/setup.py
index 366e058..596323c 100644
--- a/setup.py
+++ b/setup.py
@@ -58,21 +58,6 @@ with open('README.rst') as f:
 USE_CYTHON = os.environ.get('USE_CYTHON', False)
 ext = '.pyx' if USE_CYTHON else '.c'
 
-# There's a bug in some versions of Python 3.4 that propagates
-# -Werror=declaration-after-statement to extensions, instead of just affecting
-# the compilation of the interpreter. See http://bugs.python.org/issue21121 for
-# details. This acts as a workaround until the next Python 3 release -- thanks
-# Wolfgang Maier (wolma) for the workaround!
-ssw_extra_compile_args = ['-Wno-error=declaration-after-statement']
-if sys.platform == 'win32':
-    ssw_extra_compile_args = []
-
-# Users with i686 architectures have reported that adding this flag allows
-# SSW to be compiled. See https://github.com/biocore/scikit-bio/issues/409 and
-# http://stackoverflow.com/q/26211814/3776794 for details.
-if platform.machine() == 'i686':
-    ssw_extra_compile_args.append('-msse2')
-
 extensions = [
     Extension("skbio.metadata._intersection",
               ["skbio/metadata/_intersection" + ext]),
@@ -80,10 +65,9 @@ extensions = [
               ["skbio/stats/__subsample" + ext],
               include_dirs=[np.get_include()]),
     Extension("skbio.alignment._ssw_wrapper",
-              ["skbio/alignment/_ssw_wrapper" + ext,
-               "skbio/alignment/_lib/ssw.c"],
-              extra_compile_args=ssw_extra_compile_args,
-              include_dirs=[np.get_include()]),
+              ["skbio/alignment/_ssw_wrapper" + ext],
+              include_dirs=[np.get_include()],
+              libraries=['ssw']),
     Extension("skbio.diversity._phylogenetic",
               ["skbio/diversity/_phylogenetic" + ext],
               include_dirs=[np.get_include()])
