Re: mod_perl.c:61: `my_perl' undeclared under Cygwin

[prev] [thread] [next] [Date index for 2005/03/25]

From: Nick ***
Subject: Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
Date: 16:04 on 25 Mar 2005
------=_Part_27949_310900939.1111766656640
Content-Type: text/plain; charset="windows-1251"
Content-Transfer-Encoding: 7bit

 >> I have one request. I don't know who I have to ask for this. It's about the 'dllexport' issue with cygwin. I'd like to supply a patch, but for this patch to work I need the compiler flag '-DCYGWIN' to be set for all  .c files in the WrapXS dir when compiling (or src/modules/perl when building with MP_STATIC_EXTS=1)
 >> 
 >> When I try to build as a dso, -DCYGWIN is set, but when I build static MP2 with MP_STATIC_EXTS=1 - the flag isn't there (I haven't tested static mp2 without MP_STATIC_EXTS=1).
 >> Can somebody "fix" this, please? I need the -DCYGWIN to be set everywhere not only when building dso. Sorry for not doing this myself, but someone more familar with mp2 can do it much faster and better.
 >
 >Nick, please try this patch:
 >
 >Index: lib/Apache/Build.pm
 >===================================================================
 >--- lib/Apache/Build.pm (revision 158003)
 >+++ lib/Apache/Build.pm (working copy)
 >@@ -29,6 +29,7 @@
 >
 >  use constant AIX     => $^O eq 'aix';
 >  use constant DARWIN  => $^O eq 'darwin';
 >+use constant CYGWIN  => $^O eq 'cygwin';
 >  use constant IRIX    => $^O eq 'irix';
 >  use constant HPUX    => $^O eq 'hpux';
 >  use constant OPENBSD => $^O eq 'openbsd';
 >@@ -549,6 +550,10 @@
 >         }
 >      }
 >
 >+    if (CYGWIN) {
 >+        $cflags .= " -DCYGWIN";
 >+    }
 >+
 >      $cflags;
 >  }
 
Thank you Stas.
I've attached my patch (which includes yours too). With this patch MP2 now builds fine under Cygwin and almost all tests pass (the ones that fail are related to the MP_STATIC_EXTS=1 option).
I don't know if this is a good fix. I saw it in another application, which had the same problem under Cygwin.

-----------------------------------------------------------------
http://gbg.bg/search - Изпробвайте още сега най-добрата българска търсачка!
------=_Part_27949_310900939.1111766656640
Content-Type: text/plain; name=dllexport.patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=dllexport.patch

Index: xs/Apache/Log/Apache__Log.h
===================================================================
--- xs/Apache/Log/Apache__Log.h	(revision 158999)
+++ xs/Apache/Log/Apache__Log.h	(working copy)
@@ -137,7 +137,10 @@
 #define my_do_join(m, s)                        \
     modperl_perl_do_join(aTHX_ (m), (s))

-static XS(MPXS_Apache__Log_dispatch)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_Apache__Log_dispatch)
 {
     dXSARGS;
     SV *msgsv;
@@ -195,7 +198,10 @@
     XSRETURN_EMPTY;
 }

-static XS(MPXS_Apache__Log_LOG_MARK)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_Apache__Log_LOG_MARK)
 {
     dXSARGS;
     ax = ax; /* -Wall */;
@@ -213,7 +219,10 @@
     });
 }

-static XS(MPXS_Apache__Log_log_xerror)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_Apache__Log_log_xerror)
 {
     dXSARGS;
     SV *msgsv = Nullsv;
@@ -276,7 +285,10 @@
  * $s->warn
  * Apache::ServerRec::warn
  */
-static XS(MPXS_Apache__Log_log_error)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_Apache__Log_log_error)
 {
     dXSARGS;
     request_rec *r = NULL;
Index: xs/Apache/Filter/Apache__Filter.h
===================================================================
--- xs/Apache/Filter/Apache__Filter.h	(revision 158999)
+++ xs/Apache/Filter/Apache__Filter.h	(working copy)
@@ -114,7 +114,10 @@
     }


-static XS(MPXS_modperl_filter_attributes)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_modperl_filter_attributes)
 {
     dXSARGS;
     U32 *attrs = modperl_filter_attributes(ST(0), ST(1));
Index: xs/Apache/SubProcess/Apache__SubProcess.h
===================================================================
--- xs/Apache/SubProcess/Apache__SubProcess.h	(revision 158999)
+++ xs/Apache/SubProcess/Apache__SubProcess.h	(working copy)
@@ -128,7 +128,10 @@
         XSRETURN_UNDEF;                         \
     }

-static XS(MPXS_modperl_spawn_proc_prog)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_modperl_spawn_proc_prog)
 {
     dXSARGS;
     const char *usage = "Usage: spawn_proc_prog($r, $command, [\\@argv])";
Index: xs/Apache/Access/Apache__Access.h
===================================================================
--- xs/Apache/Access/Apache__Access.h	(revision 158999)
+++ xs/Apache/Access/Apache__Access.h	(working copy)
@@ -111,7 +111,10 @@
     return ap_auth_name(r);
 }

-static XS(MPXS_ap_get_basic_auth_pw)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_ap_get_basic_auth_pw)
 {
     dXSARGS;
     request_rec *r;
Index: xs/Apache/Directive/Apache__Directive.h
===================================================================
--- xs/Apache/Directive/Apache__Directive.h	(revision 158999)
+++ xs/Apache/Directive/Apache__Directive.h	(working copy)
@@ -116,7 +116,10 @@
     return newRV_noinc((SV *)hash);
 }

-static XS(MPXS_Apache__Directive_lookup)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_Apache__Directive_lookup)
 {
     dXSARGS;

Index: xs/APR/Base64/APR__Base64.h
===================================================================
--- xs/APR/Base64/APR__Base64.h	(revision 158999)
+++ xs/APR/Base64/APR__Base64.h	(working copy)
@@ -33,7 +33,10 @@
     mpxs_sv_cur_set(sv, decoded_len);
 }

-static XS(MPXS_apr_base64_encode)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_apr_base64_encode)
 {
     dXSARGS;

@@ -42,7 +45,10 @@
     mpxs_set_targ(mpxs_apr_base64_encode, ST(0));
 }

-static XS(MPXS_apr_base64_decode)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_apr_base64_decode)
 {
     dXSARGS;

Index: xs/APR/Table/APR__Table.h
===================================================================
--- xs/APR/Table/APR__Table.h	(revision 158999)
+++ xs/APR/Table/APR__Table.h	(working copy)
@@ -193,7 +193,10 @@
 }


-static XS(MPXS_apr_table_get)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_apr_table_get)
 {
     dXSARGS;

Index: xs/APR/UUID/APR__UUID.h
===================================================================
--- xs/APR/UUID/APR__UUID.h	(revision 158999)
+++ xs/APR/UUID/APR__UUID.h	(working copy)
@@ -38,7 +38,10 @@
     return uuid;
 }

-static XS(MPXS_apr_uuid_format)
+#ifndef CYGWIN
+static
+#endif
+XS(MPXS_apr_uuid_format)
 {
     dXSARGS;

Index: lib/Apache/Build.pm
===================================================================
--- lib/Apache/Build.pm	(revision 158999)
+++ lib/Apache/Build.pm	(working copy)
@@ -29,6 +29,7 @@

 use constant AIX     => $^O eq 'aix';
 use constant DARWIN  => $^O eq 'darwin';
+use constant CYGWIN  => $^O eq 'cygwin';
 use constant IRIX    => $^O eq 'irix';
 use constant HPUX    => $^O eq 'hpux';
 use constant OPENBSD => $^O eq 'openbsd';
@@ -549,6 +550,10 @@
        }
     }

+    if (CYGWIN) {
+        $cflags .= " -DCYGWIN";
+    }
+
     $cflags;
 }

------=_Part_27949_310900939.1111766656640--

mod_perl.c:61: `my_perl' undeclared under Cygwin
sdfgsd sergserg 11:44 on 13 Dec 2004

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
sdfgsd sergserg 15:00 on 13 Dec 2004

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
sdfgsd sergserg 17:32 on 14 Dec 2004

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
Philippe M. Chiasson 04:31 on 31 Jan 2005

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
Nick *** 16:04 on 25 Mar 2005

Generated at 14:43 on 11 Apr 2005 by mariachi v0.52