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 2001/08/11 13:35:52 UTC

[PATCH] 2.0.x pre-alpha support for Cygwin

Attached is a first patch to support the Cygwin 1.x platform. 

It is made against 2.0.22-alpha, due to the fact that I am currently
on vacation and don't have the bandwidth (GSM modem :(( to grap a
fresh CVS tree. Hope someone with commit access to CVS can incorporate
the changes anyway, Martin?!

2.0.22 configures, build and runs with prefork MPM (non-threaded) on
Cygwin 1.1.8 and 1.3.2. Cygwin 1.3.2 supports pthreads, but I have
still problems in getting the threaded MPM to work, so that's why
prefork is assumed as default MPM. 

The patch needs still some work, but this is a first scratch.

Here are the changes:

  * build/binbuild.sh: corrected path to config.guess. This may be
corrected already in recent version?!

  * configure.in: added Cygwin specific APR_SETVARs.

  * os/config.m4: added Cygwin specific values for $OS and $OS_DIR.
$OS_DIR will change to "cygwin" as soon as I get the DSO/DLL things
clean as with 1.3.20.

  * srclib/apr/build/apr_hints.m4: added Cygwin specific APR_ADDTOs.

  * srclib/apr/configure.in: added Cygwin specific directives. $OSDIR
will change to "cygwin" as soon as I clean things up.

  * srclib/apr/file_io/unix/dir.c: changed a suspicious #ifdef
statement. Is this a missconfiguration of thread vs. non-thread #ifdef
exclusion?!?!

  * srclib/apr-util/xml/expat/lib/expat.h.in: added a OS specific
#ifdef statement, due that Cygwin defines __declspec, but we are not
on Win32 and don't want to import from DLL. Maybe this has to be
changed in expat distribution itself?!?!

  * srclib/apr-util/xml/expat/lib/xmlparse.c: same as expat.h.in.

  * support/logresolve.c: added OS specific #ifdef statement to define
h_errno as extern __declspec(dllimport); it's imported from the
cygwin1.dll itself.


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] 2.0.x pre-alpha support for Cygwin

Posted by Ryan Bloom <rb...@covalent.net>.
> >   * srclib/apr/file_io/unix/dir.c: changed a suspicious #ifdef
> > statement. Is this a missconfiguration of thread vs. non-thread #ifdef
> > exclusion?!?!
>
> I am leaving the question of this patch to the more gifted.  I see where
> you are coming from, but I read the original (and patch) three times, and
> came to three different conclusions.  Someone want to determine before we
> tag and roll?
>
>
> --- httpd-2_0_22/srclib/apr/file_io/unix/dir.c Fri Jun 15 20:04:43 2001
> +++ httpd-2_0_22-cygwin/srclib/apr/file_io/unix/dir.c Thu Aug  9 10:00:09
> 2001 @@ -112,7 +112,7 @@
>  {
>      apr_status_t ret = 0;
>  #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
> -    && !defined(READDIR_IS_THREAD_SAFE)
> +    && defined(READDIR_IS_THREAD_SAFE)
>      struct dirent *retent;
>
>      ret = readdir_r(thedir->dirstruct, thedir->entry, &retent);

The code is correct as it is today.  Basically, it is possible for platforms to have
defined _POSIX_THREAD_SAFE_FUNCTIONS, and a thread-safe readdir.

If both of those conditions are true, then we want to use readdir, not readdir_r.
This if statement handle that condition.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] 2.0.x pre-alpha support for Cygwin

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Stipe Tolj" <to...@wapme-systems.de>
Sent: Saturday, August 11, 2001 6:35 AM


> Attached is a first patch to support the Cygwin 1.x platform. 
> 
> It is made against 2.0.22-alpha, due to the fact that I am currently
> on vacation and don't have the bandwidth (GSM modem :(( to grap a
> fresh CVS tree. Hope someone with commit access to CVS can incorporate
> the changes anyway, Martin?!

Done, except as noted below.

I'll stop and pause just a moment so we don't continue to have the same
somewhat frustrating conflict (for both of us ;) and add my 2c, which I
believe are the general concensus.

I'd like to specifically request that you do not imply that the cygwin support
in Apache 2.0 is provided for the "Windows" platform, but only for the "cygwin"
platform.  That is, there is native Win32 support built into the server, for the 
native Win32 filesystem and system calls.  In fact, APR has turned this entire 
concept on it's head, so that Apache could even support Mac OS 9 (gasp!!!)

That said, I am a strong supporter of our users (anyone who drops in on
c.i.w.s.ms-windows can attest :) so I'd like to assure we leverage as much
common code to support these unix wolves trapped in win32 sheep's clothing.  
Please refer to the file in srclib/apr/file_io/win32/pathname.c for the reference 
to the canonicalization facilities in Apache 2.0.  I expect you will want to 
leverage a cygwin optimized flavor of apr_stat/lstat that returns the proper (long)
filename, but substitute the appropriate path rooting for the cygwin platform.  
You may also (with just a little bit of thunking) implement detection of the 
shortcuts-as-symlinks (which I detest :) in your lstat call, so that FollowSymLinks
functionallity is properly supported under the cygwin platform.

Please take the time to study pathname.c, since OS2 and Netware already share that
code branch.  The Unix branch will eventually be extended to properly handle samba
shares (the one weakness in Apache on unix, no surprize) but that's probably not
sufficient for cygwin.

Finally, I'll encourage anyone who wants to offer up a mingw toolchain schema
of the Apache build environment, as it uses the native api and semantics.  I'd
be happy to assist in dealing with some of the newer api's that aren't there just
yet - when I'm able.

Here are my comments on the two exceptions to your patch (and yes - the change to
the config.guess in apr was previously commited.)

> 2.0.22 configures, build and runs with prefork MPM (non-threaded) on
> Cygwin 1.1.8 and 1.3.2. Cygwin 1.3.2 supports pthreads, but I have
> still problems in getting the threaded MPM to work, so that's why
> prefork is assumed as default MPM. 

That's fine.  However...

I see no reason not to enable threads, unless you have a specific issue,
even when running prefork.  Feel free to correct me.  This obviously will
be a versioning issue, from your comments, so I dropped the following lines
from this patch...

--- httpd-2_0_22/srclib/apr/configure.in Fri Jul 27 10:22:04 2001
+++ httpd-2_0_22-cygwin/srclib/apr/configure.in Fri Aug 10 09:41:03 2001
+       enable_threads="no"
+       config_subdirs="shmem/unix/mm"

The others were applied, but this line struck me as odd;

+       eolstr="\\n"

true, I suppose, if the user entirely edits in cygwin/gnu/vi, but not if they
pick up a conf file in notepad :(

>   * srclib/apr/file_io/unix/dir.c: changed a suspicious #ifdef
> statement. Is this a missconfiguration of thread vs. non-thread #ifdef
> exclusion?!?!

I am leaving the question of this patch to the more gifted.  I see where you
are coming from, but I read the original (and patch) three times, and came to
three different conclusions.  Someone want to determine before we tag and roll?


--- httpd-2_0_22/srclib/apr/file_io/unix/dir.c Fri Jun 15 20:04:43 2001
+++ httpd-2_0_22-cygwin/srclib/apr/file_io/unix/dir.c Thu Aug  9 10:00:09 2001
@@ -112,7 +112,7 @@
 {
     apr_status_t ret = 0;
 #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
-    && !defined(READDIR_IS_THREAD_SAFE)
+    && defined(READDIR_IS_THREAD_SAFE)
     struct dirent *retent;
 
     ret = readdir_r(thedir->dirstruct, thedir->entry, &retent);