delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/11/06:56:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 11 Nov 2005 12:55:49 +0100
From: Thomas Porschberg <thomas DOT porschberg AT osp-dd DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: boost program_options library with cygwin
Message-ID: <20051111115549.GJ10788@porschberg.osp-dd.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20051109160408 DOT GB5162 AT porschberg DOT osp-dd DOT de> <43722405 DOT F29D93A2 AT dessent DOT net> <20051110102239 DOT GB10788 AT porschberg DOT osp-dd DOT de> <437390A3 DOT 72A386D6 AT dessent DOT net>
Mime-Version: 1.0
In-Reply-To: <437390A3.72A386D6@dessent.net>
X-Operating-System: Linux porschberg 2.6.11.4-20a-default
User-Agent: Mutt/1.5.10i

On Thu, Nov 10, 2005 at 10:25:40AM -0800, Brian Dessent wrote:
> Thomas Porschberg wrote:
> 
> > because libcppunit was built as cygwin-library. I resolved the
> > problem by compiling the library from sources with -mno-cygwin
> > flag. And then I used this library for both, my application
> > cygwin-build and my application mingw-build.
> > If I understand you right, this is at least dangerous. I have
> 
> Yes, it's dangerous, and I'm surprised it works.
> 
> Basically, you have to treat Cygwin and mingw as two completely separate
> platforms.  You'll have to compile two versions of your code and every
> library that it links with.  In the case of the Cygwin version of the
> library, you can use the copy installed by setup.exe from the Cygwin
> mirrors.  But it is not a goal of the Cygwin project to provide packaged
> versions of mingw libraries (except for a couple of common cases like
> zlib) so don't expect to use any of the libraries found on a Cygwin
> mirror when compiling for mingw.  You'll have to do this yourself, or
> get them from the mingw site.
> 
> To do this sanely under Cygwin, it seems to me like you could do
> something like the following (untested) for each package/library:
> 
> mkdir cygwin-build && cd cygwin-build
> CC="gcc" ../configure --prefix=/usr/local/cygwin \
>       CFLAGS="-I/usr/local/cygwin/include" \
>       LDFLAGS="-L/usr/local/cygwin/lib" # etc..
> make && make install
> cd ..
> 
> mkdir mingw-build && cd mingw-build
> CC="gcc -mno-cygwin" ../configure --prefix=/usr/local/mingw \
>       CFLAGS="-I/usr/local/mingw/include" \
>       LDFLAGS="-L/usr/local/mingw/lib" # etc..
> make && make install
> 
> This keeps the separation between installed packages such that
> everything installed under /usr/local/cygwin is Cygwin, and everything
> installed under /usr/local/mingw is mingw.  The reason for not using
> just /usr/local is that the compiler picks up libraries installed there
> by default, so you wouldn't want it picking up a cygwin lib when
> compiling in mingw mode, and so on.
> 
> You could also do it by using mounts.  Mount one /usr/local, do a Cygwin
> compile and install of all packages, then unmount and remount a
> different /usr/local and redo everything in mingw mode.
> 
> However you handle it, you have to keep this separation.  I would not
> try to mix them under the same --prefix unless you really know what
> you're doing.
> 
> You can even just forget about using -mno-cygwin and have an install of
> Cygwin and an install of mingw+MSYS, and  treat them as if they have no
> idea about each other, just as you would if you were supporting e.g.
> Cygwin and MS VC++.
> 
> Also, it's important to realize that the -mno-cygwin flag is provided as
> a convenience to turn the Cygwin build environment into mingw mode, but
> the mingw project is an independant effort from Cygwin.  Porting mingw
> applications is not really on-topic for this list.  If you have
> questions about compiling with mingw you should ask on their mailing
> list.

Thanks for your guideline. It made things much more clear to me.

Thomas
-- 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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