Bug 38364

Summary: apache 1.3.34 can not compile under cygwin anymore due to getline
Product: Apache httpd-1.3 Reporter: Iavor Raytchev <iavor.raytchev>
Component: BuildAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P2    
Version: 1.3.34   
Target Milestone: ---   
Hardware: Other   
OS: Windows XP   

Description Iavor Raytchev 2006-01-24 09:27:56 UTC
cygwin have introduced a getline function during the last two months (December
2005/January 2005) and now make of apache 1.3.34 (after normal ./configure) ends
with this -

===> src/support
make[2]: Entering directory `/home/src/apache/apache_1.3.34/src/support'
gcc -c  -I../os/cygwin -I../include   -DCYGWIN -DUSE_HSREGEX -DNO_DL_NEEDED
`../apaci` htpasswd.c
htpasswd.c:101: error: conflicting types for 'getline'
/usr/include/sys/stdio.h:31: error: previous declaration of 'getline' was here
htpasswd.c:101: error: conflicting types for 'getline'
/usr/include/sys/stdio.h:31: error: previous declaration of 'getline' was here
make[2]: *** [htpasswd.o] Error 1
make[2]: Leaving directory `/home/src/apache/apache_1.3.34/src/support'
make[1]: *** [build-support] Error 1
make[1]: Leaving directory `/home/src/apache/apache_1.3.34'
make: *** [build] Error 2 

Related problems are discussed here -

http://www.cygwin.com/ml/cygwin/2005-12/msg00183.html
http://www.mail-archive.com/cygwin@cygwin.com/msg62795.html 

Today I wrote to cygwin@cygwin.com and got the following reply -

[start of reply]

"pobox@verysmall.org" wrote:

> > The second one points out that this is apache problem, but I compiled
> > apache 1.3.34 tens of times for cygwin in the past months (last compile
> > 1-2 months ago) without any problem.

Just because Cygwin changed does not mean it's not an Apache problem. 
Cygwin added an implementation of getline() where there was not one
before. But Apache's build system makes false assumptions about this
function not existing, so it blindly tries to use its own included
version. This is the whole point of autoconf, to test for functionality
on the platform and act accordingly. If Apache tries to use its own
getline() when one exists in the system library then it is broken and
needs to be fixed.

> > Could anybody tell me how can I roll back to cygwin 1-5-18, so that I
> > can work until this is resolved?

Select the desired version of the cygwin package in setup.exe.

However, by doing this you just exacerbate the problem so that it
continues to exist.  What needs to happen is for users of Apache to
report this deficiency in its build system to the developers so that
future versions of Apache can be fixed.  Consider filing a PR at
<http://issues.apache.org/bugzilla/> or posting on their mailing list.

Brian

[end of repy]

Is there any change that to be fixed at all (and soon) or should I try higher
version of apache (and will it work at all).

This is quite critical as I can't work at the moment...

Thanks!
Comment 1 Iavor Raytchev 2006-01-24 09:39:40 UTC
I meant December 2005/January 2006.
Comment 2 Martin Espinoza 2006-02-02 00:06:34 UTC
See PR#9894, "getline sub in support progs collides with existing getline def'n"
(found out about it on http://www.cygwin.com/ml/cygwin/2006-01/msg01152.html
after googling.) This patch does not cleanly apply to the latest apache 1.3
(version has changed) but the method used in the patch works fine. I tried just
adding "#define getline ap_getline" to the files in question but it only worked
properly on two of three of them so I went ahead and made the patch changes
manually.

I had another problem, though, so I'm not really sure this is a complete solution...
Comment 3 William A. Rowe Jr. 2006-09-19 19:41:56 UTC
Their advise is lovely for Apache 2.0 (where we have autoconf detection),
but classic 1.3 relies on a specific OS version adding or removing
functionality.

Tell us the signature (a #define in cygwin for the version that introduced
this new function) and we can provide an exception for the new version.