summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2004-04-29 23:11:12 +0000
committerGravatar Edward Rudd 2004-04-29 23:11:12 +0000
commit211c72fce4173b76712ae36bc240ca63c4fc1e31 (patch)
tree6b775e64b874627079f9b037e5236f8dcf6e25b7
parent482c6dba5db896d06099737e8a75be6a3949b492 (diff)
win32 fixes for apache 1.3
added win32 build script
-rw-r--r--apache13.h10
-rw-r--r--build-apache13.bat47
-rw-r--r--mod_log_sql.c4
-rw-r--r--mod_log_sql.h2
-rw-r--r--winconfig.h2
5 files changed, 58 insertions, 7 deletions
diff --git a/apache13.h b/apache13.h
index 3b013cc..bf10af2 100644
--- a/apache13.h
+++ b/apache13.h
@@ -8,7 +8,7 @@
8#include "http_core.h" 8#include "http_core.h"
9 9
10/* Defines */ 10/* Defines */
11#define AP_MODULE_DECLARE_DATA 11#define AP_MODULE_DECLARE_DATA MODULE_VAR_EXPORT
12#define APR_OFF_T_FMT "ld" 12#define APR_OFF_T_FMT "ld"
13#define APR_PID_T_FMT "d" 13#define APR_PID_T_FMT "d"
14#define APR_SUCCESS 0 14#define APR_SUCCESS 0
@@ -72,9 +72,13 @@
72 72
73#define apr_tolower ap_tolower 73#define apr_tolower ap_tolower
74 74
75static void log_error(char *file, int line, int level, apr_status_t status, 75void log_error(char *file, int line, int level, apr_status_t status,
76 const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 6,7))); 76 const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 6,7)));
77static inline void log_error(char *file, int line, int level, 77
78#ifndef WIN32
79inline
80#endif
81void log_error(char *file, int line, int level,
78 apr_status_t status, const server_rec *s, const char *fmt, ...) 82 apr_status_t status, const server_rec *s, const char *fmt, ...)
79{ 83{
80 static char buff[MAX_STRING_LEN]; 84 static char buff[MAX_STRING_LEN];
diff --git a/build-apache13.bat b/build-apache13.bat
new file mode 100644
index 0000000..77461ee
--- /dev/null
+++ b/build-apache13.bat
@@ -0,0 +1,47 @@
1@echo off
2cls
3rem path to Microsoft SDK installation
4SET DIR_MSSDK=C:\Program Files\Microsoft SDK
5rem path to apache2 installation
6SET DIR_APACHE=C:\Program Files\Apache Group\Apache
7rem path to mysql 4.0 installation
8SET DIR_MYSQL=C:\MySQL
9rem Can be set to opt or debug
10SET LIB_MYSQL=opt
11
12copy /Y winconfig.h config.h
13mkdir Release
14cd Release
15Rem Compile all the source code
16echo /MD /W3 /Zi /Ze /O2 > RESP_c.txt
17echo /DNDEBUG /D_WINDOWS /DWIN32 >> RESP_c.txt
18echo /Fd"mod_log_sql" /FD >> RESP_c.txt
19echo /DHAVE_CONFIG_H /DWITH_APACHE13 /DLOGSQL_DECLARE_EXPORT >> RESP_c.txt
20echo /DSHARED_MODULE >> RESP_c.txt
21echo /I.. >> RESP_c.txt
22echo /I"%DIR_MSSDK%\Include" >> RESP_c.txt
23echo /I"%DIR_APACHE%\Include" >> RESP_c.txt
24echo /I"%DIR_MYSQL%\Include" >> RESP_c.txt
25cl @RESP_c.txt /c ..\mod_log_sql.c ..\mod_log_sql_mysql.c
26
27rem link main module
28echo /MACHINE:I386 /SUBSYSTEM:windows > RESP_l.txt
29echo /OUT:mod_log_sql.so /DLL /OPT:REF /DEBUG >> RESP_l.txt
30echo /LIBPATH:"%DIR_APACHE%\lib" >> RESP_l.txt
31echo /LIBPATH:"%DIR_APACHE%\libexec" >> RESP_l.txt
32echo /LIBPATH:"%DIR_MSSDK%\lib" >> RESP_l.txt
33echo ApacheCore.lib >> RESP_l.txt
34link @RESP_l.txt mod_log_sql.obj
35
36rem link mysql module
37echo /MACHINE:I386 /SUBSYSTEM:windows > RESP_l.txt
38echo /OUT:mod_log_sql_mysql.so /DLL /OPT:REF /DEBUG >> RESP_l.txt
39echo /LIBPATH:"%DIR_APACHE%\lib" >> RESP_l.txt
40echo /LIBPATH:"%DIR_APACHE%\libexec" >> RESP_l.txt
41echo /LIBPATH:"%DIR_MYSQL%\lib\%LIB_MYSQL%" >> RESP_l.txt
42echo /LIBPATH:"%DIR_MSSDK%\lib" >> RESP_l.txt
43echo /NODEFAULTLIB:LIBCMT.lib >> RESP_l.txt
44echo ApacheCore.lib >> RESP_l.txt
45echo libmysql.lib mod_log_sql.lib >> RESP_l.txt
46link @RESP_l.txt mod_log_sql_mysql.obj
47cd ..
diff --git a/mod_log_sql.c b/mod_log_sql.c
index 6a80ece..294380b 100644
--- a/mod_log_sql.c
+++ b/mod_log_sql.c
@@ -288,7 +288,7 @@ static const char *set_server_file_slot(cmd_parms *cmd,
288 int offset = (int)(long)cmd->info; 288 int offset = (int)(long)cmd->info;
289 const char *path; 289 const char *path;
290 290
291 path = ap_server_root_relative(cmd->pool, arg); 291 path = ap_server_root_relative(cmd->pool, (char *)arg);
292 292
293 if (!path) { 293 if (!path) {
294 return apr_pstrcat(cmd->pool, "Invalid file path ", 294 return apr_pstrcat(cmd->pool, "Invalid file path ",
@@ -1246,7 +1246,7 @@ module AP_MODULE_DECLARE_DATA log_sql_module = {
1246 register_hooks /* register hooks */ 1246 register_hooks /* register hooks */
1247}; 1247};
1248#elif defined(WITH_APACHE13) 1248#elif defined(WITH_APACHE13)
1249module log_sql_module = { 1249module MODULE_VAR_EXPORT log_sql_module = {
1250 STANDARD_MODULE_STUFF, 1250 STANDARD_MODULE_STUFF,
1251 log_sql_module_init, /* module initializer */ 1251 log_sql_module_init, /* module initializer */
1252 NULL, /* create per-dir config */ 1252 NULL, /* create per-dir config */
diff --git a/mod_log_sql.h b/mod_log_sql.h
index dc54922..56aa2c3 100644
--- a/mod_log_sql.h
+++ b/mod_log_sql.h
@@ -113,7 +113,7 @@ LOGSQL_DECLARE(void) log_sql_register_driver(apr_pool_t *p,
113#elif defined(WITH_APACHE13) 113#elif defined(WITH_APACHE13)
114# define LOGSQL_REGISTER(driver) \ 114# define LOGSQL_REGISTER(driver) \
115 static void module_init(server_rec *s, apr_pool_t *p); \ 115 static void module_init(server_rec *s, apr_pool_t *p); \
116 module log_sql_##driver##_module = { \ 116 module MODULE_VAR_EXPORT log_sql_##driver##_module = { \
117 STANDARD_MODULE_STUFF, module_init }; \ 117 STANDARD_MODULE_STUFF, module_init }; \
118 static void module_init(server_rec *s, apr_pool_t *p) 118 static void module_init(server_rec *s, apr_pool_t *p)
119#endif 119#endif
diff --git a/winconfig.h b/winconfig.h
index 107cb7d..c4b4353 100644
--- a/winconfig.h
+++ b/winconfig.h
@@ -71,7 +71,7 @@
71/* #undef WITH_APACHE13 */ 71/* #undef WITH_APACHE13 */
72 72
73/* Define to 1 if we are compiling with Apache 2.0.x */ 73/* Define to 1 if we are compiling with Apache 2.0.x */
74#define WITH_APACHE20 1 74/* #undef WITH_APACHE20 */
75 75
76/* Define to 1 if we are compiling with mysql */ 76/* Define to 1 if we are compiling with mysql */
77#define WITH_MYSQL 1 77#define WITH_MYSQL 1