From c89fa4d230dbdf2d3f12301a916a7b2373d2de14 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 3 Jan 2010 16:19:01 +0000 Subject: added Visual Studio Project not working yet .. :( --- README | 25 ++++ src/anylike.c | 6 + src/datatypes.h | 11 ++ src/win32/anylike.sln | 20 +++ src/win32/anylike.suo | Bin 0 -> 13824 bytes src/win32/anylike.vcproj | 275 ++++++++++++++++++++++++++++++++++++++++ src/win32/make_lua_bytecode.bat | 10 ++ src/win32/make_version_h.bat | 22 ++++ 8 files changed, 369 insertions(+) create mode 100644 src/win32/anylike.sln create mode 100644 src/win32/anylike.suo create mode 100644 src/win32/anylike.vcproj create mode 100644 src/win32/make_lua_bytecode.bat create mode 100644 src/win32/make_version_h.bat diff --git a/README b/README index f04ca4c..2da8920 100644 --- a/README +++ b/README @@ -51,6 +51,13 @@ using openssl: security/openssl +Windows +------- + +common: + Visual Studio C++ (Express Edition is just fine) + lua-5.1.x + Installation ============ @@ -82,6 +89,24 @@ Notes: - on FreeBSD you have to use gmake instead of make +Building on Windows +------------------- + +Download Lua 5.1 from www.lua.org and extract it inside the anylike +root directory. Open the vcproj file inside src\win32 directory. Open +the Visual Studio Prompt from the Tools menu and change to the Lua +directory you just created (i.e.: cd c:\anylike\lua-5.1.4\). +Use the following command to build lua: + +etc\luavs.bat + +After this there should be a lua51.lib as well as a lua.exe and a luac.exe +inside the src directory of the Lua tree. +Close the Command Prompt select the target (Release or Debug) and compile +the project. Now there should be an anylike.exe inside src\win32\Release or +src\win32\Debug depending on the target you have selected. + + Installing ---------- diff --git a/src/anylike.c b/src/anylike.c index 855a072..70f03c5 100644 --- a/src/anylike.c +++ b/src/anylike.c @@ -49,7 +49,9 @@ #include #endif +#ifndef _MSC_VER #include "daemon.h" +#endif #ifndef USE_OPENSSL @@ -241,6 +243,7 @@ int main(int argc, char* argv[]) log_printf(NOTICE, "just started..."); options_parse_post(&opt); +#ifndef _MSC_VER priv_info_t priv; if(opt.username_) if(priv_init(&priv, opt.username_, opt.groupname_)) { @@ -248,6 +251,7 @@ int main(int argc, char* argv[]) log_close(); exit(-1); } +#endif #ifndef USE_OPENSSL ret = init_gnutls(); @@ -259,6 +263,7 @@ int main(int argc, char* argv[]) } #endif +#ifndef _MSC_VER FILE* pid_file = NULL; if(opt.pid_file_) { pid_file = fopen(opt.pid_file_, "w"); @@ -293,6 +298,7 @@ int main(int argc, char* argv[]) fprintf(pid_file, "%d", pid); fclose(pid_file); } +#endif ret = main_loop(&opt); diff --git a/src/datatypes.h b/src/datatypes.h index 051d62e..e9ee657 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -32,6 +32,7 @@ #ifndef ANYLIKE_datatypes_h_INCLUDED #define ANYLIKE_datatypes_h_INCLUDED +#ifndef _MSC_VER #include typedef uint8_t u_int8_t; @@ -42,6 +43,16 @@ typedef uint64_t u_int64_t; /* typedef int16_t int16_t; */ /* typedef int32_t int32_t; */ /* typedef int64_t int64_t; */ +#else +typedef signed __int8 int8_t; +typedef unsigned __int8 u_int8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 u_int16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 u_int32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 u_int64_t; +#endif struct buffer_struct { u_int32_t length_; diff --git a/src/win32/anylike.sln b/src/win32/anylike.sln new file mode 100644 index 0000000..fc673bc --- /dev/null +++ b/src/win32/anylike.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "anylike", "anylike.vcproj", "{5C3917F1-A0E2-46CE-AC2F-BB59A69AC320}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5C3917F1-A0E2-46CE-AC2F-BB59A69AC320}.Debug|Win32.ActiveCfg = Debug|Win32 + {5C3917F1-A0E2-46CE-AC2F-BB59A69AC320}.Debug|Win32.Build.0 = Debug|Win32 + {5C3917F1-A0E2-46CE-AC2F-BB59A69AC320}.Release|Win32.ActiveCfg = Release|Win32 + {5C3917F1-A0E2-46CE-AC2F-BB59A69AC320}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/win32/anylike.suo b/src/win32/anylike.suo new file mode 100644 index 0000000..e215eb4 Binary files /dev/null and b/src/win32/anylike.suo differ diff --git a/src/win32/anylike.vcproj b/src/win32/anylike.vcproj new file mode 100644 index 0000000..3240d64 --- /dev/null +++ b/src/win32/anylike.vcproj @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/win32/make_lua_bytecode.bat b/src/win32/make_lua_bytecode.bat new file mode 100644 index 0000000..f9a8e61 --- /dev/null +++ b/src/win32/make_lua_bytecode.bat @@ -0,0 +1,10 @@ +@echo off + +@setlocal +@set LUATOP=%1 +@set LUA_BYTECODE=anylike.lc +@set LUA_BYTECODE_SRC=anylike_lua_bytecode +@set LUA_SRC=main_loop.lua echo_server.lua + +%LUATOP%\src\luac.exe -o %LUA_BYTECODE% %LUA_SRC% +%LUATOP%\src\lua.exe ..\tools\bin2c.lua %LUA_BYTECODE% %LUA_BYTECODE_SRC% > %LUA_BYTECODE_SRC%.c \ No newline at end of file diff --git a/src/win32/make_version_h.bat b/src/win32/make_version_h.bat new file mode 100644 index 0000000..f68f52e --- /dev/null +++ b/src/win32/make_version_h.bat @@ -0,0 +1,22 @@ +@echo off + +@setlocal +@set /p VERSION=<..\version +@set OUTPUT_FILE=version.h + +echo /* > %OUTPUT_FILE% +echo * anylike version info >> %OUTPUT_FILE% +echo * >> %OUTPUT_FILE% +echo * this file was created automatically >> %OUTPUT_FILE% +echo * do not edit this file directly >> %OUTPUT_FILE% +echo * use win32/make_version_h.bat instead >> %OUTPUT_FILE% +echo */ >> %OUTPUT_FILE% +echo. >> %OUTPUT_FILE% +echo #ifndef ANYLIKE_version_h_INCLUDED >> %OUTPUT_FILE% +echo #define ANYLIKE_version_h_INCLUDED >> %OUTPUT_FILE% +echo. >> %OUTPUT_FILE% +echo #define VERSION_STRING_0 "anylike version %VERSION%" >> %OUTPUT_FILE% +echo #define VERSION_STRING_1 "built on %COMPUTERNAME%, %DATE% %TIME%" >> %OUTPUT_FILE% +echo. >> %OUTPUT_FILE% +echo #endif >> %OUTPUT_FILE% + -- cgit v1.2.3