]> granicus.if.org Git - recode/commitdiff
Add LIBINTL flags to Cython module
authorReuben Thomas <rrt@sc3d.org>
Tue, 30 Jan 2018 11:47:24 +0000 (11:47 +0000)
committerReuben Thomas <rrt@sc3d.org>
Tue, 30 Jan 2018 17:04:26 +0000 (17:04 +0000)
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

index 48f94641268b17ae01490d0e9f96ffd5106e1936..a20ac820fe6eab2815fd194e48abcce1519e6efc 100644 (file)
@@ -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: