diff options
| author | 2004-04-29 23:11:12 +0000 | |
|---|---|---|
| committer | 2004-04-29 23:11:12 +0000 | |
| commit | 211c72fce4173b76712ae36bc240ca63c4fc1e31 (patch) | |
| tree | 6b775e64b874627079f9b037e5236f8dcf6e25b7 | |
| parent | 482c6dba5db896d06099737e8a75be6a3949b492 (diff) | |
win32 fixes for apache 1.3
added win32 build script
| -rw-r--r-- | apache13.h | 10 | ||||
| -rw-r--r-- | build-apache13.bat | 47 | ||||
| -rw-r--r-- | mod_log_sql.c | 4 | ||||
| -rw-r--r-- | mod_log_sql.h | 2 | ||||
| -rw-r--r-- | winconfig.h | 2 |
5 files changed, 58 insertions, 7 deletions
| @@ -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 | ||
| 75 | static void log_error(char *file, int line, int level, apr_status_t status, | 75 | void 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))); |
| 77 | static inline void log_error(char *file, int line, int level, | 77 | |
| 78 | #ifndef WIN32 | ||
| 79 | inline | ||
| 80 | #endif | ||
| 81 | void 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 | ||
| 2 | cls | ||
| 3 | rem path to Microsoft SDK installation | ||
| 4 | SET DIR_MSSDK=C:\Program Files\Microsoft SDK | ||
| 5 | rem path to apache2 installation | ||
| 6 | SET DIR_APACHE=C:\Program Files\Apache Group\Apache | ||
| 7 | rem path to mysql 4.0 installation | ||
| 8 | SET DIR_MYSQL=C:\MySQL | ||
| 9 | rem Can be set to opt or debug | ||
| 10 | SET LIB_MYSQL=opt | ||
| 11 | |||
| 12 | copy /Y winconfig.h config.h | ||
| 13 | mkdir Release | ||
| 14 | cd Release | ||
| 15 | Rem Compile all the source code | ||
| 16 | echo /MD /W3 /Zi /Ze /O2 > RESP_c.txt | ||
| 17 | echo /DNDEBUG /D_WINDOWS /DWIN32 >> RESP_c.txt | ||
| 18 | echo /Fd"mod_log_sql" /FD >> RESP_c.txt | ||
| 19 | echo /DHAVE_CONFIG_H /DWITH_APACHE13 /DLOGSQL_DECLARE_EXPORT >> RESP_c.txt | ||
| 20 | echo /DSHARED_MODULE >> RESP_c.txt | ||
| 21 | echo /I.. >> RESP_c.txt | ||
| 22 | echo /I"%DIR_MSSDK%\Include" >> RESP_c.txt | ||
| 23 | echo /I"%DIR_APACHE%\Include" >> RESP_c.txt | ||
| 24 | echo /I"%DIR_MYSQL%\Include" >> RESP_c.txt | ||
| 25 | cl @RESP_c.txt /c ..\mod_log_sql.c ..\mod_log_sql_mysql.c | ||
| 26 | |||
| 27 | rem link main module | ||
| 28 | echo /MACHINE:I386 /SUBSYSTEM:windows > RESP_l.txt | ||
| 29 | echo /OUT:mod_log_sql.so /DLL /OPT:REF /DEBUG >> RESP_l.txt | ||
| 30 | echo /LIBPATH:"%DIR_APACHE%\lib" >> RESP_l.txt | ||
| 31 | echo /LIBPATH:"%DIR_APACHE%\libexec" >> RESP_l.txt | ||
| 32 | echo /LIBPATH:"%DIR_MSSDK%\lib" >> RESP_l.txt | ||
| 33 | echo ApacheCore.lib >> RESP_l.txt | ||
| 34 | link @RESP_l.txt mod_log_sql.obj | ||
| 35 | |||
| 36 | rem link mysql module | ||
| 37 | echo /MACHINE:I386 /SUBSYSTEM:windows > RESP_l.txt | ||
| 38 | echo /OUT:mod_log_sql_mysql.so /DLL /OPT:REF /DEBUG >> RESP_l.txt | ||
| 39 | echo /LIBPATH:"%DIR_APACHE%\lib" >> RESP_l.txt | ||
| 40 | echo /LIBPATH:"%DIR_APACHE%\libexec" >> RESP_l.txt | ||
| 41 | echo /LIBPATH:"%DIR_MYSQL%\lib\%LIB_MYSQL%" >> RESP_l.txt | ||
| 42 | echo /LIBPATH:"%DIR_MSSDK%\lib" >> RESP_l.txt | ||
| 43 | echo /NODEFAULTLIB:LIBCMT.lib >> RESP_l.txt | ||
| 44 | echo ApacheCore.lib >> RESP_l.txt | ||
| 45 | echo libmysql.lib mod_log_sql.lib >> RESP_l.txt | ||
| 46 | link @RESP_l.txt mod_log_sql_mysql.obj | ||
| 47 | cd .. | ||
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) |
| 1249 | module log_sql_module = { | 1249 | module 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 |
