From cc19a5201a67d145394f22ff994b54ad1d2f263a Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 30 Jan 2018 11:47:24 +0000 Subject: [PATCH] Add LIBINTL flags to Cython module MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit They are not empty on all platforms! Also Cython on MSYS seems to call gcc in such a way that it doesn’t understand UNIX paths (it seems to understand them normally), so engage in suitable shenanigans: this should work on any Windows system that has cygpath. --- tests/setup.py.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/setup.py.in b/tests/setup.py.in index 48f9464..a20ac82 100644 --- a/tests/setup.py.in +++ b/tests/setup.py.in @@ -8,6 +8,17 @@ build = 'build' srcdir = '@srcdir@' top_builddir = '@top_builddir@' top_srcdir = '@top_srcdir@' +libintl = '@LIBINTL@' +libiconv = '@LIBICONV@' +extra_libs = [] +extra_libs.extend(libintl.split()) +extra_libs.extend(libiconv.split()) + +# FIXME: On Mingw, Cython seems to call gcc in such a way that it doesn't understand UNIX paths +if os.name == 'nt': + for i in range(len(extra_libs)): + if extra_libs[i][0] == '/': + extra_libs[i] = os.popen('cygpath --windows ' + extra_libs[i]).read().rstrip() try: @@ -21,7 +32,8 @@ try: os.path.join(top_srcdir, 'lib')], library_dirs=[os.path.join(top_builddir, 'src', '.libs'), os.path.join(top_builddir, 'lib', '.libs')], - libraries=['recode', 'gnu']) + libraries=['recode', 'gnu'], + extra_link_args=extra_libs) ]) finally: -- 2.50.1