From 5b3deec186412e1bfb402b0c5ee3bc9fe425f945 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 7 Apr 2014 22:15:15 +0900 Subject: [PATCH] Fix python build on windows Patch from Gisle Vanem """ I tried to build this extension on Windows, but failed since ws2_32.lib is needed in libraries """ --- python/setup.py.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/setup.py.in b/python/setup.py.in index aa66cd59..3c2f7bf8 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -20,9 +20,16 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import sys from distutils.core import setup from distutils.extension import Extension +if sys.platform == "win32": + LIBS = ['nghttp2_imp', 'ws2_32'] +else: + LIBS = ['nghttp2'] + setup( name = 'python-nghttp2', description = 'Python HTTP/2 library on top of nghttp2', @@ -36,6 +43,6 @@ setup( '@top_srcdir@/lib/includes', '@top_builddir@/lib/includes'], library_dirs=['@top_builddir@/lib/.libs'], - libraries=['nghttp2'])], + libraries=LIBS)], long_description='TBD' )