This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Confused by gettext on cygwin


This is a good question, but it should be on list.  I've redirected this 
email to the list.  See below for commentary.

Linus Tolke Y wrote:

> Hi there!
> 
> I have a couple of hobby projects that I am trying to run with the gnu 
> tools (autoconf, automake, gettext...) to learn these tools. 
> 
> This week I tried to move the developing environment from Linux to
> cygwin since I don't have Linux installed on my laptop.
> 
> After checking out my project from cvs I run the gettextize command to
> get all the intl-files in place and what confused me was that the
> result of the gettextize command was different in Linux and in cygwin.
> Looking at the file intl/gettext.h that was created by gettextize, the
> file created in cygwin included some stuff within 
> #if defined(__CYGWIN__)
> #endif
> The version of gettextize was the same on both the cygwin and Linux
> systems.
> [lyskom@linus intl]$ gettextize --version
> /usr/bin/gettextize (GNU gettext) 0.10.35
> Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
> Written by Ulrich Drepper
> [lyskom@linus intl]$
> 
> What is the purpose of modifying these files for cygwin in this way?


Well, the gettext.h created by gettextize is made as a copy of a special 
gettext.h stored in /usr/share/gettext/intl/.  During my build process 
for cygwin, the /usr/share/gettext/intl/gettext.h file is created 
identical to the system gettext.h in /usr/include.  So, if the system 
file is different from some baseline, then the created file will also be 
different.

It was necessary to modify gettext.h on cygwin to support using the 
braindead windows shared library format (DLLs).  Functions and variables 
must be declared with special compile-time directives 
(__declspec(dllimport), __declspec(dllexport)) -- thus, the headers must 
be modified.

Now, I have corresponded with the "real" gettext people about this. 
Their response is that these changes are just too damn ugly to 
incorporate -- and there MAY be upcoming changes to GCC and binutils so 
that cygwin no longer requires this uglification.  Therefore, those guys 
are taking a wait-and-see approach.  We all hope that the uglification 
goes away at some point.

> I thought that the purpose of the created files were to generate them
> exactly in the same way independantly of what system they were
> generated on. The are probably not compiled on that system anyway.
> 
> What is it about gettext that I have missunderstood?


Nothing.

If you merely want to gettextize a package that will be built on another 
platform, or will be built on cygwin ALWAYS using the 
--with-included-gettext (that is, you'll never use the cygwin system 
libintl.a with your package), then just

copy the "linux" or "official" gettext.h into /usr/share/gettext/intl on 
your cygwin system.  In fact, that may not be a bad idea in ALL cases, 
because if somebody builds your package on cygwin and DOESN't specify 
--with-included-gettext, then the build will use the 
/usr/include/gettext.h and /usr/lib/libintl.a -- so no problems: your 
"official" gettextized gettext.h won't even get used in that case.

Hmmm...perhaps the cygwin gettext package should put the official 
gettext.h into /usr/share/gettext/intl, and only use the modified, 
DLL-supporting gettext.h for /usr/include...

--Chuck



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]