mirror of
https://github.com/anope/anope.git
synced 2026-07-08 15:23:12 +02:00
Some more Windows fixes, both in CMake and in the code itself. (I don't like the const casting for the latter, but it's only until we get rid of use of strchr)
Added CPack setup to automate generation of source package for *nix and NSIS installer for Windows. Some other minor CMake fixes. Converted docs/README and docs/WIN32.txt from Unix linefeeds to DOS linefeeds so they show up right in Notepad under Windows. Added small fix for Visual Studio 2008, CMake doesn't detect the Express version correctly and it must be explicitly defined. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1861 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+9
-1
@@ -37,6 +37,10 @@ if(WIN32)
|
||||
else(MINGW)
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
|
||||
endif(MINGW)
|
||||
if(IN_SOURCE)
|
||||
# Add the resource file to the list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("win32.rc$" TRUE)
|
||||
endif(IN_SOURCE)
|
||||
endif(WIN32)
|
||||
|
||||
# Generate the Anope executable and set it's linker flags, also set it to export it's symbols even though it's not a module
|
||||
@@ -54,6 +58,10 @@ add_dependencies(${PROGRAM_NAME} language headers)
|
||||
get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
|
||||
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
|
||||
set(SERVICES_BIN "${SERVICES_BINARY}")
|
||||
if(IN_SOURCE)
|
||||
# Add the Anope executable to the list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("${SERVICES_BINARY}$" TRUE)
|
||||
endif(IN_SOURCE)
|
||||
|
||||
# Generate sysconf.h from the earlier configuration
|
||||
configure_file(${Anope_SOURCE_DIR}/include/sysconf.h.cmake ${Anope_BINARY_DIR}/include/sysconf.h)
|
||||
@@ -67,5 +75,5 @@ add_subdirectory(tools)
|
||||
|
||||
# Set Anope to be installed to the bin directory
|
||||
install(TARGETS ${PROGRAM_NAME}
|
||||
DESTINATION "${INSTDIR}"
|
||||
DESTINATION .
|
||||
)
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ int b64_decode(const char *src, char *target, size_t targsize)
|
||||
if (ch == Pad64)
|
||||
break;
|
||||
|
||||
pos = strchr(Base64, ch);
|
||||
pos = const_cast<char *>(strchr(Base64, ch));
|
||||
if (pos == 0) /* A non-base64 character. */
|
||||
return (-1);
|
||||
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
if(NOT WIN32)
|
||||
configure_file(${Anope_SOURCE_DIR}/src/bin/anoperc.cmake ${Anope_BINARY_DIR}/src/bin/anoperc)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anoperc
|
||||
DESTINATION "${INSTDIR}"
|
||||
DESTINATION .
|
||||
)
|
||||
if(IN_SOURCE)
|
||||
# Add anoperc to list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("anoperc$")
|
||||
endif(IN_SOURCE)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mydbgen
|
||||
DESTINATION "${DATADIR}"
|
||||
DESTINATION data
|
||||
)
|
||||
endif(NOT WIN32)
|
||||
|
||||
+3
-3
@@ -813,7 +813,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
s = av[ac - 1]; /* Users are always the last element */
|
||||
|
||||
while (*s) {
|
||||
end = strchr(s, ' ');
|
||||
end = const_cast<char *>(strchr(s, ' '));
|
||||
if (end)
|
||||
*end = 0;
|
||||
|
||||
@@ -930,7 +930,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
s = av[2]; /* Users are always the last element */
|
||||
|
||||
while (*s) {
|
||||
end = strchr(s, ' ');
|
||||
end = const_cast<char *>(strchr(s, ' '));
|
||||
if (end)
|
||||
*end = 0;
|
||||
|
||||
@@ -1005,7 +1005,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
s = sstrdup(source); /* Users are always the last element */
|
||||
|
||||
while (*s) {
|
||||
end = strchr(s, ' ');
|
||||
end = const_cast<char *>(strchr(s, ' '));
|
||||
if (end)
|
||||
*end = 0;
|
||||
|
||||
|
||||
@@ -31,6 +31,6 @@ foreach(SRC ${CORE_SRCS})
|
||||
endif(WIN32)
|
||||
# Set the module to be installed to the module directory under the data directory
|
||||
install(TARGETS ${SO}
|
||||
DESTINATION "${DATADIR}/modules"
|
||||
DESTINATION data/modules
|
||||
)
|
||||
endforeach(SRC)
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ int m_privmsg(const char *source, const char *receiver, const char *msg)
|
||||
|
||||
/* If a server is specified (nick@server format), make sure it matches
|
||||
* us, and strip it off. */
|
||||
s = strchr(receiver, '@');
|
||||
s = const_cast<char *>(strchr(receiver, '@'));
|
||||
if (s) {
|
||||
*s++ = 0;
|
||||
if (stricmp(s, ServerName) != 0)
|
||||
|
||||
@@ -31,6 +31,6 @@ foreach(SRC ${MODULES_SRCS})
|
||||
endif(WIN32)
|
||||
# Set the module to be installed to the module directory under the data directory
|
||||
install(TARGETS ${SO}
|
||||
DESTINATION "${DATADIR}/modules"
|
||||
DESTINATION data/modules
|
||||
)
|
||||
endforeach(SRC)
|
||||
|
||||
+6
-6
@@ -46,9 +46,9 @@ void add_ignore(const char *nick, time_t delta)
|
||||
snprintf(tmp, sizeof(tmp), "*!*@%s", u->host);
|
||||
mask = sstrdup(tmp);
|
||||
/* Determine whether we get a nick or a mask. */
|
||||
} else if ((host = strchr(nick, '@'))) {
|
||||
} else if ((host = const_cast<char *>(strchr(nick, '@')))) {
|
||||
/* Check whether we have a nick too.. */
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
if ((user = const_cast<char *>(strchr(nick, '!')))) {
|
||||
/* this should never happen */
|
||||
if (user > host)
|
||||
return;
|
||||
@@ -121,8 +121,8 @@ IgnoreData *get_ignore(const char *nick)
|
||||
break;
|
||||
} else {
|
||||
/* We didn't get a user.. generate a valid mask. */
|
||||
if ((host = strchr(nick, '@'))) {
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
if ((host = const_cast<char *>(strchr(nick, '@')))) {
|
||||
if ((user = const_cast<char *>(strchr(nick, '!')))) {
|
||||
/* this should never happen */
|
||||
if (user > host)
|
||||
return NULL;
|
||||
@@ -177,9 +177,9 @@ int delete_ignore(const char *nick)
|
||||
if ((u = finduser(nick))) {
|
||||
snprintf(tmp, sizeof(tmp), "*!*@%s", u->host);
|
||||
/* Determine whether we get a nick or a mask. */
|
||||
} else if ((host = strchr(nick, '@'))) {
|
||||
} else if ((host = const_cast<char *>(strchr(nick, '@')))) {
|
||||
/* Check whether we have a nick too.. */
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
if ((user = const_cast<char *>(strchr(nick, '!')))) {
|
||||
/* this should never happen */
|
||||
if (user > host)
|
||||
return 0;
|
||||
|
||||
@@ -31,6 +31,6 @@ foreach(SRC ${PROTOCOL_SRCS})
|
||||
endif(WIN32)
|
||||
# Set the module to be installed to the module directory under the data directory
|
||||
install(TARGETS ${SO}
|
||||
DESTINATION "${DATADIR}/modules"
|
||||
DESTINATION data/modules
|
||||
)
|
||||
endforeach(SRC)
|
||||
|
||||
@@ -21,8 +21,14 @@ foreach(SRC ${TOOLS_SRCS})
|
||||
add_dependencies(${EXE} ${PROGRAM_NAME})
|
||||
# Set the executable to be installed to the tools directory under the bin directory
|
||||
install(TARGETS ${EXE}
|
||||
DESTINATION "${INSTDIR}/tools"
|
||||
DESTINATION tools
|
||||
)
|
||||
if(IN_SOURCE)
|
||||
# Add the executable to the list of files for CPack to ignore
|
||||
get_target_property(EXE_BINARY ${EXE} LOCATION)
|
||||
get_filename_component(EXE_BINARY ${EXE_BINARY} NAME)
|
||||
add_to_cpack_ignored_files("${EXE_BINARY}$" TRUE)
|
||||
endif(IN_SOURCE)
|
||||
endforeach(SRC)
|
||||
|
||||
# Only for Windows, set anopesmtp to require the wsock32 library
|
||||
@@ -32,5 +38,5 @@ endif(WIN32)
|
||||
|
||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the tools directory
|
||||
if(NOT WIN32 AND RUNGROUP)
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"${INSTDIR}/tools\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\${CMAKE_INSTALL_PREFIX}/tools\")")
|
||||
endif(NOT WIN32 AND RUNGROUP)
|
||||
|
||||
@@ -1582,7 +1582,7 @@ int b64_decode(const char *src, char *target, size_t targsize)
|
||||
if (ch == Pad64)
|
||||
break;
|
||||
|
||||
pos = strchr(Base64, ch);
|
||||
pos = const_cast<char *>(strchr(Base64, ch));
|
||||
if (pos == 0) /* A non-base64 character. */
|
||||
return (-1);
|
||||
|
||||
|
||||
+2
-2
@@ -521,10 +521,10 @@ User *do_nick(const char *source, const char *nick, const char *username, const
|
||||
* Ugly swap routine for Flop's bug :)
|
||||
**/
|
||||
if (realname) {
|
||||
tmp = strchr(realname, '%');
|
||||
tmp = const_cast<char *>(strchr(realname, '%'));
|
||||
while (tmp) {
|
||||
*tmp = '-';
|
||||
tmp = strchr(realname, '%');
|
||||
tmp = const_cast<char *>(strchr(realname, '%'));
|
||||
}
|
||||
}
|
||||
logrealname = normalizeBuffer(realname);
|
||||
|
||||
Reference in New Issue
Block a user