public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Newbie needs help using mingw with cygwin
@ 2008-05-06  1:01 Mark Hanlon
  2008-05-06  2:10 ` Tim Prince
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Hanlon @ 2008-05-06  1:01 UTC (permalink / raw)
  To: cygwin


Hello,

I am trying to building Lilypond from source using cygwin (Some parts of the lilypond source have to be changed so that is why I can't download the binary :(

I am using the configure script supplied with Lilypond.

Unfortunately, Lilypond requires GCC 4.0 and above, so I have downloaded a mingw at version 4.1.
I have changed my Path Environment variable and the etc/profile file to use the mingw version of GCC.

Everything works fine apart from when I run the configure script it is now complaining that it can't find guile and flex.
When I don't use mingw, it finds them and only complains about the compiler being less than 4.0.

Anyone any ideas what is going on and an idea how to fix it would be lovely.

Cheers
Mark
_________________________________________________________________
Win Indiana Jones prizes with Live Search
http://clk.atdmt.com/UKM/go/msnnkmgl0010000002ukm/direct/01/

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-06  1:01 Newbie needs help using mingw with cygwin Mark Hanlon
@ 2008-05-06  2:10 ` Tim Prince
  2008-05-06 17:16   ` Christopher Faylor
  0 siblings, 1 reply; 13+ messages in thread
From: Tim Prince @ 2008-05-06  2:10 UTC (permalink / raw)
  To: cygwin

Mark Hanlon wrote:
> Hello,
>
> I am trying to building Lilypond from source using cygwin (Some parts of the lilypond source have to be changed so that is why I can't download the binary :(
>
> I am using the configure script supplied with Lilypond.
>
> Unfortunately, Lilypond requires GCC 4.0 and above, so I have downloaded a mingw at version 4.1.
> I have changed my Path Environment variable and the etc/profile file to use the mingw version of GCC.
>
> Everything works fine apart from when I run the configure script it is now complaining that it can't find guile and flex.
> When I don't use mingw, it finds them and only complains about the compiler being less than 4.0.
>
> Anyone any ideas what is going on and an idea how to fix it would be lovely.
>
>   
You're asking for mingw to work as a cygwin compiler, but the run-time 
libraries are incompatible.
I'd bet on installing a recent gcc build for cygwin.  If you don't need 
g++, you could take pre-built binaries from gfortran wiki. Doesn't the 
lilypond maintainer have instructions?

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-06  2:10 ` Tim Prince
@ 2008-05-06 17:16   ` Christopher Faylor
  0 siblings, 0 replies; 13+ messages in thread
From: Christopher Faylor @ 2008-05-06 17:16 UTC (permalink / raw)
  To: cygwin

On Mon, May 05, 2008 at 06:37:35PM -0700, Tim Prince wrote:
> Mark Hanlon wrote:
>> Hello,
>>
>> I am trying to building Lilypond from source using cygwin (Some parts of 
>> the lilypond source have to be changed so that is why I can't download the 
>> binary :(
>>
>> I am using the configure script supplied with Lilypond.
>>
>> Unfortunately, Lilypond requires GCC 4.0 and above, so I have downloaded a 
>> mingw at version 4.1.
>> I have changed my Path Environment variable and the etc/profile file to 
>> use the mingw version of GCC.
>>
>> Everything works fine apart from when I run the configure script it is now 
>> complaining that it can't find guile and flex.
>> When I don't use mingw, it finds them and only complains about the 
>> compiler being less than 4.0.
>>
>> Anyone any ideas what is going on and an idea how to fix it would be 
>> lovely.
>>
>>   
> You're asking for mingw to work as a cygwin compiler, but the run-time 
> libraries are incompatible.

What do guile and flex have to do with runtime libraries?

It sounds like you need to modify your path to include the gcc 4.0
directory as well as the cygwin directory but I wouldn't be too
confident that this would actually produce anything useful if you really
need cygwin utilities to build lilypond.  Does lilypond even build under
mingw?

cgf

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-07 12:56             ` Warren Young
@ 2008-05-08  4:56               ` Mark
  0 siblings, 0 replies; 13+ messages in thread
From: Mark @ 2008-05-08  4:56 UTC (permalink / raw)
  To: cygwin

Cheers everyone for all you help and comments, it's really appreciated.

All the best
Mark


--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-07  1:12           ` Mark
  2008-05-07  1:55             ` Brian Dessent
@ 2008-05-07 12:56             ` Warren Young
  2008-05-08  4:56               ` Mark
  1 sibling, 1 reply; 13+ messages in thread
From: Warren Young @ 2008-05-07 12:56 UTC (permalink / raw)
  To: Cygwin-L

Mark wrote:
> 
> I had thought that by modifying my etc/profile to pick up mingw istead of the
> GCC bundled in cygwin 

If that's the limit of your goal, then yes, it can be done, but it's a 
bit more involved than just changing the PATH.  Here's the Bourne shell 
script I use, which I call 'mingw':

#!/bin/sh
PATH=/c/mingw/bin:/c/windows:/c/windows/system32:/c/cygwin/bin
echo "Say 'exit' to leave MinGW shell and restore Cygwin environment."
/usr/bin/bash --rcfile ~/.mingwrc

Then in ~/.mingwrc:

alias make=mingw32-make
PS1='MinGW: \W \$ '

There's a way around having to split the functionality into two files 
like this, but it changes the way you have to run the shell script, and 
that runs counter to my keyboard habits.  Besides, you would then lose 
out on a neat side benefit: when you exit the MinGW subshell, all of the 
changes made to enter MinGW mode revert.  This is very helpful to me 
when I'm testing under both environments: I work in Cygwin mode as long 
as I can, then pop into MinGW where and only as long as necessary.  Back 
in Cygwin mode, my environment works just like before.

Note that the script completely rewrites the PATH to ensure that MinGW's 
bin directory appears before Cygwin's, so that anything they have in 
common always comes from the MinGW side.  If you have other directories 
that you want in your PATH, you can tack them on in the .mingwrc file:

export PATH=$PATH:/my/path/here

By the way, I should note that I've used "mount -c /" on this system, so 
either do that on your system, too, or change all "/c" to "/cygdrive/c".

I alias 'make' to 'mingw32-make' to hide the Cygwin make.  MinGW make 
has some Windows/DOS quirks in it that I happen to need.  (This is why 
they give it a different name, by the way.)  I habitually type 'make' so 
I can't afford to have Cygwin's make in the way while I'm working in 
MinGW mode.  If Cygwin's make works for you, I'd recommend removing this 
alias, as the MinGW quirks can cause problems if you don't need them.

The change in the prompt is to remind myself that I'm in a subshell, and 
that exiting will take me back to Cygwin mode, not close the window. 
The "echo" message says much the same thing, but that only helps while 
it's still in your short-term memory.  It's easy to forget that you're 
still in MinGW mode, without the custom prompt.

Now, this doesn't somehow give you the ability to build POSIX programs 
using only MinGW.  Its only purpose is to let you use the Cygwin 
userland tools while building with MinGW; think of it as an alternative 
to MSYS.  This only helps you if the program will build using pure Win32 
APIs.  The fact that it uses a configure script is a pretty good 
indicator that it uses POSIX APIs, though not an infallible one.  It's 
possible to use autoconf for a pure Win32 program, but rarely done.

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-07  2:14               ` Bob Rossi
@ 2008-05-07  9:34                 ` Brian Dessent
  0 siblings, 0 replies; 13+ messages in thread
From: Brian Dessent @ 2008-05-07  9:34 UTC (permalink / raw)
  To: Bob Rossi; +Cc: cygwin

Bob Rossi wrote:

> I've been wondering about this. Why is it necessary to "cross-compile"
> from cygwin to mingw when the cygwin environment has the native mingw
> compiler? To me, it seems like if the mingw compiler is capable of
> running in the build environment, it should just be called and work.

It depends on how the package is written.  But really, if you don't tell
configure that you're cross compiling (i.e. that build and host are not
the same) you're lying to it and you set yourself up for features of the
build system being detected that the host doesn't really support.

For example, say there's a configure test to see if "/proc" exists and
is usable.  If you don't tell configure that you're cross compiling the
test will succeed since Cygwin does support /proc, and this might enable
some #define that enables a codepath in the app where it tries to use
/proc at runtime.  But if you're compiling with the MinGW compiler,
enabling this codepath is nonsense because it won't work at runtime; a
MinGW app opening /proc is meaningless.  It detected a feature of the
build system that is not actually present on the host system because you
lied to configure.  If the test is properly written however it won't be
run when cross compiling, since detecting features of the build system
doesn't make sense in that case.

It has nothing to do with the fact that Cygwin gcc has a -mno-cygwin
switch.  Think of the case where you're building on a Linux system with
a MinGW cross compiler.  The MinGW cross compiler is a linux
application, just like Cygwin's gcc -mno-cygwin is a Cygwin
application.  But you would never think to check features of the Linux
build system in order to determine which codepaths to enable for the
MinGW app, so why is Cygwin any different?  Just because Cygwin can run
MinGW programs doesn't mean it's still not cross compiling conceptually.

> Is the cygwin mingw compiler a cross compiler? or is it the actual
> native mingw compiler?

I assume that you mean "gcc -mno-cygwin" here.  This is still Cygwin
gcc, just put into MinGW personality mode.  So it recognises POSIX
paths, but the output is the same as would be generated by the MinGW
gcc, so it's for all intents and purposes a  host=cygwin target=mingw
cross.

Brian

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-07  1:55             ` Brian Dessent
@ 2008-05-07  2:14               ` Bob Rossi
  2008-05-07  9:34                 ` Brian Dessent
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Rossi @ 2008-05-07  2:14 UTC (permalink / raw)
  To: cygwin

On Tue, May 06, 2008 at 06:49:06PM -0700, Brian Dessent wrote:
> If you really want to use Cygwin as a host to build MinGW (native
> windows) programs you need to treat it like cross compiling and specify
> "--host=i686-pc-mingw32".  But this is most likely NOT what you intended
> to accomplish at all in this case.

Hi Brian,

I've been wondering about this. Why is it necessary to "cross-compile"
from cygwin to mingw when the cygwin environment has the native mingw
compiler? To me, it seems like if the mingw compiler is capable of
running in the build environment, it should just be called and work. 

Is the cygwin mingw compiler a cross compiler? or is it the actual
native mingw compiler?

Thanks,
Bob Rossi

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-07  1:12           ` Mark
@ 2008-05-07  1:55             ` Brian Dessent
  2008-05-07  2:14               ` Bob Rossi
  2008-05-07 12:56             ` Warren Young
  1 sibling, 1 reply; 13+ messages in thread
From: Brian Dessent @ 2008-05-07  1:55 UTC (permalink / raw)
  To: Mark; +Cc: cygwin

Mark wrote:

> At the moment I'm out of my depth with the whole cygwin mingw stuff.
> 
> I had thought that by modifying my etc/profile to pick up mingw istead of the
> GCC bundled in cygwin I would still be able to use the cygwin environment but
> just have mingw do the compiling (doing GCC --version in cygwin gives me 4.1).
> 
> The ./configure script checks for the installation of certain programs, after
> changing the etc/profile file it suddenly doesn't find those programs
> 
> I think I'm really not getting it (which included even managing to start a new
> thread when I wanted to reply to one, great!), I don't understand why the
> configure script suddenly doesn't find the programs, I'll have a really good
> look in the forums but suspect I'm going to go to linux to do the builds.

The thing you are missing is that MinGW and Cygwin are very different
platforms.  MinGW uses the C runtime library of MS Windows (MSVCRT.DLL)
and provides no POSIX emulation, whereas Cygwin provides its own C
library and does emulate a great deal of POSIX functionality.  Because
of this difference the two compilers are not compatible at all -- they
have entirely different header and library search paths, and
objects/librarys built with one cannot be linked to those built with the
other.

You can't expect the MinGW compiler to see any Cygwin headers or
libraries, because it has no idea what /usr/include even means, as it's
a native program with no POSIX emulation.  In other words, using the
MinGW compiler will build only native Win32 apps, it cannot be used to
build Cygwin apps or use any Cygwin features or Cygwin headers or Cygwin
libraries.  When you run configure with MinGW gcc at the front of PATH,
only features available to MinGW gcc will be detected.  What you're
trying to do is fundamentally broken, and just doesn't work the way you
expect.

The only way that you can use MinGW gcc is if you want to build a MinGW
version of the package, which may not even be possible if it hasn't been
ported to native Windows.  And even if it was, you'd have to also build
MinGW versions of all dependant libraries, as the Cygwin ones are not
usable from a MinGW program.  These are two separate and distinct
platforms, you cannot mix and match.

If you really want to use Cygwin as a host to build MinGW (native
windows) programs you need to treat it like cross compiling and specify
"--host=i686-pc-mingw32".  But this is most likely NOT what you intended
to accomplish at all in this case.

Brian

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-07  0:26         ` Christopher Faylor
@ 2008-05-07  1:12           ` Mark
  2008-05-07  1:55             ` Brian Dessent
  2008-05-07 12:56             ` Warren Young
  0 siblings, 2 replies; 13+ messages in thread
From: Mark @ 2008-05-07  1:12 UTC (permalink / raw)
  To: cygwin

Thanks Christopher,

Sorry I did take it a wee bit personally, cheers for clarifying :)

At the moment I'm out of my depth with the whole cygwin mingw stuff. 

I had thought that by modifying my etc/profile to pick up mingw istead of the
GCC bundled in cygwin I would still be able to use the cygwin environment but
just have mingw do the compiling (doing GCC --version in cygwin gives me 4.1). 

The ./configure script checks for the installation of certain programs, after
changing the etc/profile file it suddenly doesn't find those programs

I think I'm really not getting it (which included even managing to start a new
thread when I wanted to reply to one, great!), I don't understand why the
configure script suddenly doesn't find the programs, I'll have a really good
look in the forums but suspect I'm going to go to linux to do the builds.

All the best
Cheers
Mark


--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-06 23:57       ` Mark
@ 2008-05-07  0:26         ` Christopher Faylor
  2008-05-07  1:12           ` Mark
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Faylor @ 2008-05-07  0:26 UTC (permalink / raw)
  To: cygwin

On Tue, May 06, 2008 at 11:29:48PM +0000, Mark wrote:
>Lovely, thanks for that, nice to feel included.

Sorry if you took that overly personally.  Let me clarify.

You are missing a number of things in this particular case.

flex and guile are not libraries, they are programs.

When someone talks about modifying "your path" it usually refers
to programs not libraries.

Your initial assumption that you could just use a mingw compiler to
produce cygwin code or that you could mix and match mingw and cygwin
libraries and objects (it isn't clear which you were assuming) is wrong
and has been mentioned many times in this mailing list.

So you were missing a number of things.  Basically, you can't do what
what you are trying to do the way you are trying to do it.

cgf

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-06 23:40     ` Christopher Faylor
@ 2008-05-06 23:57       ` Mark
  2008-05-07  0:26         ` Christopher Faylor
  0 siblings, 1 reply; 13+ messages in thread
From: Mark @ 2008-05-06 23:57 UTC (permalink / raw)
  To: cygwin


Lovely, thanks for that, nice to feel included.





--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
  2008-05-06 23:10   ` Mark Hanlon
@ 2008-05-06 23:40     ` Christopher Faylor
  2008-05-06 23:57       ` Mark
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Faylor @ 2008-05-06 23:40 UTC (permalink / raw)
  To: cygwin

On Tue, May 06, 2008 at 10:55:58PM +0000, Mark Hanlon wrote:
>Hello,
>
>Thanks to both of you for replying.
>
>I had always just thought that mingw was a compiler that I could use in
>cygwin environment, and that there would be some wee config trick that
>I could get it to pick up flex and guile libraries.
>
>Am I being super thick?

Apparently.

cgf

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Newbie needs help using mingw with cygwin
       [not found] ` <E1JtC2R-0006lX-F2@ciao.gmane.org>
@ 2008-05-06 23:10   ` Mark Hanlon
  2008-05-06 23:40     ` Christopher Faylor
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Hanlon @ 2008-05-06 23:10 UTC (permalink / raw)
  To: cygwin


Hello,

Thanks to both of you for replying.

I had always just thought that mingw was a compiler that I could use in cygwin environment, and that there would be some wee config trick that I could get it to pick up flex and guile libraries.

Am I being super thick?

Cheers
Mark

_________________________________________________________________

Discover and Win with Live Search

http://clk.atdmt.com/UKM/go/msnnkmgl0010000007ukm/direct/01/

--
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-05-07 22:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-06  1:01 Newbie needs help using mingw with cygwin Mark Hanlon
2008-05-06  2:10 ` Tim Prince
2008-05-06 17:16   ` Christopher Faylor
     [not found] <loom.20080506T012312-150@post.gmane.org>
     [not found] ` <E1JtC2R-0006lX-F2@ciao.gmane.org>
2008-05-06 23:10   ` Mark Hanlon
2008-05-06 23:40     ` Christopher Faylor
2008-05-06 23:57       ` Mark
2008-05-07  0:26         ` Christopher Faylor
2008-05-07  1:12           ` Mark
2008-05-07  1:55             ` Brian Dessent
2008-05-07  2:14               ` Bob Rossi
2008-05-07  9:34                 ` Brian Dessent
2008-05-07 12:56             ` Warren Young
2008-05-08  4:56               ` Mark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).