Mail Archives: djgpp-workers/2001/02/21/14:05:41
Patch 2/3
diff -acprNC5 gettext-2001-02-05.orig/djgpp/fnchange.lst gettext-2001-02-05/djgpp/fnchange.lst
*** gettext-2001-02-05.orig/djgpp/fnchange.lst Thu Jan 1 00:00:00 1970
--- gettext-2001-02-05/djgpp/fnchange.lst Tue Feb 13 13:17:06 2001
***************
*** 0 ****
--- 1,27 ----
+ gettext-0.10.36/config.h.in gettext-0.10.36/config.h-in
+ gettext-0.10.36/po/Makefile.in.in gettext-0.10.36/po/Makefile.in-in
+ gettext-0.10.36/tests/gettext-1 gettext-0.10.36/tests/gettext.1
+ gettext-0.10.36/tests/gettext-2 gettext-0.10.36/tests/gettext.2
+ gettext-0.10.36/tests/msgcmp-1 gettext-0.10.36/tests/msgcmp.1
+ gettext-0.10.36/tests/msgcmp-2 gettext-0.10.36/tests/msgcmp.2
+ gettext-0.10.36/tests/msgfmt-1 gettext-0.10.36/tests/msgfmt.1
+ gettext-0.10.36/tests/msgfmt-2 gettext-0.10.36/tests/msgfmt.2
+ gettext-0.10.36/tests/msgfmt-3 gettext-0.10.36/tests/msgfmt.3
+ gettext-0.10.36/tests/msgfmt-4 gettext-0.10.36/tests/msgfmt.4
+ gettext-0.10.36/tests/msgmerge-1 gettext-0.10.36/tests/msgmerge.1
+ gettext-0.10.36/tests/msgmerge-2 gettext-0.10.36/tests/msgmerge.2
+ gettext-0.10.36/tests/msgmerge-3 gettext-0.10.36/tests/msgmerge.3
+ gettext-0.10.36/tests/msgmerge-4 gettext-0.10.36/tests/msgmerge.4
+ gettext-0.10.36/tests/msgmerge-5 gettext-0.10.36/tests/msgmerge.5
+ gettext-0.10.36/tests/msgunfmt-1 gettext-0.10.36/tests/msgunfmt.1
+ gettext-0.10.36/tests/xgettext-1 gettext-0.10.36/tests/xgettext.1
+ gettext-0.10.36/tests/xgettext-2 gettext-0.10.36/tests/xgettext.2
+ gettext-0.10.36/tests/xgettext-3 gettext-0.10.36/tests/xgettext.3
+ gettext-0.10.36/tests/xgettext-4 gettext-0.10.36/tests/xgettext.4
+ gettext-0.10.36/tests/xgettext-5 gettext-0.10.36/tests/xgettext.5
+ gettext-0.10.36/tests/xgettext-6 gettext-0.10.36/tests/xgettext.6
+ gettext-0.10.36/tests/xgettext-7 gettext-0.10.36/tests/xgettext.7
+ gettext-0.10.36/tests/xgettext-8 gettext-0.10.36/tests/xgettext.8
+ gettext-0.10.36/tests/xgettext-9 gettext-0.10.36/tests/xgettext.9
+ gettext-0.10.36/tests/xg-test1.ok.po gettext-0.10.36/tests/xg-test1.ok-po
+ gettext-0.10.36/tests/plural-1 gettext-0.10.36/tests/plural.1
diff -acprNC5 gettext-2001-02-05.orig/djgpp/tscript.sed gettext-2001-02-05/djgpp/tscript.sed
*** gettext-2001-02-05.orig/djgpp/tscript.sed Thu Jan 1 00:00:00 1970
--- gettext-2001-02-05/djgpp/tscript.sed Tue Feb 13 11:36:42 2001
***************
*** 0 ****
--- 1,7 ----
+ # Sed script for modify the files in tests directory.
+
+ s|\.in\([1-2]\{1,1\}\)\.po|.i\1-po|g
+ s|\.ok\.po|.ok-po|g
+ s|\.in\.po|_in.po|g
+ s|\.in\.\([cC]\{1,1\}\)|_in.\1|g
+ s|\.po\.|.po-|g
diff -acprNC5 gettext-2001-02-05.orig/intl/config.charset gettext-2001-02-05/intl/config.charset
*** gettext-2001-02-05.orig/intl/config.charset Thu Feb 1 12:46:52 2001
--- gettext-2001-02-05/intl/config.charset Wed Feb 21 18:31:06 2001
*************** case "$os" in
*** 241,246 ****
--- 241,311 ----
;;
beos*)
# BeOS has a single locale, and it has UTF-8 encoding.
echo "C UTF-8"
;;
+ *msdosdjgpp*)
+ # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C CP437"
+ echo "US-ASCII CP437"
+ echo "en_US CP437" # ISO-8859-1
+
+ for l in ca_ES de_AT de_CH de_DE en_AU en_CA en_GB en_ZA eo_EO \
+ es_ES es_AR es_BO es_CL es_CO es_CR es_CU es_DO es_EC \
+ es_SV es_GT es_HN es_MX es_NI es_PA es_PY es_PE es_UY \
+ es_VE eu_ES gl_ES et_EE fi_FI fr_BE fr_CA fr_CH fr_FR \
+ ga_IE gd_GB id_ID it_CH it_IT la_LN mt_MT nl_BE nl_NL \
+ pt_BR pt_PT sv_SE \
+ ca de en es eu eo et fi fr ga gd gl id it la mt nl pt \
+ sv; do
+ echo "$l CP850" # ISO-8859-1
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN pl_PL ro_RO sh_YU sk_SK sl_SI \
+ sq_AL \
+ cs hr hu la pl ro sh sk sl sq; do
+ echo "$l CP852" # ISO-8859-2
+ done
+ for l in tr_TR tr; do
+ echo "$l CP857" # ISO-8859-9
+ done
+ for l in is_IS is; do
+ echo "$l CP861" # ISO-8859-10
+ done
+ for l in he_IL he; do
+ echo "$l CP862" # ISO-8859-8
+ done
+ for l in ar_DZ ar_EG ar_IR ar_IQ ar_JO ar_KW ar_MA ar_OM ar_QA \
+ ar_SA ar_SY ar_AE ar; do
+ echo "$l CP864" # ISO-8859-6
+ done
+ for l in da_DK nb_NO nn_NO no_NO \
+ da nb nn no; do
+ echo "$l CP865" # ISO-8859-1
+ done
+ for l in be_BE bg_BG mk_MK sr_YU be bg mk sr; do
+ echo "$l CP866" # ISO-8859-5
+ done
+ for l in eo_GR eo; do
+ echo "$l CP869" # ISO-8859-7
+ done
+ for l in th_TH th; do
+ echo "$l CP874" # TIS-620
+ done
+ for l in ru_RU ru_SU ru; do
+ echo "$l CP878" # KOI8-R
+ done
+ for l in ja_JP ja; do
+ echo "$l CP932" # Shift-JIS
+ done
+ for l in zh_CN; do
+ echo "$l CP936" # GBK/EUC-CN
+ done
+ for l in kr_KR kr; do
+ echo "$l CP949" # EUC-KR
+ done
+ for l in zh_TW; do
+ echo "$l CP950" # BIG5
+ done
+ ;;
esac
diff -acprNC5 gettext-2001-02-05.orig/intl/dcigettext.c gettext-2001-02-05/intl/dcigettext.c
*** gettext-2001-02-05.orig/intl/dcigettext.c Wed Jan 24 13:51:14 2001
--- gettext-2001-02-05/intl/dcigettext.c Wed Feb 21 18:31:06 2001
*************** DCIGETTEXT (domainname, msgid1, msgid2,
*** 447,457 ****
}
}
if (binding == NULL)
dirname = (char *) _nl_default_dirname;
! else if (binding->dirname[0] == '/')
dirname = binding->dirname;
else
{
/* We have a relative path. Make it absolute now. */
size_t dirname_len = strlen (binding->dirname) + 1;
--- 447,457 ----
}
}
if (binding == NULL)
dirname = (char *) _nl_default_dirname;
! else if (IS_ABSOLUTE_PATH(binding->dirname))
dirname = binding->dirname;
else
{
/* We have a relative path. Make it absolute now. */
size_t dirname_len = strlen (binding->dirname) + 1;
diff -acprNC5 gettext-2001-02-05.orig/intl/gettextP.h gettext-2001-02-05/intl/gettextP.h
*** gettext-2001-02-05.orig/intl/gettextP.h Wed Jan 24 19:04:10 2001
--- gettext-2001-02-05/intl/gettextP.h Wed Feb 21 18:31:44 2001
*************** extern int __gettextparse PARAMS ((void
*** 230,237 ****
--- 230,280 ----
extern void gettext_free_exp__ PARAMS ((struct expression *exp))
internal_function;
extern int gettextparse__ PARAMS ((void *arg));
#endif
+ /* MS-DOS and similar non-Posix systems have some peculiarities:
+ - they distinguish between binary and text files;
+ - they use both `/' and `\\' as directory separator in file names;
+ - they can have a drive letter X: prepended to a file name;
+ - they have a separate root directory on each drive;
+ - directories in environment variables (like PATH) are separated
+ by `;' rather than `:';
+ These are all parameterized here. */
+
+ #include <fcntl.h>
+ /* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in <fcntl.h>. */
+ #if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+ # define O_BINARY _O_BINARY
+ # define O_TEXT _O_TEXT
+ #endif
+ #ifdef __BEOS__
+ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
+ # undef O_BINARY
+ # undef O_TEXT
+ #endif
+ #if O_BINARY
+ # ifdef __DJGPP__
+ /* DJGPP will always read text mode files in binary mode. */
+ # define READ "rb"
+ # define OPENED_IN_BINARY_MODE 1
+ # else /* not __DJGPP__ */
+ # define READ "r"
+ # define OPENED_IN_BINARY_MODE 0
+ # endif /* not __DJGPP__ */
+ # define IS_DIR_SEPARATOR(path) (((path)[0]) == '/' || ((path)[0]) == '\\')
+ # define IS_DEVICE(path) (((path)[0]) && ((path)[1]) == ':')
+ # define IS_ABSOLUTE_PATH(path) (IS_DIR_SEPARATOR(path) || IS_DEVICE(path))
+ # define PATH_SEPARATOR ';'
+ #else /* not O_BINARY */
+ # define READ "r"
+ # define OPENED_IN_BINARY_MODE 0
+ # define IS_ABSOLUTE_PATH(path) (((path)[0]) == '/')
+ # define PATH_SEPARATOR ':'
+ #endif /* not O_BINARY */
+ /* End of OS specific parametrization. */
+
/* @@ begin of epilog @@ */
#endif /* gettextP.h */
diff -acprNC5 gettext-2001-02-05.orig/intl/libgnuintl.h gettext-2001-02-05/intl/libgnuintl.h
*** gettext-2001-02-05.orig/intl/libgnuintl.h Tue Feb 6 12:58:40 2001
--- gettext-2001-02-05/intl/libgnuintl.h Wed Feb 21 18:31:06 2001
***************
*** 37,46 ****
--- 37,55 ----
# else
# define PARAMS(args) ()
# endif
#endif
+ #ifdef __DJGPP__
+ /* This will remove the conflict between the gettext function
+ from libintl.h and DJGPP's gettext function from conio.h.
+ GNU gettext takes *always* precedence over DJGPP's _conio_gettext. */
+ # undef gettext
+ # define gettext gettext
+ # define __LIBINTL_H_INCLUDED__
+ #endif /* not __DJGPP__ */
+
#ifdef __cplusplus
extern "C" {
#endif
/* Look up MSGID in the current default message catalog for the current
diff -acprNC5 gettext-2001-02-05.orig/intl/localcharset.c gettext-2001-02-05/intl/localcharset.c
*** gettext-2001-02-05.orig/intl/localcharset.c Mon Jan 15 14:54:02 2001
--- gettext-2001-02-05/intl/localcharset.c Wed Feb 21 18:31:06 2001
***************
*** 53,70 ****
--- 53,103 ----
#else /* WIN32 */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
+ #if ((__DJGPP__ == 2) && (__DJGPP_MINOR__ <= 3))
+ /* DJGPP 2.03 and prior only supports C and POSIX. */
+ # undef HAVE_SETLOCALE
+ # define HAVE_SETLOCALE 0
+ #endif
+
#ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
#endif
+ #include <fcntl.h>
+ /* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in <fcntl.h>. */
+ #if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+ # define O_BINARY _O_BINARY
+ # define O_TEXT _O_TEXT
+ #endif
+ #ifdef __BEOS__
+ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
+ # undef O_BINARY
+ # undef O_TEXT
+ #endif
+ #if O_BINARY
+ # ifdef __DJGPP__
+ /* DJGPP will always open text mode file in binary mode. */
+ # define READ "rb"
+ # define OPENED_IN_BINARY_MODE 1
+ # else
+ # define READ "r"
+ # define OPENED_IN_BINARY_MODE 0
+ # endif
+ #else
+ # define READ "r"
+ # define OPENED_IN_BINARY_MODE 0
+ #endif
+
/* The following static variable is declared 'volatile' to avoid a
possible multithread problem in the function get_charset_aliases. If we
are running in a threaded environment, and if two threads initialize
'charset_aliases' simultaneously, both will produce the same value,
and everything will be ok if the two assignments to 'charset_aliases'
*************** get_charset_aliases ()
*** 105,115 ****
file_name[dir_len] = DIRECTORY_SEPARATOR;
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
}
}
! if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
/* Out of memory or file not found, treat it as empty. */
cp = "";
else
{
/* Parse the file's contents. */
--- 138,148 ----
file_name[dir_len] = DIRECTORY_SEPARATOR;
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
}
}
! if (file_name == NULL || (fp = fopen (file_name, READ)) == NULL)
/* Out of memory or file not found, treat it as empty. */
cp = "";
else
{
/* Parse the file's contents. */
*************** get_charset_aliases ()
*** 123,132 ****
--- 156,178 ----
for (;;)
{
c = getc (fp);
if (c == EOF)
break;
+ #if OPENED_IN_BINARY_MODE
+ /* Check for DOS-style EOL (CRLF) too. */
+ if (c == '\r')
+ {
+ int nc = getc (fp);
+ if (nc == EOF)
+ break;
+ if (nc == '\n' || nc == ' ' || nc == '\t')
+ continue;
+ else
+ ungetc (nc, fp);
+ }
+ #endif
if (c == '\n' || c == ' ' || c == '\t')
continue;
if (c == '#')
{
/* Skip comment, to end of line. */
diff -acprNC5 gettext-2001-02-05.orig/intl/localealias.c gettext-2001-02-05/intl/localealias.c
*** gettext-2001-02-05.orig/intl/localealias.c Mon Jan 22 12:48:00 2001
--- gettext-2001-02-05/intl/localealias.c Wed Feb 21 18:31:06 2001
*************** _nl_expand_alias (name)
*** 162,176 ****
added = 0;
while (added == 0 && locale_alias_path[0] != '\0')
{
const char *start;
! while (locale_alias_path[0] == ':')
++locale_alias_path;
start = locale_alias_path;
! while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
++locale_alias_path;
if (start < locale_alias_path)
added = read_alias_file (start, locale_alias_path - start);
}
--- 162,176 ----
added = 0;
while (added == 0 && locale_alias_path[0] != '\0')
{
const char *start;
! while (locale_alias_path[0] == PATH_SEPARATOR)
++locale_alias_path;
start = locale_alias_path;
! while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR)
++locale_alias_path;
if (start < locale_alias_path)
added = read_alias_file (start, locale_alias_path - start);
}
*************** read_alias_file (fname, fname_len)
*** 203,213 ****
#else
memcpy (full_fname, fname, fname_len);
memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
#endif
! fp = fopen (full_fname, "r");
freea (full_fname);
if (fp == NULL)
return 0;
added = 0;
--- 203,213 ----
#else
memcpy (full_fname, fname, fname_len);
memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
#endif
! fp = fopen (full_fname, READ);
freea (full_fname);
if (fp == NULL)
return 0;
added = 0;
diff -acprNC5 gettext-2001-02-05.orig/lib/system.h gettext-2001-02-05/lib/system.h
*** gettext-2001-02-05.orig/lib/system.h Mon Feb 5 18:38:02 2001
--- gettext-2001-02-05/lib/system.h Wed Feb 21 19:12:24 2001
*************** char *alloca ();
*** 127,154 ****
extern char *gnu_basename PARAMS ((const char *));
# define basename(Arg) gnu_basename (Arg)
#endif
#include <fcntl.h>
/* For systems that distinguish between text and binary I/O.
O_BINARY is usually declared in <fcntl.h>. */
#if !defined O_BINARY && defined _O_BINARY
/* For MSC-compatible compilers. */
! # define O_BINARY _O_BINARY
! # define O_TEXT _O_TEXT
#endif
#ifdef __BEOS__
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
# undef O_BINARY
# undef O_TEXT
#endif
#if O_BINARY
# if !(defined(__EMX__) || defined(__DJGPP__))
# define setmode _setmode
! # define fileno _fileno
# endif
! #else
! # define setmode(fd, mode) /* nothing */
! #endif
#endif
--- 127,192 ----
extern char *gnu_basename PARAMS ((const char *));
# define basename(Arg) gnu_basename (Arg)
#endif
+ /* MS-DOS and similar non-Posix systems have some peculiarities:
+ - they distinguish between binary and text files;
+ - they use both `/' and `\\' as directory separator in file names;
+ - they can have a drive letter X: prepended to a file name;
+ - they have a separate root directory on each drive;
+ - directories in environment variables (like PATH) are separated
+ by `;' rather than `:';
+ These are all parameterized here. */
+
#include <fcntl.h>
/* For systems that distinguish between text and binary I/O.
O_BINARY is usually declared in <fcntl.h>. */
#if !defined O_BINARY && defined _O_BINARY
/* For MSC-compatible compilers. */
! # define O_BINARY _O_BINARY
! # define O_TEXT _O_TEXT
#endif
#ifdef __BEOS__
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
# undef O_BINARY
# undef O_TEXT
#endif
#if O_BINARY
+ /* setmode() is usually defined in <io.h>. */
+ # include <io.h>
+ # ifdef HAVE_UNISTD_H
+ /* isatty() is defined in <unistd.h>. */
+ # include <unistd.h>
+ # endif
# if !(defined(__EMX__) || defined(__DJGPP__))
# define setmode _setmode
! # define fileno _fileno
# endif
! # ifdef __DJGPP__
! /* DJGPP will always read and write all files in binary mode. */
! # define READ "rb"
! # define WRITE "wb"
! # define OPENED_IN_BINARY_MODE 1
! /* DJGPP's implementation of basename()
! knows about all the DOS peculiarities. */
! # undef basename
! # define basename basename
! # else /* not __DJGPP__ */
! # define READ "r"
! # define WRITE "w"
! # define OPENED_IN_BINARY_MODE 0
! # endif /* not __DJGPP__ */
! # define IS_DIR_SEPARATOR(path) (((path)[0]) == '/' || ((path)[0]) == '\\')
! # define IS_DEVICE(path) (((path)[0]) && ((path)[1]) == ':')
! # define IS_ABSOLUTE_PATH(path) (IS_DIR_SEPARATOR(path) || IS_DEVICE(path))
! # define PATH_SEPARATOR ';'
! #else /* not O_BINARY */
! # define setmode(fd, mode) /* nothing */
! # define READ "r"
! # define WRITE "w"
! # define OPENED_IN_BINARY_MODE 0
! # define IS_ABSOLUTE_PATH(path) (((path)[0]) == '/')
! # define PATH_SEPARATOR ':'
! #endif /* not O_BINARY */
#endif
diff -acprNC5 gettext-2001-02-05.orig/src/Makefile.am gettext-2001-02-05/src/Makefile.am
*** gettext-2001-02-05.orig/src/Makefile.am Fri Jan 26 13:51:40 2001
--- gettext-2001-02-05/src/Makefile.am Wed Feb 21 18:31:06 2001
*************** datadir = $(prefix)/share
*** 30,40 ****
localedir = $(datadir)/locale
INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl \
-I$(top_srcdir)/intl
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! LDADD = ../lib/libnlsut.a @INTLLIBS@
SED = sed
YACC = @YACC@ -d
# Source dependencies.
--- 30,40 ----
localedir = $(datadir)/locale
INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl \
-I$(top_srcdir)/intl
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! LDADD = ../lib/libnlsut.a @INTLLIBS@ @LIBICONV@
SED = sed
YACC = @YACC@ -d
# Source dependencies.
- Raw text -