Skip to content

Instantly share code, notes, and snippets.

@rkitover
Last active November 16, 2017 22:01
Show Gist options
  • Save rkitover/afab7ed3ac7ce1860c43a258571c8ae1 to your computer and use it in GitHub Desktop.
Save rkitover/afab7ed3ac7ce1860c43a258571c8ae1 to your computer and use it in GitHub Desktop.
python 2.7.14 link with static libintl patch
diff -ruN Python-2.7.14.orig/configure.ac Python-2.7.14.new/configure.ac
--- Python-2.7.14.orig/configure.ac 2017-09-16 10:38:35.000000000 -0700
+++ Python-2.7.14.new/configure.ac 2017-11-16 11:42:43.184354519 -0800
@@ -2403,6 +2403,18 @@
# pthread (first!) on Linux
fi
+# Check iconv
+#
+# This is from: https://bugs.python.org/issue17226
+AC_CHECK_LIB([iconv], [iconv_open], ,[ac_found_iconf=no])
+
+if test "x$ac_found_iconf" = "xno"; then
+ AC_CHECK_LIB([iconv], [libiconv_open], , [ac_found_iconf=no])
+fi
+if test "x$ac_found_iconf" = "xyes"; then
+ LIBS="-liconv $LIBS"
+fi
+
# check if we need libintl for locale functions
AC_CHECK_LIB(intl, textdomain,
AC_DEFINE(WITH_LIBINTL, 1,
diff -ruN Python-2.7.14.orig/setup.py Python-2.7.14.new/setup.py
--- Python-2.7.14.orig/setup.py 2017-09-16 10:38:35.000000000 -0700
+++ Python-2.7.14.new/setup.py 2017-11-16 11:53:11.359548981 -0800
@@ -642,7 +642,7 @@
data = open('pyconfig.h').read()
m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
if m is not None:
- locale_libs = ['intl']
+ locale_libs = ['intl', 'iconv']
else:
locale_libs = []
if host_platform == 'darwin':
@rkitover
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment