You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Dan Johnson <dm...@nrtc.northrop.com> on 2005/07/11 18:43:40 UTC

Building APR with Cygwin?

Has anyone build APR 1.1.1 on Cygwin? I found some packages at Cygwin's
site but they were 0.9.5 and 0.9.6.
 
I tried building the Unix distribution directly but the configure script
dies with "decision on anonymous shared memory allocation method
failed." Is this a well-known problem?
 
Thanks,
Dan
 
Daniel M. Johnson Software Engineer | One  Hornet Way, MS 9M52/W6
Northrop Grumman Integrated Systems | El Segundo, CA 90245-2804
J-UCAS Vehicle Management Systems   | Telephone: (310) 345-5253
 

Re: Building APR with Cygwin?

Posted by John Vandenberg <ja...@gmail.com>.
On 7/13/05, Dan Johnson <dm...@nrtc.northrop.com> wrote:
> 
> 
> The problem is that I need to compile using MinGW under Cygwin, and
> MinGW doesn't provide any of the shared memory header files (shm.h,
> sys/mmap.h, sys/mman.h, etc.) so the test fails.

Dan,

It sounds like you are building for MinGW, and Cygwin is just a build
environment.  Is that what you want; native binaries produced using a
normal build system?

> A quick Google shows that a few other people have had this problem
> trying to build Subversion with MinGW but it doesn't look like anyone's
> resolved it. Does anyone know of a successful APR build with MinGW?

Curt Arnold has successfully built it using Ant + cpptask as part of
the log4cxx project.
If you want to take a look, most of the problems have been addressed
in this patch:

http://zeroj.hda0.net/apr-win32-20050713.patch

There may be win32 problems in these changes because the tests do not
build using the libtool approach.  Here is the log.

$ make test
(cd test && make check OSDIR=/d/workpits/apr-mingw/include/arch/win32 )
make[1]: Entering directory `/d/workpits/apr-mingw/test'
/bin/sh ./libtool --silent --mode=compile gcc -g -O2   -DHAVE_CONFIG_H
   -I../include -I./../include
-I/d/workpits/apr-mingw/include/arch/win32  -o testlockperf.lo -c
testlockperf.c && touch testlockperf.lo
/bin/sh ./libtool --silent --mode=link  gcc -g -O2   -DHAVE_CONFIG_H  
 -I../include -I./../include
-I/d/workpits/apr-mingw/include/arch/win32  -no-install
-Wl,--enable-auto-import,--subsystem,console   -o testlockperf.exe
testlockperf.lo ../libapr.la    -lrpcrt4 -lws2_32 -ladvapi32 -lshell32
-lkernel32 -lmsvcrt
fu000001.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname'
fu000002.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname'
fu000003.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname'
fu000004.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname'
fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname'
fu000006.o(.idata$3+0xc): more undefined references to
`libmsvcrt_a_iname' follow
nmth000000.o(.idata$4+0x0): undefined reference to `_nm___pctype'
make[1]: *** [testlockperf.exe] Error 1
make[1]: Leaving directory `/d/workpits/apr-mingw/test'
make: *** [check] Error 2

I am working on removing the libtool dependance in order that a native
dll is created and used.

> Thanks,
> Dan

Cheers,
John

RE: Building APR with Cygwin?

Posted by Cliff Woolley <jw...@virginia.edu>.
On Tue, 12 Jul 2005, Dan Johnson wrote:

> The problem is that I need to compile using MinGW under Cygwin, and
> MinGW doesn't provide any of the shared memory header files (shm.h,
> sys/mmap.h, sys/mman.h, etc.) so the test fails.
> A quick Google shows that a few other people have had this problem
> trying to build Subversion with MinGW but it doesn't look like anyone's
> resolved it. Does anyone know of a successful APR build with MinGW?

I feel like I remember a little discussion about this on this list at some
point in the past, but basically what I'd ask is, simply, why use Cygwin?
APR is by its nature designed to be its own portability layer -- you don't
need the added portability layer of cygwin stacked on top of it.  You can
build APR natively on win32 with no trouble at all; we distribute visual
studio projects with APR for this purpose.  The upshot is that you can
therefore build a native Subversion on win32 as well by using a native
APR, since it's APR's job to do all the interfacing with the operating
system.

RE: Building APR with Cygwin?

Posted by Dan Johnson <dm...@nrtc.northrop.com>.

The problem is that I need to compile using MinGW under Cygwin, and
MinGW doesn't provide any of the shared memory header files (shm.h,
sys/mmap.h, sys/mman.h, etc.) so the test fails.

A quick Google shows that a few other people have had this problem
trying to build Subversion with MinGW but it doesn't look like anyone's
resolved it. Does anyone know of a successful APR build with MinGW?

Thanks,
Dan

Daniel M. Johnson Software Engineer | One  Hornet Way, MS 9M52/W6
Northrop Grumman Integrated Systems | El Segundo, CA 90245-2804
J-UCAS Vehicle Management Systems   | Telephone: (310) 345-5253

-----Original Message-----
From: John Vandenberg [mailto:jayvdb@gmail.com] 
Sent: Tuesday, July 12, 2005 12:37 AM
To: Dan Johnson
Cc: dev@apr.apache.org
Subject: Re: Building APR with Cygwin?

On 7/12/05, Dan Johnson <dm...@nrtc.northrop.com> wrote:
Hi Dan,

> 
> Has anyone build APR 1.1.1 on Cygwin? I found some packages at
Cygwin's site
> but they were 0.9.5 and 0.9.6. 
> 
>   
> 
> I tried building the Unix distribution directly but the configure
script
> dies with "decision on anonymous shared memory allocation method
failed." Is
> this a well-known problem? 
> 


I quickly attempted this on Cygwin using the 1.1.1 & trunk code,
without any issues.  The relevant part of the log for each looks like
this on Windows XP when I generate configure using an up to date
Cygwin with `autoconf-2.5x'

...
checking for shmdt... yes
checking for shmctl... yes
checking for create_area... no
checking for MAP_ANON in sys/mman.h... yes
checking for /dev/zero... yes
checking for mmap that can map /dev/zero... yes
decision on anonymous shared memory allocation method... 4.4BSD-style
mmap() via
 MAP_ANON
decision on namebased memory allocation method... SysV IPC shmget()
...

I dont know a lot about Cygwin, but I would check that out first.

What were the configure results for header sys/mman.h, function mmap,
and function munmap?

Cheers,
John


Re: Building APR with Cygwin?

Posted by John Vandenberg <ja...@gmail.com>.
On 7/12/05, Dan Johnson <dm...@nrtc.northrop.com> wrote:
Hi Dan,

> 
> Has anyone build APR 1.1.1 on Cygwin? I found some packages at Cygwin's site
> but they were 0.9.5 and 0.9.6. 
> 
>   
> 
> I tried building the Unix distribution directly but the configure script
> dies with "decision on anonymous shared memory allocation method failed." Is
> this a well-known problem? 
> 


I quickly attempted this on Cygwin using the 1.1.1 & trunk code,
without any issues.  The relevant part of the log for each looks like
this on Windows XP when I generate configure using an up to date
Cygwin with `autoconf-2.5x'

...
checking for shmdt... yes
checking for shmctl... yes
checking for create_area... no
checking for MAP_ANON in sys/mman.h... yes
checking for /dev/zero... yes
checking for mmap that can map /dev/zero... yes
decision on anonymous shared memory allocation method... 4.4BSD-style mmap() via
 MAP_ANON
decision on namebased memory allocation method... SysV IPC shmget()
...

I dont know a lot about Cygwin, but I would check that out first.

What were the configure results for header sys/mman.h, function mmap,
and function munmap?

Cheers,
John