You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Bob Rossi <bo...@cox.net> on 2006/11/30 05:10:24 UTC

windows && threads

Hi,

I'm trying to configure/build apr on windows with threads. I already see
that apr can be built with cl and windows threads. However, currently
I'd like to avoid using cl, since my project uses the autotools.

I have a few questions,

- can apr be built with mingw and cygwin posix threads?
- can apr be built with mingw and native posix threads?
- can apr be built with cygwin g++ and cygwin posix threads?
- can apr be built with cygwin g++ and native posix threads?
- can apr be built with either mingw or g++ and with any thread library?

I can't seem to get past the configure stage, with out it telling me
that apr will disable thread support. If this answer is already
documented, I'm sorry, please point me in the correct direction.

If it's not already documented, it should be added somewhere, as I've
spent several hours trying to solves this problem already. I'm sure it
would benefit a lot of people.

Thanks for the help,
Bob Rossi

Re: windows && threads

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Bob Rossi wrote:
> Hi,
> 
> I'm trying to configure/build apr on windows with threads. I already see
> that apr can be built with cl and windows threads. However, currently
> I'd like to avoid using cl, since my project uses the autotools.
> 
> I have a few questions,
> 
> - can apr be built with mingw and cygwin posix threads?
> - can apr be built with mingw and native posix threads?
> - can apr be built with cygwin g++ and cygwin posix threads?
> - can apr be built with cygwin g++ and native posix threads?
> - can apr be built with either mingw or g++ and with any thread library?
> 
> If it's not already documented, it should be added somewhere, as I've
> spent several hours trying to solves this problem already. I'm sure it
> would benefit a lot of people.

There has been some work in this direction - there are more patches pending
in http://issues.apache.org/bugzilla/.

The issue with using cygwin beyond-compiling is that you are stacking two
portability layers on top of each other.  Mileage may vary, but it should
look similar to a Hummer.  Similarly with non-native threads, if you are
running under the Win32-NT subsystem.

If you really want to run efficiently and effectively under posix, I suggest
SFU which is a native port, or investigate vmware or the future subsystem
solutions coming out from Netware.

And as we say - patches are ALWAYS welcome for consideration if you can get
past specific issues, but I'd encourage that ./configure should detect that
it is building to the Win32 API unless otherwise informed with --options.

Bill





Re: windows && threads

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 11/29/06, Bob Rossi <bo...@cox.net> wrote:
> I'm trying to configure/build apr on windows with threads. I already see
> that apr can be built with cl and windows threads. However, currently
> I'd like to avoid using cl, since my project uses the autotools.
>
> I have a few questions,
>
> - can apr be built with mingw and cygwin posix threads?
> - can apr be built with mingw and native posix threads?
> - can apr be built with cygwin g++ and cygwin posix threads?
> - can apr be built with cygwin g++ and native posix threads?
> - can apr be built with either mingw or g++ and with any thread library?
>
> I can't seem to get past the configure stage, with out it telling me
> that apr will disable thread support. If this answer is already
> documented, I'm sorry, please point me in the correct direction.
>
> If it's not already documented, it should be added somewhere, as I've
> spent several hours trying to solves this problem already. I'm sure it
> would benefit a lot of people.

It seems that somehow it's gotten overly complicated for you.

Here's the steps I've used with MinGW / msys.

1. Checkout trunk of apr
2. ./buildconf
3. ./configure --enable-experimental-libtool=yes
4. make
5. make install

Windows threads work just fine (i.e. MinGW uses thread/win32/*).
'testall.exe testthread' works.

At a minimum, I know Paul's had success building APR under MinGW too.
I know from personal experience that httpd, Subversion, and other
APR-using projects work okay with MinGW with only a few minor caveats.
 (Largely that projects assume #ifdef Win32 == MSVC which is kind of
bogus anyway.)

So, it really sounds like you're running into issues none of us are.
Can you please give us some details about how your setup is different?

Note that we make minimal guarantees about cygwin as it presents
itself as Unix - not Win32.  On the other hand, MinGW is true Win32
(albeit a different compiler).  -- justin