summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xautogen.sh10
-rw-r--r--libtool-nls.diff22
2 files changed, 26 insertions, 6 deletions
diff --git a/autogen.sh b/autogen.sh
index 3295d8d..8e49643 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,14 +1,12 @@
#!/bin/sh
-
# use glibtoolize if it is available (darwin)
(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize || LIBTOOLIZE=libtoolize
$LIBTOOLIZE --copy --force || exit 1
-# Force ltmain's NLS test to set locale to C always. Prevents an
-# issue when compiling shared libs with MinGW on Chinese locale.
-type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }
-sed -e s/\\\\\${\$lt_var+set}/set/g ltmain.sh > lttmp.sh
-mv lttmp.sh ltmain.sh
+# If available, apply libtool's NLS patch to set locale to C always.
+# Prevents an issue when compiling shared libs with MinGW on Chinese locale.
+# see: http://lists.gnu.org/archive/html/bug-libtool/2010-03/msg00012.html
+type -P patch &>/dev/null && { if [ -e "libtool-nls.diff" ]; then patch -p1 -Nl -i libtool-nls.diff &>/dev/null; fi; }
#
aclocal || exit 1
autoheader || exit 1
diff --git a/libtool-nls.diff b/libtool-nls.diff
new file mode 100644
index 0000000..d41b733
--- /dev/null
+++ b/libtool-nls.diff
@@ -0,0 +1,22 @@
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -105,9 +105,6 @@ _LTECHO_EOF'
+ }
+
+ # NLS nuisances: We save the old values to restore during execute mode.
+-# Only set LANG and LC_ALL to C if already set.
+-# These must not be set unconditionally because not all systems understand
+-# e.g. LANG=C (notably SCO).
+ lt_user_locale=
+ lt_safe_locale=
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+@@ -120,6 +117,9 @@ do
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+ done
++LC_ALL=C
++LANGUAGE=C
++export LANGUAGE LC_ALL
+
+ $lt_unset CDPATH
+