I have previously send in to the mod_perl mailing list a patch to make
libapreq compile under AIX, but this patch was for the old version and
thus probably was not applied. I have redone the patch again but this
time relative to the current cvs repository of libapreq. This patch does
the following:
* If compiling using a non-gcc compiler the gcc __attribute__ feature
gets defined twice, once by apache headers and once by perl headers.
The patch undefs it inbetween so the compiler does not barf because of
the redefinition.
* The function my_memstr c/apache_multipart_buffer.c attempts to perform
pointer arithmetic on void * variables, which does not work in
standard C as a void * has no size. I changed the pointers to unsigned
char *.
* The header file apache_request.h does use a C++ comment which produces
warning in a normal C compiler about extra garbage at the end of an
#endif pre-processor statement, making this a C comment avoids the
warning.
* AIX needs extra linker flags to cope with the special .exp file
mechanism that defines the symbols to export for a dynamic shared
object/shared library. The Apache::src module has a convenient method
to retrieve these flags if needed.
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: [EMAIL PROTECTED]
Index: Cookie/Cookie.xs
===================================================================
RCS file: /home/cvspublic/httpd-apreq/Cookie/Cookie.xs,v
retrieving revision 1.3
diff -u -d -r1.3 Cookie.xs
--- Cookie/Cookie.xs 2000/03/30 04:49:14 1.3
+++ Cookie/Cookie.xs 2000/12/27 18:26:15
@@ -1,5 +1,6 @@
#include "apache_request.h"
#include "apache_cookie.h"
+#undef __attribute__
#include "mod_perl.h"
typedef ApacheCookie * Apache__Cookie;
Index: Cookie/Makefile.PL
===================================================================
RCS file: /home/cvspublic/httpd-apreq/Cookie/Makefile.PL,v
retrieving revision 1.1.1.1
diff -u -d -r1.1.1.1 Makefile.PL
--- Cookie/Makefile.PL 1999/01/27 01:33:20 1.1.1.1
+++ Cookie/Makefile.PL 2000/12/27 18:26:15
@@ -28,6 +28,9 @@
'INC' => "-I../c ". $src->inc,
'TYPEMAPS' => $src->typemaps,
'LIBS' => "-L$root -lapreq",
+ 'dynamic_lib' => {
+ 'OTHERLDFLAGS' => $src->otherldflags,
+ },
);
unlink "$root/libapreq.a";
}
Index: Request/Makefile.PL
===================================================================
RCS file: /home/cvspublic/httpd-apreq/Request/Makefile.PL,v
retrieving revision 1.1.1.1
diff -u -d -r1.1.1.1 Makefile.PL
--- Request/Makefile.PL 1999/01/27 01:33:20 1.1.1.1
+++ Request/Makefile.PL 2000/12/27 18:26:16
@@ -28,6 +28,9 @@
'INC' => "-I../c ". $src->inc,
'TYPEMAPS' => $src->typemaps,
'LIBS' => "-L$root -lapreq",
+ 'dynamic_lib' => {
+ 'OTHERLDFLAGS' => $src->otherldflags,
+ },
);
unlink "$root/libapreq.a";
}
Index: Request/Request.xs
===================================================================
RCS file: /home/cvspublic/httpd-apreq/Request/Request.xs,v
retrieving revision 1.4
diff -u -d -r1.4 Request.xs
--- Request/Request.xs 1999/05/13 20:43:34 1.4
+++ Request/Request.xs 2000/12/27 18:26:16
@@ -1,4 +1,5 @@
#include "apache_request.h"
+#undef __attribute__
#include "mod_perl.h"
typedef ApacheRequest * Apache__Request;
Index: c/apache_multipart_buffer.c
===================================================================
RCS file: /home/cvspublic/httpd-apreq/c/apache_multipart_buffer.c,v
retrieving revision 1.3
diff -u -d -r1.3 apache_multipart_buffer.c
--- c/apache_multipart_buffer.c 2000/12/19 00:21:57 1.3
+++ c/apache_multipart_buffer.c 2000/12/27 18:26:16
@@ -69,12 +69,12 @@
{
int needlen = strlen(needle);
int len = haystacklen;
- void *ptr = haystack;
+ unsigned char *ptr = haystack;
/* iterate through first character matches */
while( (ptr = memchr(ptr, needle[0], len)) ) {
/* calculate length after match */
- len = haystacklen - (ptr - haystack);
+ len = haystacklen - (ptr - (unsigned char *)haystack);
/* done if matches up to capacity of buffer */
if(memcmp(needle, ptr, needlen < len ? needlen : len) == 0 &&
Index: c/apache_request.h
===================================================================
RCS file: /home/cvspublic/httpd-apreq/c/apache_request.h,v
retrieving revision 1.3
diff -u -d -r1.3 apache_request.h
--- c/apache_request.h 2000/03/30 05:03:29 1.3
+++ c/apache_request.h 2000/12/27 18:26:16
@@ -102,4 +102,4 @@
#define REQ_DEBUG(a)
#endif
-#endif // _APACHE_REQUEST_H
+#endif /* _APACHE_REQUEST_H */