bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: texinfo-6.3.90 pretest


From: Eli Zaretskii
Subject: Re: texinfo-6.3.90 pretest
Date: Sat, 29 Apr 2017 23:01:52 +0300

> Date: Sat, 29 Apr 2017 22:52:12 +0300
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
> 
> > In file included from C:/prg/gnu/texinfo/svn/info/terminal.c:1299:0:
> > C:/prg/gnu/texinfo/svn/info/pcterm.c:1685:11: error: conflicting types 
> > for 'tputs'
> >   int       tputs (const char *a, int b, int (*c)(int))
> >             ^~~~~
> > In file included from C:/prg/gnu/texinfo/svn/info/terminal.c:40:0:
> > C:/msys64/mingw64/include/termcap.h:31:13: note: previous declaration of 
> > 'tputs' was here
> >   extern void tputs (const char *string, int nlines, int (*outfun) (int));
> >               ^~~~~
> > 
> > and once those are fixed, they collide with actual ncurses functions at 
> > link time:
> > 
> > C:/msys64/mingw64/lib/libncurses.a(lib_termcap.o):(.text+0x870): 
> > multiple definition of `tgetent'
> > terminal.o:C:/prg/gnu/texinfo/svn/info/pcterm.c:1711: first defined here
> > C:/msys64/mingw64/lib/libncurses.a(lib_termcap.o):(.text+0x9a0): 
> > multiple definition of `tgetflag'
> 
> Why is ncurses being linked in?  It shouldn't.

I guess this happens because the ncurses port you have installed has
termcap.h in the top-level include directory, not in its ncurses
subdirectory.  (That might be worth reporting to whoever produced the
port of ncurses.)  So the trick in terminal.c:

  /* The Unix termcap interface code. */
  /* With MinGW, if the user has ncurses installed, including
     ncurses/termcap.h will cause the Info binary depend on the ncurses
     DLL, just because BC and PC are declared there, although they are
     never used in the MinGW build.  Avoid that useless dependency.  */
  #if defined (HAVE_NCURSES_TERMCAP_H) && !defined (__MINGW32__)
  #include <ncurses/termcap.h>
  #elif defined (HAVE_TERMCAP_H)
  #include <termcap.h>
  #else  /* (!HAVE_NCURSES_TERMCAP_H || __MINGW32__) && !HAVE_TERMCAP_H */
  /* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC.
     Unfortunately, PC is a global variable used by the termcap library. */
  #undef PC

  /* Termcap requires these variables, whether we access them or not. */
  char *BC, *UP;
  char PC;      /* Pad character */
  short ospeed; /* Terminal output baud rate */
  extern int tgetnum (), tgetflag (), tgetent ();
  extern char *tgetstr (), *tgoto ();
  extern int tputs ();
  #endif /* not HAVE_NCURSES_TERMCAP_H */

which works for the ncurses port I have, doesn't work for you.  If so,
the right solution is to add the same guard to HAVE_TERMCAP_H as for
HAVE_NCURSES_TERMCAP_H.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]