From: "Juan Manuel Guerrero" Organization: Darmstadt University of Technology To: bug-texinfo AT gnu DOT org Date: Tue, 27 Nov 2001 15:04:40 +0100 Subject: Minor DJGPP specific fixes for texinfo-4.0d CC: djgpp-workers AT delorie DOT com X-mailer: Pegasus Mail for Windows (v2.54DE) Message-ID: <2D28476DAE@HRZ1.hrz.tu-darmstadt.de> Reply-To: djgpp-workers AT delorie DOT com Please note that I am not subscribed to any Texinfo list and I do not follow Texinfo developement so I do not know if all this is already well known. Although this fixes are for MSDOS/DJGPP, some of the issues may be relevant for other OSs too. 1) It is not possible to create doc.c and funs.h. The reason is that the makefile rule to create them contains makedoc as dependency. But the dependency should be makedoc$(EXEEXT). All this means that the following line in Makefile.am: $(BUILT_SOURCES): makedoc $(cmd_sources) should be replaced by this one: $(BUILT_SOURCES): makedoc$(EXEEXT) $(cmd_sources) Now it will work on all systems that sets EXEEXT to some value. Now the above dependency will matche the build rule for makedoc in the Makefile. 2) It is not possible to compile the package on systems where no gettext function is supplied. The wrong code snippet is in system.h: /* For gettext (NLS). */ #include #define _(String) gettext (String) #define N_(String) (String) The bug is the unconditional use of gettext without accounting for the value of ENABLE_NLS set by configure in config.h. This may never be noticed on linux where libc.a supplies gettext but on MSDOS/DJGPP this is deadly (no gettext in libc.a). IMHO, the above snippet should be replaced by a snippet looking like this one: /* For gettext (NLS). */ #ifdef ENABLE_NLS # include # define _(String) gettext (String) #else # undef bindtextdomain # define bindtextdomain(Domain, Directory) # undef textdomain # define textdomain(Domain) # undef ngettext # define ngettext(Singular, Plural, Number) \ ((Number == 1) ? Singular : Plural) # define _(String) String #endif #define N_(String) (String) Please note that I am assuming the use of GNU gettext 0.10.40 or any later version. 3) Unfortunately DJGPP's setlocale does not provide LC_MESSAGES. This makes the compilation of makeinfo.exe always fail. Afortunately configure checks for this and sets HAVE_LC_MESSAGES in config.h. Now the line: setlocale (LC_MESSAGES, ""); in function main() of makeinfo.c can be replaced by: #ifdef HAVE_LC_MESSAGES setlocale (LC_MESSAGES, ""); #endif and the compilation will work out-of-the-box for DJGPP too. 4) This is completely DJGPP specific. The files config.bat, config.sed and config.site are completely outdated. This files generate a useless configure script. With this files it has become impossible to configure and compile the package for an average user that is unfamiliar with autoconf and automake. I have written my own configuration files but they all assume that NLS is wanted by default. This is completely different from the actual files and behaviour. I do not know if this is welcome at all so I will not provide them in this patch. If they are wanted, let me know and I will post them. But this must be decided by Eli Zaretskii. 5) This is also completely DJGPP specific. I have noticed that makeinfo is not able to generate info files if the texinfo file have DOS-style EOL instead of UNIX-style EOL. Unfortunately I am not familiar enough with the sources and I have not enough time to investigate this further. This must be fixed by someone else. I have no acces to actual CVS tree of texinfo so I have based the patch on texinfo-4.0d as available at alpha.gnu.org. Netherless I hope the information/patch is still usefull. Please note that I am not subscribed to any Texinfo mailing list. Comments, objections, suggestions are welcome. Regards, Guerrero, Juan Manuel diff -acprNC5 texinfo-4.0d.orig/info/Makefile.am texinfo-4.0d.djgpp/info/Makefile.am *** texinfo-4.0d.orig/info/Makefile.am Fri Nov 16 23:17:40 2001 --- texinfo-4.0d.djgpp/info/Makefile.am Sun Nov 25 01:07:34 2001 *************** infokey_SOURCES = infokey.c infokey.h ke *** 41,51 **** # Files with Info commands defined that makedoc should read. cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \ $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \ $(srcdir)/footnotes.c $(srcdir)/variables.c ! $(BUILT_SOURCES): makedoc $(cmd_sources) # This is insufficient. We really need them not to be in the # distribution in the first place, but it seems Automake does not # currently allow that. rm -f $(BUILT_SOURCES) ./makedoc $(cmd_sources) --- 41,51 ---- # Files with Info commands defined that makedoc should read. cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \ $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \ $(srcdir)/footnotes.c $(srcdir)/variables.c ! $(BUILT_SOURCES): makedoc$(EXEEXT) $(cmd_sources) # This is insufficient. We really need them not to be in the # distribution in the first place, but it seems Automake does not # currently allow that. rm -f $(BUILT_SOURCES) ./makedoc $(cmd_sources) diff -acprNC5 texinfo-4.0d.orig/lib/system.h texinfo-4.0d.djgpp/lib/system.h *** texinfo-4.0d.orig/lib/system.h Tue May 1 16:31:34 2001 --- texinfo-4.0d.djgpp/lib/system.h Sun Nov 25 01:13:14 2001 *************** *** 40,51 **** #ifndef HAVE_SETLOCALE #define setlocale(category,locale) /* empty */ #endif /* For gettext (NLS). */ ! #include ! #define _(String) gettext (String) #define N_(String) (String) #ifdef STDC_HEADERS #define getopt system_getopt #include --- 40,62 ---- #ifndef HAVE_SETLOCALE #define setlocale(category,locale) /* empty */ #endif /* For gettext (NLS). */ ! #ifdef ENABLE_NLS ! # include ! # define _(String) gettext (String) ! #else ! # undef bindtextdomain ! # define bindtextdomain(Domain, Directory) ! # undef textdomain ! # define textdomain(Domain) ! # undef ngettext ! # define ngettext(Singular, Plural, Number) \ ! ((Number == 1) ? Singular : Plural) ! # define _(String) String ! #endif #define N_(String) (String) #ifdef STDC_HEADERS #define getopt system_getopt #include diff -acprNC5 texinfo-4.0d.orig/makeinfo/makeinfo.c texinfo-4.0d.djgpp/makeinfo/makeinfo.c *** texinfo-4.0d.orig/makeinfo/makeinfo.c Tue Sep 11 16:37:32 2001 --- texinfo-4.0d.djgpp/makeinfo/makeinfo.c Sun Nov 25 01:15:50 2001 *************** main (argc, argv) *** 490,500 **** --- 490,502 ---- #ifdef HAVE_SETLOCALE /* Do not use LC_ALL, because LC_NUMERIC screws up the scanf parsing of the argument to @multicolumn. */ setlocale (LC_TIME, ""); + #ifdef HAVE_LC_MESSAGES setlocale (LC_MESSAGES, ""); + #endif setlocale (LC_CTYPE, ""); setlocale (LC_COLLATE, ""); #endif /* Set the text message domain. */