1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

- added LOCALE patch from vorlon@debian.org (Steve Langasek) (bug #122)

- changed --enable-developer debug to use -gstabs as it makes the
  samba binaries about 10x smaller and is still quite functional for
  samba debugging
(This used to be commit 53bfcd478a193d4def8da872e92d7ed8f46aa4b9)
This commit is contained in:
Andrew Tridgell 2003-06-30 02:11:13 +00:00
parent b8723aaa65
commit 0a4959d48d
4 changed files with 42 additions and 3 deletions

View File

@ -173,13 +173,13 @@ AC_ARG_ENABLE(debug,
AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
[if eval "test x$enable_developer = xyes"; then
developer=yes
CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
fi])
AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
[if eval "test x$enable_krb5developer = xyes"; then
developer=yes
CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
fi])
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable heap debugging [default=no]])
@ -529,6 +529,7 @@ AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h t
AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h)
AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
AC_CHECK_HEADERS(langinfo.h locale.h)
# In valgrind 1.0.x, it's just valgrind.h. In 1.9.x+ there's a
# subdirectory of headers.
@ -843,6 +844,7 @@ AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64
AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
AC_CHECK_FUNCS(syslog vsyslog getgrouplist timegm)
AC_CHECK_FUNCS(setlocale nl_langinfo)
# setbuffer, shmget, shm_open are needed for smbtorture
AC_CHECK_FUNCS(setbuffer shmget shm_open backtrace_symbols)

View File

@ -441,6 +441,14 @@
#include <attr/xattr.h>
#endif
#if HAVE_LOCALE_H
#include <locale.h>
#endif
#if HAVE_LANGINFO_H
#include <langinfo.h>
#endif
/* Special macros that are no-ops except when run under Valgrind on
* x86. They've moved a little bit from valgrind 1.0.4 to 1.9.4 */
#if HAVE_VALGRIND_MEMCHECK_H

View File

@ -55,6 +55,30 @@ static const char *charset_name(charset_t ch)
else if (ch == CH_DISPLAY) ret = lp_display_charset();
else if (ch == CH_UTF8) ret = "UTF8";
#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
if (ret && strcasecmp(ret, "LOCALE") == 0) {
const char *ln = NULL;
#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
#endif
ln = nl_langinfo(CODESET);
if (ln) {
/* Check whether the charset name is supported
by iconv */
smb_iconv_t handle = smb_iconv_open(ln,"UCS-2LE");
if (handle == (smb_iconv_t) -1) {
DEBUG(5,("Locale charset '%s' unsupported, using ASCII instead\n", ln));
ln = NULL;
} else {
DEBUG(5,("Substituting charset '%s' for LOCALE\n", ln));
smb_iconv_close(handle);
}
}
ret = ln;
}
#endif
if (!ret || !*ret) ret = "ASCII";
return ret;
}

View File

@ -1281,8 +1281,13 @@ static void init_globals(void)
/* using UTF8 by default allows us to support all chars */
string_set(&Globals.unix_charset, "UTF8");
/* using UTF8 by default allows us to support all chars */
#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
/* If the system supports nl_langinfo(), try to grab the value
from the user's locale */
string_set(&Globals.display_charset, "LOCALE");
#else
string_set(&Globals.display_charset, "ASCII");
#endif
/* Use codepage 850 as a default for the dos character set */
string_set(&Globals.dos_charset, "CP850");