summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/.gitignore3
-rw-r--r--win/CMakeLists.txt41
-rw-r--r--win/README.txt2
-rw-r--r--win/inspircd.rc.cmake8
-rw-r--r--win/inspircd_config.h.cmake13
-rw-r--r--win/inspircd_memory_functions.cpp1
-rw-r--r--win/inspircd_version.h.cmake4
-rw-r--r--win/inspircd_win32wrapper.cpp67
-rw-r--r--win/inspircd_win32wrapper.h98
-rw-r--r--win/make_gnutls_cert.bat26
-rw-r--r--win/modules/CMakeLists.txt42
-rw-r--r--win/win32service.cpp4
-rw-r--r--win/win32service.h2
13 files changed, 121 insertions, 190 deletions
diff --git a/win/.gitignore b/win/.gitignore
index f53ca0701..4b875ca61 100644
--- a/win/.gitignore
+++ b/win/.gitignore
@@ -1,3 +1,2 @@
-inspircd_version.h
-inspircd_config.h
+config.h
inspircd.rc
diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt
index 7be08a3fc..107102281 100644
--- a/win/CMakeLists.txt
+++ b/win/CMakeLists.txt
@@ -2,25 +2,28 @@ cmake_minimum_required(VERSION 2.8)
project(InspIRCd CXX)
-set(CONF_PATH "conf" CACHE PATH "Configuration file path")
-set(MODULE_PATH "modules" CACHE PATH "Module path")
-set(DATA_PATH "data" CACHE PATH "Data path")
-set(LOG_PATH "logs" CACHE PATH "Log file path")
+set(CONFIG_DIR "conf" CACHE PATH "Configuration file path")
+set(MODULE_DIR "modules" CACHE PATH "Module path")
+set(DATA_DIR "data" CACHE PATH "Data path")
+set(LOG_DIR "logs" CACHE PATH "Log file path")
set(EXTRA_INCLUDES "" CACHE PATH "Extra include paths")
set(EXTRA_LIBS "" CACHE PATH "Extra library paths")
set(INSPIRCD_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../")
+# Build with multiple processes
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+
# Use our own NSIS template
set(CMAKE_MODULE_PATH "${INSPIRCD_BASE}/win")
# Grab version info from version.sh
file(STRINGS "${INSPIRCD_BASE}/src/version.sh" VERSIONSH)
-string(REGEX REPLACE ".*InspIRCd-([0-9]*).*" "\\1" MAJOR_VERSION "${VERSIONSH}")
-string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.([0-9]*).*" "\\1" MINOR_VERSION "${VERSIONSH}")
-string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.[0-9]*\\.([0-9]*).*" "\\1" PATCH_VERSION "${VERSIONSH}")
-set(FULL_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
+string(REGEX REPLACE ".*InspIRCd-([0-9]*).*" "\\1" VERSION_MAJOR "${VERSIONSH}")
+string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.([0-9]*).*" "\\1" VERSION_MINOR "${VERSIONSH}")
+string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.[0-9]*\\.([0-9]*).*" "\\1" VERSION_PATCH "${VERSIONSH}")
+string(REGEX REPLACE ".*InspIRCd-([^\"]+).*" "\\1" VERSION_FULL "${VERSIONSH}")
if(MSVC)
# Without /SAFESEH:NO old libraries compiled with VS 2010 or older won't link correctly to VS2012 (eg, extra module libs)
@@ -41,7 +44,6 @@ endif(MSVC)
file(GLOB INSPIRCD_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"${INSPIRCD_BASE}/win/inspircd_win32wrapper.cpp"
"${INSPIRCD_BASE}/win/win32service.cpp" "${INSPIRCD_BASE}/src/*.cpp"
-"${INSPIRCD_BASE}/src/modes/*.cpp"
"${INSPIRCD_BASE}/src/socketengines/socketengine_select.cpp"
"${INSPIRCD_BASE}/src/threadengines/threadengine_win32.cpp")
list(SORT INSPIRCD_SOURCES)
@@ -56,8 +58,7 @@ if(MSVC)
endif(MSVC)
configure_file("${INSPIRCD_BASE}/win/inspircd.rc.cmake" "${INSPIRCD_BASE}/win/inspircd.rc")
-configure_file("${INSPIRCD_BASE}/win/inspircd_version.h.cmake" "${INSPIRCD_BASE}/win/inspircd_version.h")
-configure_file("${INSPIRCD_BASE}/win/inspircd_config.h.cmake" "${INSPIRCD_BASE}/win/inspircd_config.h")
+configure_file("${INSPIRCD_BASE}/make/template/config.h" "${INSPIRCD_BASE}/include/config.h")
add_executable(inspircd ${INSPIRCD_SOURCES} "${INSPIRCD_BASE}/win/inspircd.rc")
target_link_libraries(inspircd win32_memory)
@@ -79,10 +80,10 @@ file(GLOB_RECURSE EXAMPLE_LOCALES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIR
install(FILES ${EXAMPLE_LOCALES} DESTINATION locales)
# Create an empty data and logs directory and install them
-file(MAKE_DIRECTORY ${DATA_PATH})
-install(DIRECTORY ${DATA_PATH} DESTINATION .)
-file(MAKE_DIRECTORY ${LOG_PATH})
-install(DIRECTORY ${LOG_PATH} DESTINATION .)
+file(MAKE_DIRECTORY ${DATA_DIR})
+install(DIRECTORY ${DATA_DIR} DESTINATION .)
+file(MAKE_DIRECTORY ${LOG_DIR})
+install(DIRECTORY ${LOG_DIR} DESTINATION .)
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".") # place runtime libraries next to InspIRCd binary
@@ -90,11 +91,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_PACKAGE_NAME "InspIRCd IRC Daemon")
set(CPACK_PACKAGE_VENDOR "InspIRCd Development Team")
- set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
- set(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
- set(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
- set(CPACK_PACKAGE_FILE_NAME "InspIRCd-${FULL_VERSION}")
- set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../docs/COPYING")
+ set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+ set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+ set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
+ set(CPACK_PACKAGE_FILE_NAME "InspIRCd-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../docs/LICENSE.txt")
set(CPACK_GENERATOR "NSIS")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "InspIRCd")
diff --git a/win/README.txt b/win/README.txt
index 908cd3920..f5b2d8c83 100644
--- a/win/README.txt
+++ b/win/README.txt
@@ -1,7 +1,7 @@
Building InspIRCd for Windows:
Prerequisites:
- Visual Studio 2010 or newer (http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products)
+ Visual Studio 2015 or newer (https://www.visualstudio.com/)
CMake 2.8 or newer (http://www.cmake.org/)
If building the installer, NSIS http://nsis.sourceforge.net/
diff --git a/win/inspircd.rc.cmake b/win/inspircd.rc.cmake
index ba52ad5d2..06012b3f5 100644
--- a/win/inspircd.rc.cmake
+++ b/win/inspircd.rc.cmake
@@ -1,8 +1,8 @@
101 ICON "inspircd.ico"
1 VERSIONINFO
- FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@
- PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@
+ FILEVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_PATCH@
+ PRODUCTVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_PATCH@
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -17,14 +17,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "InspIRCd @MAJOR_VERSION@.@MINOR_VERSION@ IRC Daemon"
+ VALUE "Comments", "InspIRCd @VERSION_MAJOR@.@VERSION_MINOR@ IRC Daemon"
VALUE "CompanyName", "InspIRCd Development Team"
VALUE "FileDescription", "InspIRCd"
VALUE "FileVersion", "@FULL_VERSION@"
VALUE "InternalName", "InspIRCd"
VALUE "LegalCopyright", "Copyright (c) 2015 InspIRCd Development Team"
VALUE "OriginalFilename", "inspircd.exe"
- VALUE "ProductName", "InspIRCd - The Inspire IRC Daemon"
+ VALUE "ProductName", "InspIRCd - Internet Relay Chat Daemon"
VALUE "ProductVersion", "@FULL_VERSION@"
END
END
diff --git a/win/inspircd_config.h.cmake b/win/inspircd_config.h.cmake
deleted file mode 100644
index f98cd391e..000000000
--- a/win/inspircd_config.h.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef INSPIRCD_CONFIG_H
-#define INSPIRCD_CONFIG_H
-
-#define CONFIG_PATH "@CONF_PATH@"
-#define MOD_PATH "@MODULE_PATH@"
-#define DATA_PATH "@DATA_PATH@"
-#define LOG_PATH "@LOG_PATH@"
-#define MAXBUF 514
-
-#include "inspircd_win32wrapper.h"
-#include "threadengines/threadengine_win32.h"
-
-#endif \ No newline at end of file
diff --git a/win/inspircd_memory_functions.cpp b/win/inspircd_memory_functions.cpp
index 398708317..2093bf3a8 100644
--- a/win/inspircd_memory_functions.cpp
+++ b/win/inspircd_memory_functions.cpp
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include <windows.h>
#include <exception>
#include <new>
diff --git a/win/inspircd_version.h.cmake b/win/inspircd_version.h.cmake
deleted file mode 100644
index 1aec12b24..000000000
--- a/win/inspircd_version.h.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-#define BRANCH "@MAJOR_VERSION@.@MINOR_VERSION@"
-#define VERSION "@FULL_VERSION@"
-#define REVISION "0"
-#define SYSTEM "@CMAKE_SYSTEM@" \ No newline at end of file
diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp
index d66797f13..fc739f9bd 100644
--- a/win/inspircd_win32wrapper.cpp
+++ b/win/inspircd_win32wrapper.cpp
@@ -22,6 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include "inspircd_win32wrapper.h"
#include "inspircd.h"
#include "configreader.h"
@@ -29,66 +30,6 @@
#include <errno.h>
#include <assert.h>
-CoreExport const char *insp_inet_ntop(int af, const void *src, char *dst, socklen_t cnt)
-{
-
- if (af == AF_INET)
- {
- struct sockaddr_in in;
- memset(&in, 0, sizeof(in));
- in.sin_family = AF_INET;
- memcpy(&in.sin_addr, src, sizeof(struct in_addr));
- if (getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in), dst, cnt, NULL, 0, NI_NUMERICHOST) == 0)
- return dst;
- }
- else if (af == AF_INET6)
- {
- struct sockaddr_in6 in;
- memset(&in, 0, sizeof(in));
- in.sin6_family = AF_INET6;
- memcpy(&in.sin6_addr, src, sizeof(struct in_addr6));
- if (getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6), dst, cnt, NULL, 0, NI_NUMERICHOST) == 0)
- return dst;
- }
- return NULL;
-}
-
-CoreExport int insp_inet_pton(int af, const char *src, void *dst)
-{
- int address_length;
- sockaddr_storage sa;
- sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(&sa);
- sockaddr_in6* sin6 = reinterpret_cast<sockaddr_in6*>(&sa);
-
- switch (af)
- {
- case AF_INET:
- address_length = sizeof(sockaddr_in);
- break;
- case AF_INET6:
- address_length = sizeof(sockaddr_in6);
- break;
- default:
- return -1;
- }
-
- if (!WSAStringToAddress(static_cast<LPSTR>(const_cast<char *>(src)), af, NULL, reinterpret_cast<LPSOCKADDR>(&sa), &address_length))
- {
- switch (af)
- {
- case AF_INET:
- memcpy(dst, &sin->sin_addr, sizeof(in_addr));
- break;
- case AF_INET6:
- memcpy(dst, &sin6->sin6_addr, sizeof(in6_addr));
- break;
- }
- return 1;
- }
-
- return 0;
-}
-
CoreExport DIR * opendir(const char * path)
{
std::string search_path = std::string(path) + "\\*.*";
@@ -163,7 +104,7 @@ int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, cons
// optind++; // Trash this next argument, we won't be needing it.
par = ___argv[optind-1];
}
- }
+ }
// increment the argument for next time
// optind++;
@@ -189,9 +130,9 @@ int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, cons
{
if (__longopts[i].val == -1 || par == 0)
return 1;
-
+
return __longopts[i].val;
- }
+ }
break;
}
}
diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h
index d7ceb73aa..a6ca0da6e 100644
--- a/win/inspircd_win32wrapper.h
+++ b/win/inspircd_win32wrapper.h
@@ -19,18 +19,16 @@
*/
+#pragma once
+
/* Windows Port
Wrapper Functions/Definitions
By Burlex */
-
-#ifndef INSPIRCD_WIN32WRAPPER_H
-#define INSPIRCD_WIN32WRAPPER_H
-
/*
* Starting with PSAPI version 2 for Windows 7 and Windows Server 2008 R2, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported
* in Kernel32.lib and Kernel32.dll. However, you should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols
* for programs that will run on earlier versions of Windows, add Psapi.lib to the TARGETLIBS macro and compile the program with PSAPI_VERSION=1.
- *
+ *
* We do this before anything to make sure it's done.
*/
#define PSAPI_VERSION 1
@@ -45,9 +43,6 @@
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
-/* They just have to be *different*, don't they. */
-#define PATH_MAX MAX_PATH
-
/* Macros for exporting symbols - dependant on what is being compiled */
#ifdef DLL_BUILD
@@ -74,6 +69,17 @@
#include <sys/stat.h>
#include <direct.h>
#include <process.h>
+#include <io.h>
+
+#define F_OK 0 /* test for existence of file */
+#define X_OK (1<<0) /* test for execute or search permission */
+#define W_OK (1<<1) /* test for write permission */
+#define R_OK (1<<2) /* test for read permission */
+
+// Windows defines these already.
+#undef ERROR
+#undef min
+#undef max
/* strcasecmp is not defined on windows by default */
#define strcasecmp _stricmp
@@ -81,36 +87,10 @@
typedef int ssize_t;
-/* Convert formatted (xxx.xxx.xxx.xxx) string to in_addr struct */
-CoreExport int insp_inet_pton(int af, const char * src, void * dst);
-
-/* Convert struct to formatted (xxx.xxx.xxx.xxx) string */
-CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, socklen_t cnt);
-
-/* inet_pton/ntop require at least NT 6.0 */
-#define inet_pton insp_inet_pton
-#define inet_ntop insp_inet_ntop
-
-/* Safe printf functions aren't defined in VC++ releases older than v14 */
-#if _MSC_VER <= 1800
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#endif
-
-/* Unix-style sleep (argument is in seconds) */
-__inline void sleep(int seconds) { Sleep(seconds * 1000); }
-
/* _popen, _pclose */
#define popen _popen
#define pclose _pclose
-/* IPV4 only convert string to address struct */
-__inline int inet_aton(const char *cp, struct in_addr *addr)
-{
- addr->s_addr = inet_addr(cp);
- return (addr->s_addr == INADDR_NONE) ? 0 : 1;
-};
-
/* getopt() wrapper */
#define no_argument 0
#define required_argument 1
@@ -139,14 +119,6 @@ struct DIR
bool first;
};
-#if _MSC_VER <= 1800
-struct timespec
-{
- time_t tv_sec;
- long tv_nsec;
-};
-#endif
-
CoreExport DIR * opendir(const char * path);
CoreExport dirent * readdir(DIR * handle);
CoreExport void closedir(DIR * handle);
@@ -181,18 +153,10 @@ CoreExport void closedir(DIR * handle);
// warning C4706: assignment within conditional expression
#pragma warning(disable:4706)
-// warning C4355: 'this' : used in base member initializer list
-// This warning is disabled by default since VC2012
-#if _MSC_VER < 1700
-#pragma warning(disable:4355)
-#endif
-
/* Shared memory allocation functions */
void * ::operator new(size_t iSize);
void ::operator delete(void * ptr);
-#define DISABLE_WRITEV
-
#include <exception>
class CWin32Exception : public std::exception
@@ -208,5 +172,37 @@ private:
DWORD dwErrorCode;
};
-#endif
+// Same value as EXIT_STATUS_FORK (EXIT_STATUS_FORK is unused on Windows)
+#define EXIT_STATUS_SERVICE 4
+
+// POSIX iovec
+struct iovec
+{
+ void* iov_base; // Starting address
+ size_t iov_len; // Number of bytes to transfer
+};
+
+// Windows WSABUF with POSIX field names
+struct WindowsIOVec
+{
+ // POSIX iovec has iov_base then iov_len, WSABUF in Windows has the fields in reverse order
+ u_long iov_len; // Number of bytes to transfer
+ char FAR* iov_base; // Starting address
+};
+inline ssize_t writev(int fd, const WindowsIOVec* iov, int count)
+{
+ DWORD sent;
+ int ret = WSASend(fd, reinterpret_cast<LPWSABUF>(const_cast<WindowsIOVec*>(iov)), count, &sent, 0, NULL, NULL);
+ if (ret == 0)
+ return sent;
+ return -1;
+}
+
+// This wrapper is just so we don't need to do #ifdef _WIN32 everywhere in the socket code. It is
+// not actually used and does not need to be the same size as sockaddr_un on UNIX systems.
+struct sockaddr_un
+{
+ ADDRESS_FAMILY sun_family;
+ char sun_path[6];
+};
diff --git a/win/make_gnutls_cert.bat b/win/make_gnutls_cert.bat
index 97792cc29..159cd1012 100644
--- a/win/make_gnutls_cert.bat
+++ b/win/make_gnutls_cert.bat
@@ -1,14 +1,14 @@
-@echo off
-
-echo This program will generate SSL certificates for m_ssl_gnutls.so
-echo Ensure certtool.exe is in your system path. It can be downloaded
-echo at ftp://ftp.gnu.org/gnu/gnutls/w32/. If you do not know the answer
-echo to one of the questions just press enter.
-echo.
-
-pause
-
-certtool --generate-privkey --outfile conf/key.pem
-certtool --generate-self-signed --load-privkey conf/key.pem --outfile conf/cert.pem
-
+@echo off
+
+echo This program will generate SSL certificates for m_ssl_gnutls.so
+echo Ensure certtool.exe is in your system path. It can be downloaded
+echo at ftp://ftp.gnu.org/gnu/gnutls/w32/. If you do not know the answer
+echo to one of the questions just press enter.
+echo.
+
+pause
+
+certtool --generate-privkey --outfile conf/key.pem
+certtool --generate-self-signed --load-privkey conf/key.pem --outfile conf/cert.pem
+
pause \ No newline at end of file
diff --git a/win/modules/CMakeLists.txt b/win/modules/CMakeLists.txt
index 5778d944a..2c2617e2b 100644
--- a/win/modules/CMakeLists.txt
+++ b/win/modules/CMakeLists.txt
@@ -2,33 +2,41 @@
# so copy the file out of extra/
file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_stdlib.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")
-file(GLOB INSPIRCD_MODULES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIRCD_BASE}/src/commands/*.cpp" "${INSPIRCD_BASE}/src/modules/*.cpp")
+file(GLOB INSPIRCD_MODULES "${INSPIRCD_BASE}/src/coremods/core_*" "${INSPIRCD_BASE}/src/modules/m_*")
list(SORT INSPIRCD_MODULES)
add_definitions("-DDLL_BUILD")
foreach(MODULE_NAME ${INSPIRCD_MODULES})
- string(REGEX REPLACE "^.*[/\\](.*).cpp$" "\\1.so" SO_NAME ${MODULE_NAME})
- add_library(${SO_NAME} MODULE ${MODULE_NAME})
- set_target_properties(${SO_NAME} PROPERTIES PREFIX "" SUFFIX "")
+ if(IS_DIRECTORY "${MODULE_NAME}")
+ string(REGEX REPLACE "^.*[/\\](.*)$" "\\1" BASE_NAME ${MODULE_NAME})
+ else(IS_DIRECTORY "${MODULE_NAME}")
+ string(REGEX REPLACE "^.*[/\\](.*).cpp$" "\\1" BASE_NAME ${MODULE_NAME})
+ endif(IS_DIRECTORY "${MODULE_NAME}")
+ set(SO_NAME "${BASE_NAME}.so")
+
+ if(IS_DIRECTORY "${MODULE_NAME}")
+ file(GLOB MODULES_SUBDIR_SRCS "${MODULE_NAME}/*.cpp")
+ list(SORT MODULES_SUBDIR_SRCS)
+ add_library(${SO_NAME} MODULE ${MODULES_SUBDIR_SRCS})
+ else(IS_DIRECTORY "${MODULE_NAME}")
+ add_library(${SO_NAME} MODULE ${MODULE_NAME})
+ endif(IS_DIRECTORY "${MODULE_NAME}")
+
+ # Generate the module and set its linker flags, also set it to depend on the main executable to be built beforehand
target_link_libraries(${SO_NAME} inspircd)
add_dependencies(${SO_NAME} inspircd)
if(MSVC)
target_link_libraries(${SO_NAME} win32_memory)
add_dependencies(${SO_NAME} win32_memory)
endif(MSVC)
- install(TARGETS ${SO_NAME} DESTINATION modules)
-endforeach(MODULE_NAME ${INSPIRCD_MODULES})
-file(GLOB INSPIRCD_MODULES_SPANNINGTREE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIRCD_BASE}/src/modules/m_spanningtree/*.cpp")
-list(SORT INSPIRCD_MODULES_SPANNINGTREE)
+ set_target_properties(${SO_NAME} PROPERTIES
+ PREFIX ""
+ SUFFIX ""
+ COMPILE_DEFINITIONS "MODNAME=\"${BASE_NAME}\""
+ )
-add_library(m_spanningtree.so MODULE ${INSPIRCD_MODULES_SPANNINGTREE})
-set_target_properties(m_spanningtree.so PROPERTIES PREFIX "" SUFFIX "")
-target_link_libraries(m_spanningtree.so inspircd)
-add_dependencies(m_spanningtree.so inspircd)
-if(MSVC)
- target_link_libraries(m_spanningtree.so win32_memory)
- add_dependencies(m_spanningtree.so win32_memory)
-endif(MSVC)
-install(TARGETS m_spanningtree.so DESTINATION modules) \ No newline at end of file
+ # Set the module to be installed to the module directory
+ install(TARGETS ${SO_NAME} DESTINATION ${MODULE_DIR})
+endforeach(MODULE_NAME ${INSPIRCD_MODULES})
diff --git a/win/win32service.cpp b/win/win32service.cpp
index c34e9957d..448829a1d 100644
--- a/win/win32service.cpp
+++ b/win/win32service.cpp
@@ -17,7 +17,7 @@
*/
-#include "inspircd_config.h"
+#include "config.h"
#include "inspircd.h"
#include "exitcodes.h"
#include <windows.h>
@@ -280,7 +280,7 @@ int main(int argc, char* argv[])
}
else
{
- return EXIT_STATUS_INTERNAL;
+ return EXIT_STATUS_SERVICE;
}
}
return 0;
diff --git a/win/win32service.h b/win/win32service.h
index e4500be13..d8177eabc 100644
--- a/win/win32service.h
+++ b/win/win32service.h
@@ -15,7 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#pragma once
+
#ifdef _WIN32
/* Hook for win32service.cpp to exit properly with the service specific error code */