From: "Juan Manuel Guerrero" Organization: Darmstadt University of Technology To: djgpp-workers AT delorie DOT com Date: Thu, 22 Feb 2001 23:19:15 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Subject: DJGPP specific patch for libiconv-1.5.1 CC: Eli Zaretskii , Bruno Haible X-mailer: Pegasus Mail for Windows (v2.54DE) Message-ID: <2BDF13E1437@HRZ1.hrz.tu-darmstadt.de> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-printable to 8bit by delorie.com id RAA22118 Reply-To: djgpp-workers AT delorie DOT com This patch implements DJGPP specific support tp libiconv-1.5.1.tgz. The patch will modify the files libcharset/lib/config.charset, libcharset/lib/localcharset.c and src/iconv.c. This patch will **not** create all the djgpp/*.* files. Due to the great amount of name collsions in this package, I would like to discuss the appropiate strategy for this package at djgpp-workers first. This patch accounts for the suggestions originated in the Re: gettext pretest available thread. The item libcharset/INTEGRATE is not trivial. Francois Pinard has copied the contents of the file verbatim into his recode-3.6 makefiles. Now the compilation breaks with the error message: Making all in libiconv make.exe[2]: Wechsel in das Verzeichnis Verzeichnis ¯z:/tmp/recode-3.6/libiconv® sed -e '/^#/d' -e 's/@''PACKAGE''@/recode/g' ref-del.sin > ref-del.sed-t mv ref-del.sed-t ref-del.sed f:/bin/mv: `ref-del.sed-t' and `ref-del.sed' are the same file make.exe[2]: *** [ref-del.sed] Fehler 1 make.exe[2]: Verlassen des Verzeichnisses Verzeichnis ¯z:/tmp/recode-3.6/libiconv® make.exe[1]: *** [all-recursive] Fehler 1 make.exe[1]: Verlassen des Verzeichnisses Verzeichnis ¯z:/tmp/recode-3.6® make.exe: *** [all-recursive-am] Fehler 2 Regards, Guerrero, Juan Manuel * libcharset/INTEGRATE: Change $@-t to t-$@. * libcharset/lib/config.charset: Update for DJGPP 2.03. * libcharset/lib/localcharset.c [DJGPP]: Inhibit the usage of setlocale() for DJGPP. * src/iconv.c [O_BINARY]: Include for setmode() definition. [O_BINARY] [DJGPP]: Include for setmode() definition and new macro setmode(). (usage) [O_BINARY]: Print --binary option. diff -acprNC5 libiconv-1.5.1.orig/libcharset/INTEGRATE libiconv-1.5.1/libcharset/INTEGRATE *** libiconv-1.5.1.orig/libcharset/INTEGRATE Tue Dec 12 19:46:04 2000 --- libiconv-1.5.1/libcharset/INTEGRATE Thu Feb 22 22:04:20 2001 *************** charset.alias: config.charset *** 117,125 **** $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ SUFFIXES = .sed .sin .sin.sed: ! sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t ! mv $@-t $@ CLEANFILES = charset.alias ref-add.sed ref-del.sed --- 117,125 ---- $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ SUFFIXES = .sed .sin .sin.sed: ! sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ ! mv t-$@ $@ CLEANFILES = charset.alias ref-add.sed ref-del.sed diff -acprNC5 libiconv-1.5.1.orig/libcharset/lib/config.charset libiconv-1.5.1/libcharset/lib/config.charset *** libiconv-1.5.1.orig/libcharset/lib/config.charset Tue Oct 31 11:12:56 2000 --- libiconv-1.5.1/libcharset/lib/config.charset Thu Feb 22 21:52:56 2001 *************** case "$os" in *** 225,230 **** --- 225,295 ---- for l in ru_RU ru_SU; do echo "$l.KOI8-R KOI8-R" echo "$l.CP866 CP866" done ;; + 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 libiconv-1.5.1.orig/libcharset/lib/localcharset.c libiconv-1.5.1/libcharset/lib/localcharset.c *** libiconv-1.5.1.orig/libcharset/lib/localcharset.c Tue Oct 31 12:22:04 2000 --- libiconv-1.5.1/libcharset/lib/localcharset.c Thu Feb 22 21:52:56 2001 *************** *** 48,57 **** --- 48,63 ---- #else /* WIN32 */ # define WIN32_LEAN_AND_MEAN # include #endif + #ifdef __DJGPP__ + /* 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 diff -acprNC5 libiconv-1.5.1.orig/src/iconv.c libiconv-1.5.1/src/iconv.c *** libiconv-1.5.1.orig/src/iconv.c Sat Dec 2 02:24:16 2000 --- libiconv-1.5.1/src/iconv.c Thu Feb 22 21:52:56 2001 *************** *** 31,62 **** /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #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 #endif #if O_BINARY static int force_binary = 0; #endif static void usage (int exitcode) { fprintf(exitcode ? stderr : stdout, "Usage: iconv -f fromcode -t tocode [file ...]\n"); exit(exitcode); } static void print_version (void) { --- 31,75 ---- /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #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 */ + # include # if !(defined(__EMX__) || defined(__DJGPP__)) # define setmode _setmode ! # define fileno _fileno # endif + # ifdef __DJGPP__ + /* isatty() is defined in */ + # include + # define setmode(fd, mode) do { \ + if (!isatty ((fd))) \ + setmode ((fd), mode); \ + } while (0) #endif #if O_BINARY static int force_binary = 0; #endif static void usage (int exitcode) { fprintf(exitcode ? stderr : stdout, + #if O_BINARY + "Usage: iconv [--binary] -f fromcode -t tocode [file ...]\n"); + #else "Usage: iconv -f fromcode -t tocode [file ...]\n"); + #endif exit(exitcode); } static void print_version (void) {