diff options
author | hobbs <hobbs> | 2001-11-16 20:55:39 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-11-16 20:55:39 (GMT) |
commit | 96e1762fbd024a762d4c36283ab77259c338f8ee (patch) | |
tree | 7669a143cf3a5404697e45b8e0fbe5a2b6e2c5ed /unix/tcl.m4 | |
parent | 76ee7178050083224079f10b6e7ff6b480ac7e1e (diff) | |
download | tcl-96e1762fbd024a762d4c36283ab77259c338f8ee.zip tcl-96e1762fbd024a762d4c36283ab77259c338f8ee.tar.gz tcl-96e1762fbd024a762d4c36283ab77259c338f8ee.tar.bz2 |
* unix/tclUnixInit.c: added HAVE_LANGINFO code block.
* unix/configure: regened
* unix/configure.in: added SC_ENABLE_LANGINFO call
* unix/tcl.m4: made SHLIB_LD_LIBS='${LIBS}' for FreeBSD* (meyer)
Added modified version of Wagner patch to make use of nl_langinfo
where possible to determine Unix platform encoding, instead of the
inflexible built-in system. This is used by default when
possible, and can be disabled with --enable-langinfo=no.
[Patch #418645] (hobbs, wagner)
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r-- | unix/tcl.m4 | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d70c95f..c3b25dd 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -429,6 +429,51 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [ fi ]) +#------------------------------------------------------------------------ +# SC_ENABLE_LANGINFO -- +# +# Allows use of modern nl_langinfo check for better l10n. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-langinfo=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_LANGINFO Triggers use of nl_langinfo if defined. +# +#------------------------------------------------------------------------ + +AC_DEFUN(SC_ENABLE_LANGINFO, [ + AC_ARG_ENABLE(langinfo, + [ --enable-langinfo use nl_langinfo if possible to determine + encoding at startup, otherwise use old heuristic], + [langinfo_ok=$enableval], [langinfo_ok=yes]) + + HAVE_LANGINFO=0 + if test "$langinfo_ok" = "yes"; then + if test "$langinfo_ok" = "yes"; then + AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) + fi + fi + AC_MSG_CHECKING([whether to use nl_langinfo]) + if test "$langinfo_ok" = "yes"; then + AC_TRY_COMPILE([#include <langinfo.h>], + [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no]) + if test "$langinfo_ok" = "no"; then + langinfo_ok="no (could not compile with nl_langinfo)"; + fi + if test "$langinfo_ok" = "yes"; then + AC_DEFINE(HAVE_LANGINFO) + fi + fi + AC_MSG_RESULT([$langinfo_ok]) +]) + #-------------------------------------------------------------------- # SC_CONFIG_CFLAGS # @@ -926,7 +971,7 @@ dnl AC_CHECK_TOOL(AR, ar, :) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" |