This is the mail archive of the cygwin@sources.redhat.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: Problems building pkgconfig on cygwin


On Thu, 1 Feb 2001, Kevin Wright wrote:

> Hello,
> 
> I'm trying to build pkgconfig http://pkgconfig.sourceforge.net 
> on cygwin and am getting the following undefined refs while 
> linking the executable:
> 
> parse.o(.text+0x29): undefined reference to `flockfile'
> parse.o(.text+0x17d): undefined reference to `funlockfile'
> parse.o(.text+0x41): undefined reference to `getc_unlocked'
> parse.o(.text+0xa5): undefined reference to `getc_unlocked'
> parse.o(.text+0x13d): undefined reference to `getc_unlocked'

Cygwin docs point out that these are unimplemented. I know that
the docs are in the cygwin source distribution, and I'm assuming, 
although have not checked, that the online docs also reflect that. 

> I realize this means these haven't been ported to cygwin but
> there must be equivalents functions that I can substitute.
> Unfortunately, I lack the expertise to properly do this
> myself and was wondering if anyone else had already ported 
> pkgconfig to cygwin. (I'm actually trying to build pango
> which requires pkgconfig)

getc/putc_unlocked are used in a threaded environment for a bit of
extra performance when you know it's safe. For now, use:
  
  #if defined(__CYGWIN__) && !defined(getc_unlocked)
  # define getc_unlocked getc
  #endif

The {getc,putc}_unlocked are part of POSIX 1, I believe.

The flockfile and funlockfile were added in SusV2 (Single Unix
Spec Version 2) to provided thread-safe flocking of stdio objects
(``FILE *'' to be specific). Do a web search on flockfile and
susv2 (or Single Unix Specification) and you'll get an eyeful.

Web search is an easy way to get your answers to these questions
if you don't have all standard documentation handy.

Temporary fix:

  #if !defined(__CYGWIN__)
  /* Call flockfile() and funlockfile()
  #endif

The correct fix is to find these at configuration time, and use
macros to do the right thing.

The really correct thing to do is to implement these and contribute
it to the Cygwin project ;-)

Regards,
Mumit




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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