# Compiling for mingw32 under Cygwin

**URL:** <https://www.ruby-forum.com/t/compiling-for-mingw32-under-cygwin/62118>\
**Category:** Ruby\
**Created:** [May 31, 2006, 6:37pm UTC](https://www.ruby-forum.com/t/compiling-for-mingw32-under-cygwin/62118 "2006-05-31T18:37:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [May 31, 2006, 6:37pm UTC](https://www.ruby-forum.com/t/compiling-for-mingw32-under-cygwin/62118/1 "2006-05-31T18:37:57Z")

</div>

Hi there,

I’m trying to compile Ruby under Cygwin, but I want to target mingw32.  
Although I’ve got the mingw32 tools installed, the ./configure step  
doesn’t spot them. Has anyone had any luck with this? Just setting  
CFLAGS=’-mno-cygwin’ isn’t enough, it seems.

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [May 31, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/compiling-for-mingw32-under-cygwin/62118/2 "2006-05-31T18:59:49Z")

</div>

Hi,

Alex Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> I’m trying to compile Ruby under Cygwin, but I want to target mingw32.  
> Although I’ve got the mingw32 tools installed, the ./configure step  
> doesn’t spot them. Has anyone had any luck with this? Just setting  
> CFLAGS=‘-mno-cygwin’ isn’t enough, it seems.

% ./configure --with-gcc=‘gcc -mno-cygwin’

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [May 31, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/compiling-for-mingw32-under-cygwin/62118/3 "2006-05-31T19:18:24Z")

</div>

WATANABE Hirofumi wrote:

> 

Thanks 🙂 Looks like that’s working - make test passes, at least.

I’d assumed that would be equivalent to setting CFLAGS, but it doesn’t  
look like it is. Why isn’t it, and should it be?

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [June 1, 2006, 4:46pm UTC](https://www.ruby-forum.com/t/compiling-for-mingw32-under-cygwin/62118/4 "2006-06-01T16:46:07Z")

</div>

Hi,

At Thu, 1 Jun 2006 02:16:15 +0900,  
Alex Y. wrote in [ruby-talk:195328]:

> I’d assumed that would be equivalent to setting CFLAGS, but it doesn’t  
> look like it is. Why isn’t it, and should it be?

CFLAGS have no effect to a preprocesser. Leaving it as cygwin  
would cause problems.
