From 211c72fce4173b76712ae36bc240ca63c4fc1e31 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Thu, 29 Apr 2004 23:11:12 +0000 Subject: win32 fixes for apache 1.3 added win32 build script --- diff --git a/apache13.h b/apache13.h index 3b013cc..bf10af2 100644 --- a/apache13.h +++ b/apache13.h @@ -8,7 +8,7 @@ #include "http_core.h" /* Defines */ -#define AP_MODULE_DECLARE_DATA +#define AP_MODULE_DECLARE_DATA MODULE_VAR_EXPORT #define APR_OFF_T_FMT "ld" #define APR_PID_T_FMT "d" #define APR_SUCCESS 0 @@ -72,9 +72,13 @@ #define apr_tolower ap_tolower -static void log_error(char *file, int line, int level, apr_status_t status, +void log_error(char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 6,7))); -static inline void log_error(char *file, int line, int level, + +#ifndef WIN32 +inline +#endif +void log_error(char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) { 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 @@ +@echo off +cls +rem path to Microsoft SDK installation +SET DIR_MSSDK=C:\Program Files\Microsoft SDK +rem path to apache2 installation +SET DIR_APACHE=C:\Program Files\Apache Group\Apache +rem path to mysql 4.0 installation +SET DIR_MYSQL=C:\MySQL +rem Can be set to opt or debug +SET LIB_MYSQL=opt + +copy /Y winconfig.h config.h +mkdir Release +cd Release +Rem Compile all the source code +echo /MD /W3 /Zi /Ze /O2 > RESP_c.txt +echo /DNDEBUG /D_WINDOWS /DWIN32 >> RESP_c.txt +echo /Fd"mod_log_sql" /FD >> RESP_c.txt +echo /DHAVE_CONFIG_H /DWITH_APACHE13 /DLOGSQL_DECLARE_EXPORT >> RESP_c.txt +echo /DSHARED_MODULE >> RESP_c.txt +echo /I.. >> RESP_c.txt +echo /I"%DIR_MSSDK%\Include" >> RESP_c.txt +echo /I"%DIR_APACHE%\Include" >> RESP_c.txt +echo /I"%DIR_MYSQL%\Include" >> RESP_c.txt +cl @RESP_c.txt /c ..\mod_log_sql.c ..\mod_log_sql_mysql.c + +rem link main module +echo /MACHINE:I386 /SUBSYSTEM:windows > RESP_l.txt +echo /OUT:mod_log_sql.so /DLL /OPT:REF /DEBUG >> RESP_l.txt +echo /LIBPATH:"%DIR_APACHE%\lib" >> RESP_l.txt +echo /LIBPATH:"%DIR_APACHE%\libexec" >> RESP_l.txt +echo /LIBPATH:"%DIR_MSSDK%\lib" >> RESP_l.txt +echo ApacheCore.lib >> RESP_l.txt +link @RESP_l.txt mod_log_sql.obj + +rem link mysql module +echo /MACHINE:I386 /SUBSYSTEM:windows > RESP_l.txt +echo /OUT:mod_log_sql_mysql.so /DLL /OPT:REF /DEBUG >> RESP_l.txt +echo /LIBPATH:"%DIR_APACHE%\lib" >> RESP_l.txt +echo /LIBPATH:"%DIR_APACHE%\libexec" >> RESP_l.txt +echo /LIBPATH:"%DIR_MYSQL%\lib\%LIB_MYSQL%" >> RESP_l.txt +echo /LIBPATH:"%DIR_MSSDK%\lib" >> RESP_l.txt +echo /NODEFAULTLIB:LIBCMT.lib >> RESP_l.txt +echo ApacheCore.lib >> RESP_l.txt +echo libmysql.lib mod_log_sql.lib >> RESP_l.txt +link @RESP_l.txt mod_log_sql_mysql.obj +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, int offset = (int)(long)cmd->info; const char *path; - path = ap_server_root_relative(cmd->pool, arg); + path = ap_server_root_relative(cmd->pool, (char *)arg); if (!path) { return apr_pstrcat(cmd->pool, "Invalid file path ", @@ -1246,7 +1246,7 @@ module AP_MODULE_DECLARE_DATA log_sql_module = { register_hooks /* register hooks */ }; #elif defined(WITH_APACHE13) -module log_sql_module = { +module MODULE_VAR_EXPORT log_sql_module = { STANDARD_MODULE_STUFF, log_sql_module_init, /* module initializer */ 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, #elif defined(WITH_APACHE13) # define LOGSQL_REGISTER(driver) \ static void module_init(server_rec *s, apr_pool_t *p); \ - module log_sql_##driver##_module = { \ + module MODULE_VAR_EXPORT log_sql_##driver##_module = { \ STANDARD_MODULE_STUFF, module_init }; \ static void module_init(server_rec *s, apr_pool_t *p) #endif diff --git a/winconfig.h b/winconfig.h index 107cb7d..c4b4353 100644 --- a/winconfig.h +++ b/winconfig.h @@ -71,7 +71,7 @@ /* #undef WITH_APACHE13 */ /* Define to 1 if we are compiling with Apache 2.0.x */ -#define WITH_APACHE20 1 +/* #undef WITH_APACHE20 */ /* Define to 1 if we are compiling with mysql */ #define WITH_MYSQL 1 -- cgit v0.9.2