delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/01/22:42:46

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Thu, 1 Feb 2001 21:41:09 -0600 (CST)
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: Kevin Wright <kevin AT wright DOT org>
cc: Cygwin-Mailing-List <cygwin AT cygwin DOT com>
Subject: Re: Problems building pkgconfig on cygwin
In-Reply-To: <000001c08cb6$d7f22100$e088f726@holstein-mobile.ASPECTDV.COM>
Message-ID: <Pine.HPP.3.96.1010201212409.13207I-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019