You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stipe Tolj <to...@wapme-systems.de> on 2002/01/02 12:42:01 UTC

[PATCH] 1.3: further Cygwin platform support

I have added a couple of changes to the Cygwin 1.x platform support
for the 1.3 branch. First of all this diff is against a recent cvs
tree. The patch applies cleanly to the current cvs tree.

What's new:

  * Supports now --enable-shared=max option for configure, which is
also used in src/helpers/binbuild.sh for the binary distribution. This
solves especially the mod_proxy compilation problem we had previosly.

  * Cygwin now has an additional configure rule CYGWIN_WINSOCK, which
enables to use Win32 native calls for the socket calls instead of
using POSIX.1 wrappers by the Cygwin emulation layer itself. This is
an performance gain of about 5-10%. Therefore we had to add a couple
of define statements in src/main/buff.c.

  * For accept mutexes we used previously fctnl, which seems to have a
cerious problem when using more then one Listen directive in
httpd.conf. Apache starts and serves on any port specified by Listen,
but does not shut down. Even using the Win32 task manager to kill the
parent httpd process did not suceed. We now use pthread as default
accept mutex mechanism, which works without any known problems.

  * Added #define wrapper for the timeout signal too, that is
different for Cygwin that for other Unixes to be more drastic on this
platform. We still encounter Keep-Alive hanging childs that do not go
away in the timeout limit. This seems to be a Cygwin OS layer problem,
still investigating.


The patch has been created with impact for other platforms in mind. So
there are no changes in behaviour for other OSs.

Here are the changes in the current 1.3 cvs tree:

  * src/Configuration.tmpl: added Rule CYGWIN_WINSOCK for Win32 native
socket support.
  * src/Configure: added checking for RULE_CYGWIN_WINSOCK in the
Cygwin case block. Changed OS_MODULE_INCLUDE to use the full
(relative) path, so we can find the additional Makefile in other
source directories too (i.e proxy).
  * src/helpers/binbuild.sh: Added pre-defined MAKERUN statement
(suggested by Martin) to make env safe. Cygwin needs to re-run "make"
due to the fact that linking shared modules requires to have the
shared core DLL present, which is in fact linked at the end.
  * src/helpers/install.sh: add .exe extension for executables on
Cygwin. Martin, this should be a satisfying solution and should work
for any OS (if any would use the script and .exe extensions)?!
  * src/include/ap_config.h: changed default to
USE_PTHREAD_SERIALIZED_ACCEPT.
  * src/main/buff.c: added #defines to include native Win32 socket
calls if CYGWIN_WINSOCK rule is used.
  * src/main/http_main.c: exluded pthread_mutexattr_setpshared() call
for Cygwin, which seems to have OS specific problems. Added aditional
#defines for CYGWIN_WINSOCK. Added wrapper #define SIG_TIMEOUT_KILL to
handle which signal is used for timeout shutdowns of the childs.
  * src/modules/proxy/Makefile.tmpl: the libproxy.dll Makefile rule
has been hard-coded for OS/2, which is not a good idea, Cygwin
produces also a libproxy.dll version, but with other tools, so we have
to introduce an if statement here to see on which OS we are.
  * src/modules/standard/Makefile.Cygwin: added an "empty" rule to
satisfy OS/2 specific dependancies. This won't hurt the build process.
Removing the shared core import library if existing to update
everything inside and use a dummy file to indicate if the re-run
warning has to be displayed. It should be displayed only once, in
order to not annoy the user.
  * src/os/cygwin/os.h: added necessary declarations for the
CYGWIN_WINSOCK rule.


Can someone, maybe Martin and Lars review the code and commit to cvs,
please?!


Stipe

tolj@wapme-systems.de
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: info@wapme-systems.de
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are

Re: [PATCH] 1.3: further Cygwin platform support

Posted by Martin Kraemer <Ma...@fujitsu-siemens.com>.
On Fri, Jan 11, 2002 at 10:37:12AM +0100, Stipe Tolj wrote:
> Hi Martin,
> 
> > 
> > Testing for [ ! -f "$src." ] is not the same thing
> > as testing for [ ! -f "$src" ].
> 
> I know! -- somehow I have to trick the beast on Cygwin to get a clean
> make install to copy the whole executables.
> 
> Should I add a uname case switch here to be on the same side?!
> Or maybe a checking of env var $OSTYPE?!

Yes, either would be ok with me. OSTYPE is probably cheaper ;-)

> Wie wär's mit einem Treffen auf der CeBIT? Schätze werden einige von
> uns da sein?!

Sorry, I think no :-(

  Martin
-- 
<Ma...@Fujitsu-Siemens.com>         |     Fujitsu Siemens
Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730  Munich,  Germany

Re: [PATCH] 1.3: further Cygwin platform support

Posted by Stipe Tolj <to...@wapme-systems.de>.
Hi Martin,

> Sorry to be picky here.... (Slowly, you're beginning to convince
> me that the extra test for "! -f $src" is not worth the trouble
> of fighting against cygwin's stupidity)...
> 
> Testing for [ ! -f "$src." ] is not the same thing
> as testing for [ ! -f "$src" ].

I know! -- somehow I have to trick the beast on Cygwin to get a clean
make install to copy the whole executables.

Should I add a uname case switch here to be on the same side?!
Or maybe a checking of env var $OSTYPE?!

Have you any other proposal for getting this *done*?

> And it is the latter which I was worried about:
> what happens if -on a unix platform- I happen
> to have a $src.exe in my directory? Yes, Apache will assume
> that my platform uses the .exe extension. And it will break.

That's true -- but, there is no Unix platform (at least currently)
that *build* httpd.exe  (or any other .exe extension executable), is
there?!

> But if it breaks on Cygwin, I am much less worried that when
> it breaks on unix, to be honest. So IMHO, it is cygwin that
> should be fixed so that it will allow us to make such a test.

I agree and I'll try to propose a change to that. But the stupidity
was introduced to demands the Cygwin folks had, so I'm not that eager
that the change will be done on that side very easily.

Wie wär's mit einem Treffen auf der CeBIT? Schätze werden einige von
uns da sein?!


Stipe


tolj@wapme-systems.de
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: info@wapme-systems.de
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are

Re: [PATCH] 1.3: further Cygwin platform support

Posted by Martin Kraemer <Ma...@Fujitsu-Siemens.com>.
On Wed, Jan 02, 2002 at 12:42:01PM +0100, Stipe Tolj wrote:
> diff -ur apache-1.3/src/helpers/install.sh apache-1.3-cygwin/src/helpers/install.sh
> --- apache-1.3/src/helpers/install.sh	Tue Jun 12 10:24:54 2001
> +++ apache-1.3-cygwin/src/helpers/install.sh	Sat Nov 10 17:07:48 2001
> @@ -88,13 +88,9 @@
>  fi
>  
>  #  Check if we need to add an executable extension (such as ".exe") 
> -#  on specific OS to src and dst
> -if [ -f "$src.exe" ]; then
> -  if [ -f "$src" ]; then
> -    : # Cygwin [ test ] is too stupid to do [ -f "$src.exe" ] && [ ! -f "$src" ]
> -  else
> -    ext=".exe"
> -  fi
> +#  on specific OS to src and dst.
> +if [ -f "$src.exe" ] && [ ! -f "$src." ] then
> +  ext=".exe"
>  fi
>  src="$src$ext"
>  dst="$dst$ext"

Sorry to be picky here.... (Slowly, you're beginning to convince
me that the extra test for "! -f $src" is not worth the trouble
of fighting against cygwin's stupidity)...

Testing for [ ! -f "$src." ] is not the same thing
as testing for [ ! -f "$src" ].

And it is the latter which I was worried about:
what happens if -on a unix platform- I happen
to have a $src.exe in my directory? Yes, Apache will assume
that my platform uses the .exe extension. And it will break.

But if it breaks on Cygwin, I am much less worried that when
it breaks on unix, to be honest. So IMHO, it is cygwin that
should be fixed so that it will allow us to make such a test.

   Martin
-- 
<Ma...@Fujitsu-Siemens.com>         |     Fujitsu Siemens
Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730  Munich,  Germany

Re: [PATCH] 1.3: further Cygwin platform support

Posted by Stipe Tolj <to...@wapme-systems.de>.
Fix for a typo in the patch for src/helpers/install.sh:

I forgot the semicolon in the if statement line which oviously breaks
the beast.

Of course this has to be:

> diff -ur apache-1.3/src/helpers/install.sh apache-1.3-cygwin/src/helpers/install.sh
> --- apache-1.3/src/helpers/install.sh   Tue Jun 12 10:24:54 2001
> +++ apache-1.3-cygwin/src/helpers/install.sh    Sat Nov 10 17:07:48 2001
> @@ -88,13 +88,9 @@
>  fi
> 
>  #  Check if we need to add an executable extension (such as ".exe")
> -#  on specific OS to src and dst
> -if [ -f "$src.exe" ]; then
> -  if [ -f "$src" ]; then
> -    : # Cygwin [ test ] is too stupid to do [ -f "$src.exe" ] && [ ! -f "$src" ]
> -  else
> -    ext=".exe"
> -  fi
> +#  on specific OS to src and dst.
> +if [ -f "$src.exe" ] && [ ! -f "$src." ]; then
> +  ext=".exe"
>  fi
>  src="$src$ext"
>  dst="$dst$ext"

Stipe

tolj@wapme-systems.de
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: info@wapme-systems.de
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are