[tex-live] building from source

Jonathan Kew jonathan_kew at sil.org
Fri May 26 10:52:00 CEST 2006


On 26 May 2006, at 5:34 am, djh wrote:

>
> Target Platform: Cygwin 5.19
>
> Karl, thanks for the work around, (#define getline t1getline).
>
> After doing that I ran ./Build again, got further along, and ran  
> into, basically the same problem.
>
> ----
> srcdir=../../../../TeX/texk/web2c /bin/sh ../../../../TeX/texk/ 
> web2c/web2c/convert tangleboot
> gcc -DHAVE_CONFIG_H  -I. -I../../../../TeX/texk/web2c -I.. - 
> I../../../../TeX/texk/web2c/..   -g -O2  -c tangleboot.c -o  
> tangleboot.o
> In file included from tangleboot.c:94:
> tangleboot.h:34: error: conflicting types for 'getline'
> /usr/include/sys/stdio.h:31: error: previous declaration of  
> 'getline' was here
> tangleboot.h:34: error: conflicting types for 'getline'
> /usr/include/sys/stdio.h:31: error: previous declaration of  
> 'getline' was here
>
> ----
> Now, me being clever and wanting to be helpful did:
> # In directory: /cygdrive/c/cygwin-djh/texlive/src/Work/TeX/texk/ 
> web2c :
> # (1) Changed line #34 in tangleboot.h (rename getline to tb_getline)
> # (2) Inserted the following at line #2173 of tangleboot.c
> #    #define getline tb_getline
> ----
>
> Then re-ran ./Build.  Same problem... ummm.  Looked at the  
> tangleboot.{c|h} and both where back to their unedited state???
>
> So these must be automatically generated files.....

Yes, anything within the Work sub-tree is generated during the build.

> Any ideas about problem can be broached?

I don't have a Cygwin system to try this, but it might work to edit  
texk/web2c/cpascal.h. Right after the line

   #include "config.h"

try adding a #define to rename any getline() function that  
subsequently gets declared/used:

   #include "config.h"

   #if defined(CYGWIN) || defined(__CYGWIN__) || defined(CYGWIN32) ||  
defined(__CYGWIN32__)
   #define getline pascal_getline /* avoid clash with getline()  
declared in stdio.h */
   #endif

I think this will work, because config.h (indirectly) includes  
<stdio.h>, and so that's when the unwanted declaration gets into the  
source.

You'd probably run into the same issue with tangle, otangle, weave  
and mft, as all of these programs have a getline procedure defined in  
their Web source; but a patch in cpascal.h should solve all of them  
at once (if it works as I intend).

Actually, the #if / #endif bracketing is probably unnecessary, as the  
#define should be harmless on other platforms. The one risk is that  
this could interfere with some other piece of code that actually  
wants to get to the version of getline in glibc, but I don't think  
this actually arises. The only code likely to do this would be  
separately-written C code that doesn't #include "cpascal.h".

HTH .... Jonathan




More information about the tex-live mailing list