Forums » Development »
fixed win32 trunk
Added by martinl over 15 years ago
Hi guys,
i just got lighty compiling and running uppon the base of /trunk rev. 2552 and VC 2008, but there has been some problems i want to commit or share this.
first of all follow steps in /docs/build_win32.txt
CMAKE:
1.) To be honest i don't know what's the real problem and i don't know how to change this proper. Even if you do everything correct (like in /docs/build_win32.txt) it will exit with errors depending on PCRElib.
trick to get that running is to delete fail messages in src/CMakeLists.txt after trying to build and it throws thus error ("libpcre couldn't be found"):
IF(NOT HAVE_PCRE_H) MESSAGE(FATAL_ERROR "pcre.h couldn't be found") ENDIF(NOT HAVE_PCRE_H) IF(NOT HAVE_LIBPCRE) MESSAGE(FATAL_ERROR "libpcre couldn't be found") ENDIF(NOT HAVE_LIBPCRE)
SRC:
1.) need of global defines somewhere (i used autogenereated config.h and added them in the end, not really the place but does the job) some are not really needed but i included them for later usage
#define __attribute__(x) #ifdef _WIN32 #define T_MAXINT int #else #define T_MAXINT intmax_t #endif typedef unsigned int uint32_t; // #ifdef _MSC_VER #define snprintf _snprintf #if _MSC_VER < 1500 #define vsnprintf _vsnprintf #else #define ssize_t SSIZE_T #define uint32_t UINT32 #endif #define strncasecmp _strnicmp #define strcasecmp _stricmp #else #ifdef __MINGW32__ #define WINSOCK_VERSION MAKEWORD(2,0) #else #define strncasecmp strnicmp #define strcasecmp stricmp #endif /* __MINGW32__ */ #endif /* _MSC_VER */
global search and replace of intmax_t with afterwards T_MAXINT
2.) Changes of Projects needed because include path for lighthttp is not set correct under linker properties when you are not using default (empty Binary path in CMAKE)
-> lighthttp output directory of lib is binary output path in cmake.
3.) Changes in lighttpd project under folder "CMake rules" needs to set lemon.exe to correct output directory of lemon project for all .y to c converter steps
4.) Changes in server.c (iam not shure what RUNNING_ON_VALGRIND does so this will maybe not be safe, all others are just TRACE):
-> undefine all lines where signal buld errors appear with:
#if defined(HAVE_SIGACTION) && defined(SA_SIGINFO)
lines: 110, 111, 673, 875, 1907
-> undefine all lines with RUNNING_ON_VALGRIND with:
#ifndef _WIN32
lines: 1289
5.) Changes in plugin.c (iam not shure what RUNNING_ON_VALGRIND does so this will maybe not be safe):
-> undefine all lines with RUNNING_ON_VALGRIND with:
#ifndef _WIN32
lines: 74
6.) Change sys-socket.c & .h:
-> undefine const char *inet_ntop(...) with #ifndef NTDDI_VERSION in both files (this is not needed anymore in VC 2008 i think so)
7.) Changes in crc32.h:
-> Uncomment lines 17-20 because this needs to be globaly defined
8.) Changes in lemon.c
-> #ifndef _WIN32 before #include <unistd.h>
9.) Changes in mod_postgresql_vhost.c
-> #ifndef _WIN32 before #include <stdbool.h>
10.) compile
11.) get config: http://redmine.lighttpd.net/attachments/659/lighttpd.conf and save under lighthttp output directory
change paths and everything you need
12.) copy all mods from the mods output directory (what has been set under cmake to lib output directory) to subdirectory "lib" of lighthttp output directory.
13.) run from command prompt with "lighthttp.exe -D -f lighthttp.conf"
I'll provide upcomming fixes/changes in comments down below.
if this is not working for you i maybe forgot something.
If there is a need to watch the win32 portability or port mods to win32 like ssl or else i'll be happy to contribute.