DevelWin32 » History » Revision 10
Revision 9 (gstrauss, 2021-08-23 22:41) → Revision 10/11 (gstrauss, 2023-02-24 07:56)
h1. Compiling Lighty on win32 h2. cygwin lighttpd is maintained as a set of packages available from cygwin @setup.exe@ and supports nearly all the same features of lighttpd available on unix-like systems. h2. native _WIN32 lighttpd development prototype for _WIN32 may be built using (cygwin or msys) mingw or using MS Visual Studio. https://github.com/gstrauss/lighttpd1.4/tree/win32-exp This is a prototype and you are strongly advised against using _WIN32 lighttpd in production. --- h2. native win32 (ancient documentation) *(WARNING: out-dated documentation)* Starting with lighty 1.4.11-svn the source compiles on windows. Not all parts are ported, but it works in general. h3. Requirements * Visual C++ (e.g. "Visual C++ Toolkit":http://msdn.microsoft.com/visualc/vctoolkit2003/ or "Visual C++ 2005 Express":http://msdn.microsoft.com/vstudio/express/visualc/download/) * the win32-SDK from the "Platform SDK":http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk (tip: you don't need the full package) * "SCons":http://www.scons.org/ (scons 0.96.91 or higher) which requires "Python":http://www.python.org/ SCons needs a configfile in the same folder as the SConstruct file. My config.py file looks like this: <pre> prefix='c:/lighttpd-scons/' VC_TOOLKIT_HOME='c:/Programme/Microsoft Visual C++ Toolkit 2003/' PSDK_HOME='c:/Programme/Microsoft Platform SDK/' # with_mysql='/usr/local/mysql/bin/mysql_config' with_pcre='no' with_openssl='no' with_gzip='no' with_bzip2='no' with_memcached='no' with_sqlite3='no' with_xml='no' # default 'no' build_static='yes' # default 'no' build_fullstatic='no' # default 'yes' build_dynamic='no' </pre> All the with_* options have to 'no' for now, build_static is the only way that works and VC_TOOLKIT_HOME and PSDK_HOME have to be set to the locations of the Visual C++ Toolkit and the Platform SDK. <pre> $ scons </pre> will build the lighty (lighttpd-semi-static.exe) in the 'build' directory. h3. Problems With a get of /trunk/ as of 11/28/2006, and using VS2005, I get: <pre> scons: *** An executable should have exactly one target with the suffix: .exe </pre> Deleting that section out of the SConscript (it seems to be for building test apps?) gets me a bit farther until: <pre> src\server.c(3) : fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory </pre> Anyone have any suggestions? As with r1504 /trunk/ it seems that Win32 build is broken: sys/time.h only exists in POSIX environment, possibly should be using sys/utime.h under Win32. Local implementation of getopt.h is missing.