From a22f8d3b2de88b9bb6f80f0c2780846ae23ab389 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 15 Jul 2010 22:55:02 -0400 Subject: [PATCH] Moved some files and diretories around, made cmake skip files it knows it can't compile because of missing dependices. --- CMakeLists.txt | 11 +- Anope.cmake => cmake/Anope.cmake | 95 ++++++--- NSIS.template.in => cmake/NSIS.template.in | 0 ReadFile.cmake => cmake/ReadFile.cmake | 0 docs/CMakeLists.txt | 2 +- docs/PROXY | 41 ---- include/hashcomp.h | 13 ++ modules/CMakeLists.txt | 187 ++++++++++++++++++ {src => modules}/core/bs_act.cpp | 0 {src => modules}/core/bs_assign.cpp | 0 {src => modules}/core/bs_badwords.cpp | 0 {src => modules}/core/bs_bot.cpp | 0 {src => modules}/core/bs_botlist.cpp | 0 {src => modules}/core/bs_help.cpp | 0 {src => modules}/core/bs_info.cpp | 0 {src => modules}/core/bs_kick.cpp | 0 {src => modules}/core/bs_say.cpp | 0 {src => modules}/core/bs_set.cpp | 0 {src => modules}/core/bs_unassign.cpp | 0 {src => modules}/core/cs_access.cpp | 0 {src => modules}/core/cs_akick.cpp | 0 {src => modules}/core/cs_ban.cpp | 0 {src => modules}/core/cs_clear.cpp | 0 {src => modules}/core/cs_drop.cpp | 0 {src => modules}/core/cs_forbid.cpp | 0 {src => modules}/core/cs_getkey.cpp | 0 {src => modules}/core/cs_help.cpp | 0 {src => modules}/core/cs_info.cpp | 0 {src => modules}/core/cs_invite.cpp | 0 {src => modules}/core/cs_kick.cpp | 0 {src => modules}/core/cs_list.cpp | 0 {src => modules}/core/cs_modes.cpp | 0 {src => modules}/core/cs_register.cpp | 0 {src => modules}/core/cs_saset.cpp | 0 {src => modules}/core/cs_saset_noexpire.cpp | 0 {src => modules}/core/cs_set.cpp | 0 {src => modules}/core/cs_set_bantype.cpp | 0 {src => modules}/core/cs_set_description.cpp | 0 {src => modules}/core/cs_set_entrymsg.cpp | 0 {src => modules}/core/cs_set_founder.cpp | 0 {src => modules}/core/cs_set_keeptopic.cpp | 0 {src => modules}/core/cs_set_mlock.cpp | 0 {src => modules}/core/cs_set_opnotice.cpp | 0 {src => modules}/core/cs_set_peace.cpp | 0 {src => modules}/core/cs_set_persist.cpp | 0 {src => modules}/core/cs_set_private.cpp | 0 {src => modules}/core/cs_set_restricted.cpp | 0 {src => modules}/core/cs_set_secure.cpp | 0 .../core/cs_set_securefounder.cpp | 0 {src => modules}/core/cs_set_secureops.cpp | 0 {src => modules}/core/cs_set_signkick.cpp | 0 {src => modules}/core/cs_set_successor.cpp | 0 {src => modules}/core/cs_set_topiclock.cpp | 0 {src => modules}/core/cs_set_xop.cpp | 0 {src => modules}/core/cs_status.cpp | 0 {src => modules}/core/cs_suspend.cpp | 0 {src => modules}/core/cs_topic.cpp | 0 {src => modules}/core/cs_unban.cpp | 0 {src => modules}/core/cs_xop.cpp | 0 {src => modules}/core/db_plain.cpp | 0 {src => modules}/core/enc_md5.cpp | 0 {src => modules}/core/enc_none.cpp | 0 {src => modules}/core/enc_old.cpp | 0 {src => modules}/core/enc_sha1.cpp | 0 {src => modules}/core/enc_sha256.cpp | 0 {src => modules}/core/hs_del.cpp | 0 {src => modules}/core/hs_delall.cpp | 0 {src => modules}/core/hs_group.cpp | 0 {src => modules}/core/hs_help.cpp | 0 {src => modules}/core/hs_list.cpp | 0 {src => modules}/core/hs_off.cpp | 0 {src => modules}/core/hs_on.cpp | 0 {src => modules}/core/hs_set.cpp | 0 {src => modules}/core/hs_setall.cpp | 0 {src => modules}/core/ms_cancel.cpp | 0 {src => modules}/core/ms_check.cpp | 0 {src => modules}/core/ms_del.cpp | 0 {src => modules}/core/ms_help.cpp | 0 {src => modules}/core/ms_info.cpp | 0 {src => modules}/core/ms_list.cpp | 0 {src => modules}/core/ms_read.cpp | 0 {src => modules}/core/ms_rsend.cpp | 0 {src => modules}/core/ms_send.cpp | 0 {src => modules}/core/ms_sendall.cpp | 0 {src => modules}/core/ms_set.cpp | 0 {src => modules}/core/ms_staff.cpp | 0 {src => modules}/core/ns_access.cpp | 0 {src => modules}/core/ns_alist.cpp | 0 {src => modules}/core/ns_drop.cpp | 0 {src => modules}/core/ns_forbid.cpp | 0 {src => modules}/core/ns_getemail.cpp | 0 {src => modules}/core/ns_getpass.cpp | 0 {src => modules}/core/ns_ghost.cpp | 0 {src => modules}/core/ns_group.cpp | 0 {src => modules}/core/ns_help.cpp | 0 {src => modules}/core/ns_identify.cpp | 0 {src => modules}/core/ns_info.cpp | 0 {src => modules}/core/ns_list.cpp | 0 {src => modules}/core/ns_logout.cpp | 0 {src => modules}/core/ns_recover.cpp | 0 {src => modules}/core/ns_register.cpp | 0 {src => modules}/core/ns_release.cpp | 0 {src => modules}/core/ns_resetpass.cpp | 0 {src => modules}/core/ns_saset.cpp | 0 {src => modules}/core/ns_saset_noexpire.cpp | 0 {src => modules}/core/ns_sendpass.cpp | 0 {src => modules}/core/ns_set.cpp | 0 {src => modules}/core/ns_set_autoop.cpp | 0 {src => modules}/core/ns_set_email.cpp | 0 {src => modules}/core/ns_set_greet.cpp | 0 {src => modules}/core/ns_set_hide.cpp | 0 {src => modules}/core/ns_set_kill.cpp | 0 {src => modules}/core/ns_set_language.cpp | 0 {src => modules}/core/ns_set_message.cpp | 0 {src => modules}/core/ns_set_private.cpp | 0 {src => modules}/core/ns_set_secure.cpp | 0 {src => modules}/core/ns_status.cpp | 0 {src => modules}/core/ns_suspend.cpp | 0 {src => modules}/core/ns_update.cpp | 0 {src => modules}/core/os_akill.cpp | 0 {src => modules}/core/os_chankill.cpp | 0 {src => modules}/core/os_chanlist.cpp | 0 {src => modules}/core/os_clearmodes.cpp | 0 {src => modules}/core/os_defcon.cpp | 0 {src => modules}/core/os_global.cpp | 0 {src => modules}/core/os_help.cpp | 0 {src => modules}/core/os_ignore.cpp | 0 {src => modules}/core/os_jupe.cpp | 0 {src => modules}/core/os_kick.cpp | 0 {src => modules}/core/os_mode.cpp | 0 {src => modules}/core/os_modinfo.cpp | 0 {src => modules}/core/os_modlist.cpp | 0 {src => modules}/core/os_modload.cpp | 0 {src => modules}/core/os_modunload.cpp | 0 {src => modules}/core/os_news.cpp | 0 {src => modules}/core/os_noop.cpp | 0 {src => modules}/core/os_oline.cpp | 0 {src => modules}/core/os_quit.cpp | 0 {src => modules}/core/os_reload.cpp | 0 {src => modules}/core/os_restart.cpp | 0 {src => modules}/core/os_session.cpp | 0 {src => modules}/core/os_set.cpp | 0 {src => modules}/core/os_shutdown.cpp | 0 {src => modules}/core/os_snline.cpp | 0 {src => modules}/core/os_sqline.cpp | 0 {src => modules}/core/os_staff.cpp | 0 {src => modules}/core/os_stats.cpp | 0 {src => modules}/core/os_svsnick.cpp | 0 {src => modules}/core/os_szline.cpp | 0 {src => modules}/core/os_umode.cpp | 0 {src => modules}/core/os_update.cpp | 0 {src => modules}/core/os_userlist.cpp | 0 {src => modules}/core/ss_main.cpp | 0 .../extra}/cs_appendtopic.cpp | 0 {src/modules => modules/extra}/cs_enforce.cpp | 0 .../modules => modules/extra}/cs_set_misc.cpp | 0 {src/modules => modules/extra}/cs_tban.cpp | 0 {src/modules => modules/extra}/hs_request.cpp | 0 {src/modules => modules/extra}/m_helpchan.cpp | 0 {src/modules/ssl => modules/extra}/m_ssl.cpp | 0 .../extra}/mysql/db_mysql.h | 1 - .../extra}/mysql/db_mysql_execute.cpp | 0 .../extra}/mysql/db_mysql_read.cpp | 0 .../extra}/mysql/db_mysql_write.cpp | 0 .../modules => modules/extra}/ns_maxemail.cpp | 0 .../modules => modules/extra}/ns_set_misc.cpp | 0 {src => modules}/protocol/bahamut.cpp | 0 {src => modules}/protocol/inspircd11.cpp | 0 {src => modules}/protocol/inspircd12.cpp | 0 {src => modules}/protocol/inspircd20.cpp | 0 {src => modules}/protocol/ratbox.cpp | 0 {src => modules}/protocol/unreal32.cpp | 0 .../socketengines}/m_socketengine_epoll.cpp | 2 + .../socketengines}/m_socketengine_select.cpp | 0 src/CMakeLists.txt | 47 +++-- src/bin/register | 101 ---------- src/core/CMakeLists.txt | 54 ----- src/hashcomp.cpp | 1 - src/modules/CMakeLists.txt | 144 -------------- src/protocol/CMakeLists.txt | 54 ----- .../threadengine_pthread.cpp | 0 .../threadengine_win32.cpp | 0 src/tools/CMakeLists.txt | 47 ++--- src/tools/smtp.h | 1 - src/{ => win32}/anope-icon.ico | Bin anope.bat => src/win32/anope.bat | 0 vsvars32.bat => src/win32/vsvars32.bat | 0 src/{ => win32}/win32.rc.cmake | 2 +- src/{ => win32}/win32_memory.cpp | 0 src/{ => win32}/windows.cpp | 0 190 files changed, 324 insertions(+), 479 deletions(-) rename Anope.cmake => cmake/Anope.cmake (86%) rename NSIS.template.in => cmake/NSIS.template.in (100%) rename ReadFile.cmake => cmake/ReadFile.cmake (100%) delete mode 100644 docs/PROXY create mode 100644 modules/CMakeLists.txt rename {src => modules}/core/bs_act.cpp (100%) rename {src => modules}/core/bs_assign.cpp (100%) rename {src => modules}/core/bs_badwords.cpp (100%) rename {src => modules}/core/bs_bot.cpp (100%) rename {src => modules}/core/bs_botlist.cpp (100%) rename {src => modules}/core/bs_help.cpp (100%) rename {src => modules}/core/bs_info.cpp (100%) rename {src => modules}/core/bs_kick.cpp (100%) rename {src => modules}/core/bs_say.cpp (100%) rename {src => modules}/core/bs_set.cpp (100%) rename {src => modules}/core/bs_unassign.cpp (100%) rename {src => modules}/core/cs_access.cpp (100%) rename {src => modules}/core/cs_akick.cpp (100%) rename {src => modules}/core/cs_ban.cpp (100%) rename {src => modules}/core/cs_clear.cpp (100%) rename {src => modules}/core/cs_drop.cpp (100%) rename {src => modules}/core/cs_forbid.cpp (100%) rename {src => modules}/core/cs_getkey.cpp (100%) rename {src => modules}/core/cs_help.cpp (100%) rename {src => modules}/core/cs_info.cpp (100%) rename {src => modules}/core/cs_invite.cpp (100%) rename {src => modules}/core/cs_kick.cpp (100%) rename {src => modules}/core/cs_list.cpp (100%) rename {src => modules}/core/cs_modes.cpp (100%) rename {src => modules}/core/cs_register.cpp (100%) rename {src => modules}/core/cs_saset.cpp (100%) rename {src => modules}/core/cs_saset_noexpire.cpp (100%) rename {src => modules}/core/cs_set.cpp (100%) rename {src => modules}/core/cs_set_bantype.cpp (100%) rename {src => modules}/core/cs_set_description.cpp (100%) rename {src => modules}/core/cs_set_entrymsg.cpp (100%) rename {src => modules}/core/cs_set_founder.cpp (100%) rename {src => modules}/core/cs_set_keeptopic.cpp (100%) rename {src => modules}/core/cs_set_mlock.cpp (100%) rename {src => modules}/core/cs_set_opnotice.cpp (100%) rename {src => modules}/core/cs_set_peace.cpp (100%) rename {src => modules}/core/cs_set_persist.cpp (100%) rename {src => modules}/core/cs_set_private.cpp (100%) rename {src => modules}/core/cs_set_restricted.cpp (100%) rename {src => modules}/core/cs_set_secure.cpp (100%) rename {src => modules}/core/cs_set_securefounder.cpp (100%) rename {src => modules}/core/cs_set_secureops.cpp (100%) rename {src => modules}/core/cs_set_signkick.cpp (100%) rename {src => modules}/core/cs_set_successor.cpp (100%) rename {src => modules}/core/cs_set_topiclock.cpp (100%) rename {src => modules}/core/cs_set_xop.cpp (100%) rename {src => modules}/core/cs_status.cpp (100%) rename {src => modules}/core/cs_suspend.cpp (100%) rename {src => modules}/core/cs_topic.cpp (100%) rename {src => modules}/core/cs_unban.cpp (100%) rename {src => modules}/core/cs_xop.cpp (100%) rename {src => modules}/core/db_plain.cpp (100%) rename {src => modules}/core/enc_md5.cpp (100%) rename {src => modules}/core/enc_none.cpp (100%) rename {src => modules}/core/enc_old.cpp (100%) rename {src => modules}/core/enc_sha1.cpp (100%) rename {src => modules}/core/enc_sha256.cpp (100%) rename {src => modules}/core/hs_del.cpp (100%) rename {src => modules}/core/hs_delall.cpp (100%) rename {src => modules}/core/hs_group.cpp (100%) rename {src => modules}/core/hs_help.cpp (100%) rename {src => modules}/core/hs_list.cpp (100%) rename {src => modules}/core/hs_off.cpp (100%) rename {src => modules}/core/hs_on.cpp (100%) rename {src => modules}/core/hs_set.cpp (100%) rename {src => modules}/core/hs_setall.cpp (100%) rename {src => modules}/core/ms_cancel.cpp (100%) rename {src => modules}/core/ms_check.cpp (100%) rename {src => modules}/core/ms_del.cpp (100%) rename {src => modules}/core/ms_help.cpp (100%) rename {src => modules}/core/ms_info.cpp (100%) rename {src => modules}/core/ms_list.cpp (100%) rename {src => modules}/core/ms_read.cpp (100%) rename {src => modules}/core/ms_rsend.cpp (100%) rename {src => modules}/core/ms_send.cpp (100%) rename {src => modules}/core/ms_sendall.cpp (100%) rename {src => modules}/core/ms_set.cpp (100%) rename {src => modules}/core/ms_staff.cpp (100%) rename {src => modules}/core/ns_access.cpp (100%) rename {src => modules}/core/ns_alist.cpp (100%) rename {src => modules}/core/ns_drop.cpp (100%) rename {src => modules}/core/ns_forbid.cpp (100%) rename {src => modules}/core/ns_getemail.cpp (100%) rename {src => modules}/core/ns_getpass.cpp (100%) rename {src => modules}/core/ns_ghost.cpp (100%) rename {src => modules}/core/ns_group.cpp (100%) rename {src => modules}/core/ns_help.cpp (100%) rename {src => modules}/core/ns_identify.cpp (100%) rename {src => modules}/core/ns_info.cpp (100%) rename {src => modules}/core/ns_list.cpp (100%) rename {src => modules}/core/ns_logout.cpp (100%) rename {src => modules}/core/ns_recover.cpp (100%) rename {src => modules}/core/ns_register.cpp (100%) rename {src => modules}/core/ns_release.cpp (100%) rename {src => modules}/core/ns_resetpass.cpp (100%) rename {src => modules}/core/ns_saset.cpp (100%) rename {src => modules}/core/ns_saset_noexpire.cpp (100%) rename {src => modules}/core/ns_sendpass.cpp (100%) rename {src => modules}/core/ns_set.cpp (100%) rename {src => modules}/core/ns_set_autoop.cpp (100%) rename {src => modules}/core/ns_set_email.cpp (100%) rename {src => modules}/core/ns_set_greet.cpp (100%) rename {src => modules}/core/ns_set_hide.cpp (100%) rename {src => modules}/core/ns_set_kill.cpp (100%) rename {src => modules}/core/ns_set_language.cpp (100%) rename {src => modules}/core/ns_set_message.cpp (100%) rename {src => modules}/core/ns_set_private.cpp (100%) rename {src => modules}/core/ns_set_secure.cpp (100%) rename {src => modules}/core/ns_status.cpp (100%) rename {src => modules}/core/ns_suspend.cpp (100%) rename {src => modules}/core/ns_update.cpp (100%) rename {src => modules}/core/os_akill.cpp (100%) rename {src => modules}/core/os_chankill.cpp (100%) rename {src => modules}/core/os_chanlist.cpp (100%) rename {src => modules}/core/os_clearmodes.cpp (100%) rename {src => modules}/core/os_defcon.cpp (100%) rename {src => modules}/core/os_global.cpp (100%) rename {src => modules}/core/os_help.cpp (100%) rename {src => modules}/core/os_ignore.cpp (100%) rename {src => modules}/core/os_jupe.cpp (100%) rename {src => modules}/core/os_kick.cpp (100%) rename {src => modules}/core/os_mode.cpp (100%) rename {src => modules}/core/os_modinfo.cpp (100%) rename {src => modules}/core/os_modlist.cpp (100%) rename {src => modules}/core/os_modload.cpp (100%) rename {src => modules}/core/os_modunload.cpp (100%) rename {src => modules}/core/os_news.cpp (100%) rename {src => modules}/core/os_noop.cpp (100%) rename {src => modules}/core/os_oline.cpp (100%) rename {src => modules}/core/os_quit.cpp (100%) rename {src => modules}/core/os_reload.cpp (100%) rename {src => modules}/core/os_restart.cpp (100%) rename {src => modules}/core/os_session.cpp (100%) rename {src => modules}/core/os_set.cpp (100%) rename {src => modules}/core/os_shutdown.cpp (100%) rename {src => modules}/core/os_snline.cpp (100%) rename {src => modules}/core/os_sqline.cpp (100%) rename {src => modules}/core/os_staff.cpp (100%) rename {src => modules}/core/os_stats.cpp (100%) rename {src => modules}/core/os_svsnick.cpp (100%) rename {src => modules}/core/os_szline.cpp (100%) rename {src => modules}/core/os_umode.cpp (100%) rename {src => modules}/core/os_update.cpp (100%) rename {src => modules}/core/os_userlist.cpp (100%) rename {src => modules}/core/ss_main.cpp (100%) rename {src/modules => modules/extra}/cs_appendtopic.cpp (100%) rename {src/modules => modules/extra}/cs_enforce.cpp (100%) rename {src/modules => modules/extra}/cs_set_misc.cpp (100%) rename {src/modules => modules/extra}/cs_tban.cpp (100%) rename {src/modules => modules/extra}/hs_request.cpp (100%) rename {src/modules => modules/extra}/m_helpchan.cpp (100%) rename {src/modules/ssl => modules/extra}/m_ssl.cpp (100%) rename {src/modules => modules/extra}/mysql/db_mysql.h (99%) rename {src/modules => modules/extra}/mysql/db_mysql_execute.cpp (100%) rename {src/modules => modules/extra}/mysql/db_mysql_read.cpp (100%) rename {src/modules => modules/extra}/mysql/db_mysql_write.cpp (100%) rename {src/modules => modules/extra}/ns_maxemail.cpp (100%) rename {src/modules => modules/extra}/ns_set_misc.cpp (100%) rename {src => modules}/protocol/bahamut.cpp (100%) rename {src => modules}/protocol/inspircd11.cpp (100%) rename {src => modules}/protocol/inspircd12.cpp (100%) rename {src => modules}/protocol/inspircd20.cpp (100%) rename {src => modules}/protocol/ratbox.cpp (100%) rename {src => modules}/protocol/unreal32.cpp (100%) rename {src/core => modules/socketengines}/m_socketengine_epoll.cpp (98%) rename {src/core => modules/socketengines}/m_socketengine_select.cpp (100%) delete mode 100755 src/bin/register delete mode 100644 src/core/CMakeLists.txt delete mode 100644 src/modules/CMakeLists.txt delete mode 100644 src/protocol/CMakeLists.txt rename src/{ => threadengines}/threadengine_pthread.cpp (100%) rename src/{ => threadengines}/threadengine_win32.cpp (100%) rename src/{ => win32}/anope-icon.ico (100%) rename anope.bat => src/win32/anope.bat (100%) rename vsvars32.bat => src/win32/vsvars32.bat (100%) rename src/{ => win32}/win32.rc.cmake (98%) rename src/{ => win32}/win32_memory.cpp (100%) rename src/{ => win32}/windows.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 702aad6a0..795d04b09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ else(MINOR_VERSION GREATER 5) endif(MINOR_VERSION GREATER 5) # Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template -set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}) +set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}/cmake) include(Anope) @@ -411,7 +411,7 @@ set(VERSION_FULL_NOBUILD "${VERSION_DOTTED_NOBUILD}${VERSION_EXTRA}") # Only do the following for Windows if(WIN32) # Generate the win32.rc file using the above variables - configure_file(${Anope_SOURCE_DIR}/src/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32.rc) + configure_file(${Anope_SOURCE_DIR}/src/win32/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32/win32.rc) endif(WIN32) # Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source @@ -435,6 +435,7 @@ add_subdirectory(data) add_subdirectory(docs) add_subdirectory(lang) add_subdirectory(src) +add_subdirectory(modules) add_subdirectory(include) # Get the filename of the Anope binary, to use later @@ -454,7 +455,7 @@ if(NOT WIN32 AND RUNGROUP) endif(NOT WIN32 AND RUNGROUP) # On Windows platforms, install extra files if(WIN32) - install(FILES ${Anope_SOURCE_DIR}/anope.bat + install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat DESTINATION bin ) install(FILES ${Anope_SOURCE_DIR}/docs/Changes ${Anope_SOURCE_DIR}/docs/Changes.conf ${Anope_SOURCE_DIR}/docs/Changes.lang @@ -490,8 +491,8 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") ) # The following doesn't work, but a bug report has been filed about it #set(CPACK_CREATE_DESKTOP_LINK_${SERVICES_BINARY} TRUE) - set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico") - set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico") + set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\win32\\\\anope-icon.ico") + set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\win32\\\\anope-icon.ico") set(CPACK_NSIS_INSTALLED_ICON_NAME "${SERVICES_BINARY}") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org/") set(CPACK_NSIS_COMPRESSOR "/SOLID lzma") diff --git a/Anope.cmake b/cmake/Anope.cmake similarity index 86% rename from Anope.cmake rename to cmake/Anope.cmake index 3a45a4b44..97734199f 100644 --- a/Anope.cmake +++ b/cmake/Anope.cmake @@ -359,12 +359,12 @@ macro(find_includes SRC INCLUDES) endmacro(find_includes) ############################################################################### -# calculate_depends( []) +# calculate_depends( []) # # This macro is used in most of the src (sub)directories to calculate the # header file dependencies for the given source file. ############################################################################### -macro(calculate_depends SRC) +macro(calculate_depends SRC SKIP) # Temporarily set that we didn't get a 2nd argument before we actually check if we did get one or not set(CHECK_ANGLE_INCLUDES FALSE) # Check for a second argument @@ -375,6 +375,8 @@ macro(calculate_depends SRC) find_includes(${SRC} INCLUDES) # Reset the list of headers to empty set(HEADERS) + # Reset skip + set(${SKIP} FALSE) # Iterate through the strings containing #include (if any) foreach(INCLUDE ${INCLUDES}) # Extract the filename from the #include line @@ -398,7 +400,8 @@ macro(calculate_depends SRC) endif(FOUND_IN_INCLUDES EQUAL -1) endif(FOUND_IN_DEFAULTS EQUAL -1) else(FOUND_${FILENAME}_INCLUDE) - message(FATAL_ERROR "${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.") + set(${SKIP} TRUE) + message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.") endif(FOUND_${FILENAME}_INCLUDE) endif(CHECK_ANGLE_INCLUDES) endif(QUOTE_TYPE STREQUAL "angle brackets") @@ -406,12 +409,12 @@ macro(calculate_depends SRC) endmacro(calculate_depends) ############################################################################### -# calculate_libraries( ) +# calculate_libraries( ) # -# This macro is used in most of the src (sub)directories to calculate the +# This macro is used in most of the module (sub)directories to calculate the # library dependencies for the given source file. ############################################################################### -macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS) +macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS) # Set up a temporary LDFLAGS for this file set(THIS_LDFLAGS "${LDFLAGS}") # Reset extra dependencies @@ -420,6 +423,8 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS) set(LIBRARY_PATHS) # Reset libraries set(LIBRARIES) + # Default to not skipping this file + set(${SKIP} FALSE) # Check to see if there are any lines matching: /* RequiredLibraries: [something] */ read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES) # Iterate through those lines @@ -449,34 +454,68 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS) append_to_list(LIBRARIES "${LIBRARY}") endif(MSVC) else(FOUND_${LIBRARY}_LIBRARY) + # Skip this file + set(${SKIP} TRUE) # In the case of the library not being found, we fatally error so CMake stops trying to generate - message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.") + message("${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.") endif(FOUND_${LIBRARY}_LIBRARY) endforeach(LIBRARY) endforeach(REQUIRED_LIBRARY) - # Remove duplicates from the library paths - if(LIBRARY_PATHS) - remove_list_duplicates(LIBRARY_PATHS) - endif(LIBRARY_PATHS) - # Remove diplicates from the libraries - if(LIBRARIES) - remove_list_duplicates(LIBRARIES) - endif(LIBRARIES) - # Iterate through library paths and add them to the linker flags - foreach(LIBRARY_PATH ${LIBRARY_PATHS}) - find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS) - if(FOUND_IN_DEFAULTS EQUAL -1) - set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}") - endif(FOUND_IN_DEFAULTS EQUAL -1) - endforeach(LIBRARY_PATH) - # Iterate through libraries and add them to the linker flags - foreach(LIBRARY ${LIBRARIES}) - set(THIS_LDFLAGS "${THIS_LDFLAGS} -l${LIBRARY}") - endforeach(LIBRARY) - set(${SRC_LDFLAGS} "${THIS_LDFLAGS}") - set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}") + if(NOT ${SKIP}) + # Remove duplicates from the library paths + if(LIBRARY_PATHS) + remove_list_duplicates(LIBRARY_PATHS) + endif(LIBRARY_PATHS) + # Remove diplicates from the libraries + if(LIBRARIES) + remove_list_duplicates(LIBRARIES) + endif(LIBRARIES) + # Iterate through library paths and add them to the linker flags + foreach(LIBRARY_PATH ${LIBRARY_PATHS}) + find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS) + if(FOUND_IN_DEFAULTS EQUAL -1) + set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}") + endif(FOUND_IN_DEFAULTS EQUAL -1) + endforeach(LIBRARY_PATH) + # Iterate through libraries and add them to the linker flags + foreach(LIBRARY ${LIBRARIES}) + set(THIS_LDFLAGS "${THIS_LDFLAGS} -l${LIBRARY}") + endforeach(LIBRARY) + set(${SRC_LDFLAGS} "${THIS_LDFLAGS}") + set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}") + endif(NOT ${SKIP}) endmacro(calculate_libraries) +############################################################################### +# check_functions( ) +# +# This macro is used in most of the module (sub)directories to calculate the +# fcuntion dependencies for the given source file. +############################################################################### +macro(check_functions SRC SUCCESS) + # Default to true + set(${SUCCESS} TRUE) + # Check to see if there are any lines matching: /* RequiredFunctions: [something] */ + read_from_file(${SRC} "/\\\\*[ \t]*RequiredFunctions:[ \t]*.*[ \t]*\\\\*/" REQUIRED_FUNCTIONS) + # Iterate through those lines + foreach(REQUIRED_FUNCTION ${REQUIRED_FUNCTIONS}) + # Strip off the /* RequiredFunctions: and */ from the line + string(REGEX REPLACE "/\\*[ \t]*RequiredFunctions:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_FUNCTION ${REQUIRED_FUNCTION}) + # Replace all commas with semicolons + string(REGEX REPLACE "," ";" REQUIRED_FUNCTION ${REQUIRED_FUNCTION}) + # Iterate through the functions given + foreach(FUNCTION ${REQUIRED_FUNCTION}) + # Check if the function exists + check_function_exists(${REQUIRED_FUNCTION} HAVE_${REQUIRED_FUNCTION}) + # If we don't have the function warn the user and set SUCCESS to FALSE + if(NOT HAVE_${REQUIRED_FUNCTION}) + message("${SRC} needs function ${REQUIRED_FUNCTION} but we were unable to locate that function!") + set(${SUCCESS} FALSE) + endif(NOT HAVE_${REQUIRED_FUNCTION}) + endforeach(FUNCTION) + endforeach(REQUIRED_FUNCTION) +endmacro(check_functions) + ############################################################################### # add_to_cpack_ignored_files( [TRUE]) # diff --git a/NSIS.template.in b/cmake/NSIS.template.in similarity index 100% rename from NSIS.template.in rename to cmake/NSIS.template.in diff --git a/ReadFile.cmake b/cmake/ReadFile.cmake similarity index 100% rename from ReadFile.cmake rename to cmake/ReadFile.cmake diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 178dab8de..09ae21e76 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -7,7 +7,7 @@ if(WIN32) # Add README.txt to list of files for CPack to ignore add_to_cpack_ignored_files("README.txt$" TRUE) endif(IN_SOURCE) - set(DOCS DEFCON FAQ INSTALL MODULES NEWS PROXY ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt) + set(DOCS DEFCON FAQ INSTALL MODULES NEWS ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt) install(FILES ${DOCS} DESTINATION docs ) diff --git a/docs/PROXY b/docs/PROXY deleted file mode 100644 index 24499be11..000000000 --- a/docs/PROXY +++ /dev/null @@ -1,41 +0,0 @@ -Anope Proxy Detector --------------------- - -1) Introduction -2) Alternatives - -1) Introduction - - Anope has had a built-in proxy detector since it's first version. Recently, - however, this built-in proxy detector has been removed. This was because - the Anope team found that the proxy detector was showing it's age, and the - time needed to restore it to a good state wasn't worth it, also considering - that there are currently good alternatives out there which do the job as - good as it can be done already. - -2) Alternatives - - A) Blitzed Open Proxy Monitor (BOPM) - B) NeoStats + OPSB - - Note that these are seperate projects and that the Anope team won't give - support on these programs. For support, please refer to the sites of the - creators of the software packages. - - A) Blitzed Open Proxy Monitor (BOPM) - - URL: http://wiki.blitzed.org/BOPM - - BOPM is currently the leading proxy detector for IRC networks out - there. Altough it is not designed to run on a central place for the - entire network, it can be done with some minor tweaking on most IRCd's. - The Anope Team advises BOPM for the best security. - - B) NeoStats + OPSB - - URL: http://www.neostats.net/ - - NeoStats is the swiss knife of IRC tools. In combination with the OPSB - module by NeoStats Software, it can scan for proxies in a similar way - as BOPM does. The OPSB module is based on BOPM and has been adjusted to - be able to scan all clients from one centralized proxy detector. diff --git a/include/hashcomp.h b/include/hashcomp.h index 711f8275f..8c503b0a2 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -13,6 +13,19 @@ #ifndef HASHCOMP_H #define HASHCOMP_H +#ifdef _WIN32 +# ifdef MODULE_COMPILE +# define CoreExport __declspec(dllimport) +# define DllExport __declspec(dllexport) +# else +# define CoreExport __declspec(dllexport) +# define DllExport __declspec(dllimport) +# endif +#else +# define CoreExport +# define DllExport +#endif + #include #ifndef _WIN32 diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt new file mode 100644 index 000000000..8a90f3a3a --- /dev/null +++ b/modules/CMakeLists.txt @@ -0,0 +1,187 @@ +# Get a list of ALL files and directories within the current directory +file(GLOB MODULES_FOLDERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*") +remove_item_from_list(MODULES_FOLDERS "CMakeFiles") + +# If using Windows, add the MODULE_COMPILE define +if(WIN32) + add_definitions(-DMODULE_COMPILE) +endif(WIN32) + +# Iterate through the directories +foreach(MODULE_FOLDER ${MODULES_FOLDERS}) + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE_FOLDER}") + # Get a list of all .cpp files in this directory + file(GLOB MODULES_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${MODULE_FOLDER}/*.cpp") + sort_list(MODULES_SRCS) + + # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) + set_source_files_properties(${MODULES_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") + + # Create an empty list to store extra include directories + set(EXTRA_INCLUDES) + + # Get the length of the folder name + string(LENGTH ${MODULE_FOLDER} FOLDER_LEN) + # Add one (the /) + math(EXPR FOLDER_LEN "${FOLDER_LEN} + 1") + + # Iterate through all the source files + foreach(SRC ${MODULES_SRCS}) + # Get the length of the new source file + string(LENGTH ${SRC} SRC_LEN) + # Set FILE_LEN to the length of the source file minus folder length + math(EXPR FILE_LEN "${SRC_LEN} - ${FOLDER_LEN}") + # Get the real name of the source file now + string(SUBSTRING ${SRC} ${FOLDER_LEN} ${FILE_LEN} SRC_REALNAME) + # Convert the real source file extension to have a .so extension + string(REGEX REPLACE "\\.cpp$" ".so" SO ${SRC_REALNAME}) + # Reset skip_depends + set(SKIP_DEPENDS) + # Temporary variable for the current source's include directories + set(TEMP_INCLUDES) + # Calculate the header file dependencies for the given source file + calculate_depends(${SRC} SKIP_DEPENDS TEMP_INCLUDES) + # If there were some extra include directories, add them to the list + if(TEMP_INCLUDES) + append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) + endif(TEMP_INCLUDES) + # Reset linker flags + set(TEMP_LDFLAGS) + # Reset extra dependencies + set(TEMP_DEPENDENCIES) + # Reset skip_libraries + set(SKIP_LIBRARIES) + # Calculate the library dependencies for the given source file + calculate_libraries(${SRC} SKIP_LIBRARIES TEMP_LDFLAGS TEMP_DEPENDENCIES) + if(NOT SKIP AND NOT SKIP_LIBRARIES) + # Reset has_function + set(HAS_FUNCTION) + # Check the function dependencies for the given source file + check_functions(${SRC} HAS_FUNCTION) + # Only continue if this module has all of the required functions + if(HAS_FUNCTION) + # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators + if(MSVC) + set(WIN32_MEMORY win32_memory) + else(MSVC) + set(WIN32_MEMORY) + endif(MSVC) + # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand + add_library(${SO} MODULE ${SRC}) + set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS}") + add_dependencies(${SO} ${PROGRAM_NAME}) + # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version + if(WIN32) + target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES}) + set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") + endif(WIN32) + # Set the module to be installed to the module directory under the data directory + install(TARGETS ${SO} + DESTINATION data/modules + ) + endif(HAS_FUNCTION) + endif(NOT SKIP AND NOT SKIP_LIBRARIES) + endforeach(SRC) + + # Get a list of ALL files and directories within this modules directory + file(GLOB SUBMODULE_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${MODULE_FOLDER}/*") + remove_item_from_list(SUBMODULE_DIRS "CMakeFiles") + remove_item_from_list(SUBMODULE_DIRS "extra/mysql") # XXX till sql is fixed + + foreach(SUBDIR ${SUBMODULE_DIRS}) + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}") + file(GLOB MODULES_SUBDIR_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${SUBDIR}/*.cpp") + sort_list(MODULES_SUBDIR_SRCS) + + # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) + set_source_files_properties(${MODULES_SUBDIR_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") + + # Get the length of this subdir + string(LENGTH ${SUBDIR} SUBDIR_LEN) + # Calculate the length of the folder + math(EXPR FILE_LEN "${SUBDIR_LEN} - ${FOLDER_LEN}") + # Extract this subfolders name to use to generate the .so file + string(SUBSTRING ${SUBDIR} ${FOLDER_LEN} ${FILE_LEN} SUBDIR_REALNAME) + # Add .so to the end of the directory name, this will be the module's name + set(SO "${SUBDIR_REALNAME}.so") + + # Temporary linker flags for this subdirectory + set(SUBDIR_LDFLAGS "${LDFLAGS}") + # Temporary extra dependencies for this subdirectory + set(SUBDIR_EXTRA_DEPENDS) + # Reset skip_depends + set(SKIP_DEPENDS) + # Reset skip_libraries + set(SKIP_LIBRARIES) + # Reset has_function + set(HAS_FUNCTION TRUE) + + # Iterate through the source files in the subdirectory + foreach(SRC ${MODULES_SUBDIR_SRCS}) + if(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION) + # Temporary variable for the current source's include directories + set(TEMP_INCLUDES) + # Calculate the header file dependencies for the given source file + calculate_depends(${SRC} SKIP_DEPENDS TEMP_INCLUDES) + # If there were some extra include directories, add them to the list + if(TEMP_INCLUDES) + append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) + endif(TEMP_INCLUDES) + # Reset linker flags + set(TEMP_LDFLAGS) + # Reset extra dependencies + set(TEMP_DEPENDENCIES) + # Calculate the library dependencies for the given source file + calculate_libraries(${SRC} SKIP_LIBRARIES TEMP_LDFLAGS TEMP_DEPENDENCIES) + # Check the function dependencies for the given source file + check_functions(${SRC} HAS_FUNCTION) + + # Append this source file's linker flags to the subdirectoy's linker flags, if there are any to append + if(TEMP_DEPENDENCIES) + append_to_list(SUBDIR_EXTRA_DEPENDS ${TEMP_DEPDENCIES}) + endif(TEMP_DEPENDENCIES) + endif(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION) + endforeach(SRC) + + # Continue if library and function requirements are met + if(NOT SKIP AND HAS_FUNCTION) + # Remove duplicates from the linker flags + if(SUBDIR_LDFLAGS) + remove_list_duplicates(SUBDIR_LDFLAGS) + endif(SUBDIR_LDFLAGS) + # Remove duplicates from the extra dependencies + if(SUBDIR_EXTRA_DEPENDS) + remove_list_duplicates(SUBDIR_EXTRA_DEPENDS) + endif(SUBDIR_EXTRA_DEPENDS) + + # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators + if(MSVC) + set(WIN32_MEMORY win32_memory) + else(MSVC) + set(WIN32_MEMORY) + endif(MSVC) + + # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand + add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS}) + set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}") + add_dependencies(${SO} ${PROGRAM_NAME}) + # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version + if(WIN32) + target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS}) + set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") + endif(WIN32) + # Set the module to be installed to the module directory under the data directory + install(TARGETS ${SO} + DESTINATION data/modules + ) + endif(NOT SKIP AND HAS_FUNCTION) + endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}") + endforeach(SUBDIR) + endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE_FOLDER}") +endforeach(MODULE_FOLDER) + +# If there were extra include directories, remove the duplicates and add the directories to the include path +if(EXTRA_INCLUDES) + remove_list_duplicates(EXTRA_INCLUDES) + include_directories(${EXTRA_INCLUDES}) +endif(EXTRA_INCLUDES) diff --git a/src/core/bs_act.cpp b/modules/core/bs_act.cpp similarity index 100% rename from src/core/bs_act.cpp rename to modules/core/bs_act.cpp diff --git a/src/core/bs_assign.cpp b/modules/core/bs_assign.cpp similarity index 100% rename from src/core/bs_assign.cpp rename to modules/core/bs_assign.cpp diff --git a/src/core/bs_badwords.cpp b/modules/core/bs_badwords.cpp similarity index 100% rename from src/core/bs_badwords.cpp rename to modules/core/bs_badwords.cpp diff --git a/src/core/bs_bot.cpp b/modules/core/bs_bot.cpp similarity index 100% rename from src/core/bs_bot.cpp rename to modules/core/bs_bot.cpp diff --git a/src/core/bs_botlist.cpp b/modules/core/bs_botlist.cpp similarity index 100% rename from src/core/bs_botlist.cpp rename to modules/core/bs_botlist.cpp diff --git a/src/core/bs_help.cpp b/modules/core/bs_help.cpp similarity index 100% rename from src/core/bs_help.cpp rename to modules/core/bs_help.cpp diff --git a/src/core/bs_info.cpp b/modules/core/bs_info.cpp similarity index 100% rename from src/core/bs_info.cpp rename to modules/core/bs_info.cpp diff --git a/src/core/bs_kick.cpp b/modules/core/bs_kick.cpp similarity index 100% rename from src/core/bs_kick.cpp rename to modules/core/bs_kick.cpp diff --git a/src/core/bs_say.cpp b/modules/core/bs_say.cpp similarity index 100% rename from src/core/bs_say.cpp rename to modules/core/bs_say.cpp diff --git a/src/core/bs_set.cpp b/modules/core/bs_set.cpp similarity index 100% rename from src/core/bs_set.cpp rename to modules/core/bs_set.cpp diff --git a/src/core/bs_unassign.cpp b/modules/core/bs_unassign.cpp similarity index 100% rename from src/core/bs_unassign.cpp rename to modules/core/bs_unassign.cpp diff --git a/src/core/cs_access.cpp b/modules/core/cs_access.cpp similarity index 100% rename from src/core/cs_access.cpp rename to modules/core/cs_access.cpp diff --git a/src/core/cs_akick.cpp b/modules/core/cs_akick.cpp similarity index 100% rename from src/core/cs_akick.cpp rename to modules/core/cs_akick.cpp diff --git a/src/core/cs_ban.cpp b/modules/core/cs_ban.cpp similarity index 100% rename from src/core/cs_ban.cpp rename to modules/core/cs_ban.cpp diff --git a/src/core/cs_clear.cpp b/modules/core/cs_clear.cpp similarity index 100% rename from src/core/cs_clear.cpp rename to modules/core/cs_clear.cpp diff --git a/src/core/cs_drop.cpp b/modules/core/cs_drop.cpp similarity index 100% rename from src/core/cs_drop.cpp rename to modules/core/cs_drop.cpp diff --git a/src/core/cs_forbid.cpp b/modules/core/cs_forbid.cpp similarity index 100% rename from src/core/cs_forbid.cpp rename to modules/core/cs_forbid.cpp diff --git a/src/core/cs_getkey.cpp b/modules/core/cs_getkey.cpp similarity index 100% rename from src/core/cs_getkey.cpp rename to modules/core/cs_getkey.cpp diff --git a/src/core/cs_help.cpp b/modules/core/cs_help.cpp similarity index 100% rename from src/core/cs_help.cpp rename to modules/core/cs_help.cpp diff --git a/src/core/cs_info.cpp b/modules/core/cs_info.cpp similarity index 100% rename from src/core/cs_info.cpp rename to modules/core/cs_info.cpp diff --git a/src/core/cs_invite.cpp b/modules/core/cs_invite.cpp similarity index 100% rename from src/core/cs_invite.cpp rename to modules/core/cs_invite.cpp diff --git a/src/core/cs_kick.cpp b/modules/core/cs_kick.cpp similarity index 100% rename from src/core/cs_kick.cpp rename to modules/core/cs_kick.cpp diff --git a/src/core/cs_list.cpp b/modules/core/cs_list.cpp similarity index 100% rename from src/core/cs_list.cpp rename to modules/core/cs_list.cpp diff --git a/src/core/cs_modes.cpp b/modules/core/cs_modes.cpp similarity index 100% rename from src/core/cs_modes.cpp rename to modules/core/cs_modes.cpp diff --git a/src/core/cs_register.cpp b/modules/core/cs_register.cpp similarity index 100% rename from src/core/cs_register.cpp rename to modules/core/cs_register.cpp diff --git a/src/core/cs_saset.cpp b/modules/core/cs_saset.cpp similarity index 100% rename from src/core/cs_saset.cpp rename to modules/core/cs_saset.cpp diff --git a/src/core/cs_saset_noexpire.cpp b/modules/core/cs_saset_noexpire.cpp similarity index 100% rename from src/core/cs_saset_noexpire.cpp rename to modules/core/cs_saset_noexpire.cpp diff --git a/src/core/cs_set.cpp b/modules/core/cs_set.cpp similarity index 100% rename from src/core/cs_set.cpp rename to modules/core/cs_set.cpp diff --git a/src/core/cs_set_bantype.cpp b/modules/core/cs_set_bantype.cpp similarity index 100% rename from src/core/cs_set_bantype.cpp rename to modules/core/cs_set_bantype.cpp diff --git a/src/core/cs_set_description.cpp b/modules/core/cs_set_description.cpp similarity index 100% rename from src/core/cs_set_description.cpp rename to modules/core/cs_set_description.cpp diff --git a/src/core/cs_set_entrymsg.cpp b/modules/core/cs_set_entrymsg.cpp similarity index 100% rename from src/core/cs_set_entrymsg.cpp rename to modules/core/cs_set_entrymsg.cpp diff --git a/src/core/cs_set_founder.cpp b/modules/core/cs_set_founder.cpp similarity index 100% rename from src/core/cs_set_founder.cpp rename to modules/core/cs_set_founder.cpp diff --git a/src/core/cs_set_keeptopic.cpp b/modules/core/cs_set_keeptopic.cpp similarity index 100% rename from src/core/cs_set_keeptopic.cpp rename to modules/core/cs_set_keeptopic.cpp diff --git a/src/core/cs_set_mlock.cpp b/modules/core/cs_set_mlock.cpp similarity index 100% rename from src/core/cs_set_mlock.cpp rename to modules/core/cs_set_mlock.cpp diff --git a/src/core/cs_set_opnotice.cpp b/modules/core/cs_set_opnotice.cpp similarity index 100% rename from src/core/cs_set_opnotice.cpp rename to modules/core/cs_set_opnotice.cpp diff --git a/src/core/cs_set_peace.cpp b/modules/core/cs_set_peace.cpp similarity index 100% rename from src/core/cs_set_peace.cpp rename to modules/core/cs_set_peace.cpp diff --git a/src/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp similarity index 100% rename from src/core/cs_set_persist.cpp rename to modules/core/cs_set_persist.cpp diff --git a/src/core/cs_set_private.cpp b/modules/core/cs_set_private.cpp similarity index 100% rename from src/core/cs_set_private.cpp rename to modules/core/cs_set_private.cpp diff --git a/src/core/cs_set_restricted.cpp b/modules/core/cs_set_restricted.cpp similarity index 100% rename from src/core/cs_set_restricted.cpp rename to modules/core/cs_set_restricted.cpp diff --git a/src/core/cs_set_secure.cpp b/modules/core/cs_set_secure.cpp similarity index 100% rename from src/core/cs_set_secure.cpp rename to modules/core/cs_set_secure.cpp diff --git a/src/core/cs_set_securefounder.cpp b/modules/core/cs_set_securefounder.cpp similarity index 100% rename from src/core/cs_set_securefounder.cpp rename to modules/core/cs_set_securefounder.cpp diff --git a/src/core/cs_set_secureops.cpp b/modules/core/cs_set_secureops.cpp similarity index 100% rename from src/core/cs_set_secureops.cpp rename to modules/core/cs_set_secureops.cpp diff --git a/src/core/cs_set_signkick.cpp b/modules/core/cs_set_signkick.cpp similarity index 100% rename from src/core/cs_set_signkick.cpp rename to modules/core/cs_set_signkick.cpp diff --git a/src/core/cs_set_successor.cpp b/modules/core/cs_set_successor.cpp similarity index 100% rename from src/core/cs_set_successor.cpp rename to modules/core/cs_set_successor.cpp diff --git a/src/core/cs_set_topiclock.cpp b/modules/core/cs_set_topiclock.cpp similarity index 100% rename from src/core/cs_set_topiclock.cpp rename to modules/core/cs_set_topiclock.cpp diff --git a/src/core/cs_set_xop.cpp b/modules/core/cs_set_xop.cpp similarity index 100% rename from src/core/cs_set_xop.cpp rename to modules/core/cs_set_xop.cpp diff --git a/src/core/cs_status.cpp b/modules/core/cs_status.cpp similarity index 100% rename from src/core/cs_status.cpp rename to modules/core/cs_status.cpp diff --git a/src/core/cs_suspend.cpp b/modules/core/cs_suspend.cpp similarity index 100% rename from src/core/cs_suspend.cpp rename to modules/core/cs_suspend.cpp diff --git a/src/core/cs_topic.cpp b/modules/core/cs_topic.cpp similarity index 100% rename from src/core/cs_topic.cpp rename to modules/core/cs_topic.cpp diff --git a/src/core/cs_unban.cpp b/modules/core/cs_unban.cpp similarity index 100% rename from src/core/cs_unban.cpp rename to modules/core/cs_unban.cpp diff --git a/src/core/cs_xop.cpp b/modules/core/cs_xop.cpp similarity index 100% rename from src/core/cs_xop.cpp rename to modules/core/cs_xop.cpp diff --git a/src/core/db_plain.cpp b/modules/core/db_plain.cpp similarity index 100% rename from src/core/db_plain.cpp rename to modules/core/db_plain.cpp diff --git a/src/core/enc_md5.cpp b/modules/core/enc_md5.cpp similarity index 100% rename from src/core/enc_md5.cpp rename to modules/core/enc_md5.cpp diff --git a/src/core/enc_none.cpp b/modules/core/enc_none.cpp similarity index 100% rename from src/core/enc_none.cpp rename to modules/core/enc_none.cpp diff --git a/src/core/enc_old.cpp b/modules/core/enc_old.cpp similarity index 100% rename from src/core/enc_old.cpp rename to modules/core/enc_old.cpp diff --git a/src/core/enc_sha1.cpp b/modules/core/enc_sha1.cpp similarity index 100% rename from src/core/enc_sha1.cpp rename to modules/core/enc_sha1.cpp diff --git a/src/core/enc_sha256.cpp b/modules/core/enc_sha256.cpp similarity index 100% rename from src/core/enc_sha256.cpp rename to modules/core/enc_sha256.cpp diff --git a/src/core/hs_del.cpp b/modules/core/hs_del.cpp similarity index 100% rename from src/core/hs_del.cpp rename to modules/core/hs_del.cpp diff --git a/src/core/hs_delall.cpp b/modules/core/hs_delall.cpp similarity index 100% rename from src/core/hs_delall.cpp rename to modules/core/hs_delall.cpp diff --git a/src/core/hs_group.cpp b/modules/core/hs_group.cpp similarity index 100% rename from src/core/hs_group.cpp rename to modules/core/hs_group.cpp diff --git a/src/core/hs_help.cpp b/modules/core/hs_help.cpp similarity index 100% rename from src/core/hs_help.cpp rename to modules/core/hs_help.cpp diff --git a/src/core/hs_list.cpp b/modules/core/hs_list.cpp similarity index 100% rename from src/core/hs_list.cpp rename to modules/core/hs_list.cpp diff --git a/src/core/hs_off.cpp b/modules/core/hs_off.cpp similarity index 100% rename from src/core/hs_off.cpp rename to modules/core/hs_off.cpp diff --git a/src/core/hs_on.cpp b/modules/core/hs_on.cpp similarity index 100% rename from src/core/hs_on.cpp rename to modules/core/hs_on.cpp diff --git a/src/core/hs_set.cpp b/modules/core/hs_set.cpp similarity index 100% rename from src/core/hs_set.cpp rename to modules/core/hs_set.cpp diff --git a/src/core/hs_setall.cpp b/modules/core/hs_setall.cpp similarity index 100% rename from src/core/hs_setall.cpp rename to modules/core/hs_setall.cpp diff --git a/src/core/ms_cancel.cpp b/modules/core/ms_cancel.cpp similarity index 100% rename from src/core/ms_cancel.cpp rename to modules/core/ms_cancel.cpp diff --git a/src/core/ms_check.cpp b/modules/core/ms_check.cpp similarity index 100% rename from src/core/ms_check.cpp rename to modules/core/ms_check.cpp diff --git a/src/core/ms_del.cpp b/modules/core/ms_del.cpp similarity index 100% rename from src/core/ms_del.cpp rename to modules/core/ms_del.cpp diff --git a/src/core/ms_help.cpp b/modules/core/ms_help.cpp similarity index 100% rename from src/core/ms_help.cpp rename to modules/core/ms_help.cpp diff --git a/src/core/ms_info.cpp b/modules/core/ms_info.cpp similarity index 100% rename from src/core/ms_info.cpp rename to modules/core/ms_info.cpp diff --git a/src/core/ms_list.cpp b/modules/core/ms_list.cpp similarity index 100% rename from src/core/ms_list.cpp rename to modules/core/ms_list.cpp diff --git a/src/core/ms_read.cpp b/modules/core/ms_read.cpp similarity index 100% rename from src/core/ms_read.cpp rename to modules/core/ms_read.cpp diff --git a/src/core/ms_rsend.cpp b/modules/core/ms_rsend.cpp similarity index 100% rename from src/core/ms_rsend.cpp rename to modules/core/ms_rsend.cpp diff --git a/src/core/ms_send.cpp b/modules/core/ms_send.cpp similarity index 100% rename from src/core/ms_send.cpp rename to modules/core/ms_send.cpp diff --git a/src/core/ms_sendall.cpp b/modules/core/ms_sendall.cpp similarity index 100% rename from src/core/ms_sendall.cpp rename to modules/core/ms_sendall.cpp diff --git a/src/core/ms_set.cpp b/modules/core/ms_set.cpp similarity index 100% rename from src/core/ms_set.cpp rename to modules/core/ms_set.cpp diff --git a/src/core/ms_staff.cpp b/modules/core/ms_staff.cpp similarity index 100% rename from src/core/ms_staff.cpp rename to modules/core/ms_staff.cpp diff --git a/src/core/ns_access.cpp b/modules/core/ns_access.cpp similarity index 100% rename from src/core/ns_access.cpp rename to modules/core/ns_access.cpp diff --git a/src/core/ns_alist.cpp b/modules/core/ns_alist.cpp similarity index 100% rename from src/core/ns_alist.cpp rename to modules/core/ns_alist.cpp diff --git a/src/core/ns_drop.cpp b/modules/core/ns_drop.cpp similarity index 100% rename from src/core/ns_drop.cpp rename to modules/core/ns_drop.cpp diff --git a/src/core/ns_forbid.cpp b/modules/core/ns_forbid.cpp similarity index 100% rename from src/core/ns_forbid.cpp rename to modules/core/ns_forbid.cpp diff --git a/src/core/ns_getemail.cpp b/modules/core/ns_getemail.cpp similarity index 100% rename from src/core/ns_getemail.cpp rename to modules/core/ns_getemail.cpp diff --git a/src/core/ns_getpass.cpp b/modules/core/ns_getpass.cpp similarity index 100% rename from src/core/ns_getpass.cpp rename to modules/core/ns_getpass.cpp diff --git a/src/core/ns_ghost.cpp b/modules/core/ns_ghost.cpp similarity index 100% rename from src/core/ns_ghost.cpp rename to modules/core/ns_ghost.cpp diff --git a/src/core/ns_group.cpp b/modules/core/ns_group.cpp similarity index 100% rename from src/core/ns_group.cpp rename to modules/core/ns_group.cpp diff --git a/src/core/ns_help.cpp b/modules/core/ns_help.cpp similarity index 100% rename from src/core/ns_help.cpp rename to modules/core/ns_help.cpp diff --git a/src/core/ns_identify.cpp b/modules/core/ns_identify.cpp similarity index 100% rename from src/core/ns_identify.cpp rename to modules/core/ns_identify.cpp diff --git a/src/core/ns_info.cpp b/modules/core/ns_info.cpp similarity index 100% rename from src/core/ns_info.cpp rename to modules/core/ns_info.cpp diff --git a/src/core/ns_list.cpp b/modules/core/ns_list.cpp similarity index 100% rename from src/core/ns_list.cpp rename to modules/core/ns_list.cpp diff --git a/src/core/ns_logout.cpp b/modules/core/ns_logout.cpp similarity index 100% rename from src/core/ns_logout.cpp rename to modules/core/ns_logout.cpp diff --git a/src/core/ns_recover.cpp b/modules/core/ns_recover.cpp similarity index 100% rename from src/core/ns_recover.cpp rename to modules/core/ns_recover.cpp diff --git a/src/core/ns_register.cpp b/modules/core/ns_register.cpp similarity index 100% rename from src/core/ns_register.cpp rename to modules/core/ns_register.cpp diff --git a/src/core/ns_release.cpp b/modules/core/ns_release.cpp similarity index 100% rename from src/core/ns_release.cpp rename to modules/core/ns_release.cpp diff --git a/src/core/ns_resetpass.cpp b/modules/core/ns_resetpass.cpp similarity index 100% rename from src/core/ns_resetpass.cpp rename to modules/core/ns_resetpass.cpp diff --git a/src/core/ns_saset.cpp b/modules/core/ns_saset.cpp similarity index 100% rename from src/core/ns_saset.cpp rename to modules/core/ns_saset.cpp diff --git a/src/core/ns_saset_noexpire.cpp b/modules/core/ns_saset_noexpire.cpp similarity index 100% rename from src/core/ns_saset_noexpire.cpp rename to modules/core/ns_saset_noexpire.cpp diff --git a/src/core/ns_sendpass.cpp b/modules/core/ns_sendpass.cpp similarity index 100% rename from src/core/ns_sendpass.cpp rename to modules/core/ns_sendpass.cpp diff --git a/src/core/ns_set.cpp b/modules/core/ns_set.cpp similarity index 100% rename from src/core/ns_set.cpp rename to modules/core/ns_set.cpp diff --git a/src/core/ns_set_autoop.cpp b/modules/core/ns_set_autoop.cpp similarity index 100% rename from src/core/ns_set_autoop.cpp rename to modules/core/ns_set_autoop.cpp diff --git a/src/core/ns_set_email.cpp b/modules/core/ns_set_email.cpp similarity index 100% rename from src/core/ns_set_email.cpp rename to modules/core/ns_set_email.cpp diff --git a/src/core/ns_set_greet.cpp b/modules/core/ns_set_greet.cpp similarity index 100% rename from src/core/ns_set_greet.cpp rename to modules/core/ns_set_greet.cpp diff --git a/src/core/ns_set_hide.cpp b/modules/core/ns_set_hide.cpp similarity index 100% rename from src/core/ns_set_hide.cpp rename to modules/core/ns_set_hide.cpp diff --git a/src/core/ns_set_kill.cpp b/modules/core/ns_set_kill.cpp similarity index 100% rename from src/core/ns_set_kill.cpp rename to modules/core/ns_set_kill.cpp diff --git a/src/core/ns_set_language.cpp b/modules/core/ns_set_language.cpp similarity index 100% rename from src/core/ns_set_language.cpp rename to modules/core/ns_set_language.cpp diff --git a/src/core/ns_set_message.cpp b/modules/core/ns_set_message.cpp similarity index 100% rename from src/core/ns_set_message.cpp rename to modules/core/ns_set_message.cpp diff --git a/src/core/ns_set_private.cpp b/modules/core/ns_set_private.cpp similarity index 100% rename from src/core/ns_set_private.cpp rename to modules/core/ns_set_private.cpp diff --git a/src/core/ns_set_secure.cpp b/modules/core/ns_set_secure.cpp similarity index 100% rename from src/core/ns_set_secure.cpp rename to modules/core/ns_set_secure.cpp diff --git a/src/core/ns_status.cpp b/modules/core/ns_status.cpp similarity index 100% rename from src/core/ns_status.cpp rename to modules/core/ns_status.cpp diff --git a/src/core/ns_suspend.cpp b/modules/core/ns_suspend.cpp similarity index 100% rename from src/core/ns_suspend.cpp rename to modules/core/ns_suspend.cpp diff --git a/src/core/ns_update.cpp b/modules/core/ns_update.cpp similarity index 100% rename from src/core/ns_update.cpp rename to modules/core/ns_update.cpp diff --git a/src/core/os_akill.cpp b/modules/core/os_akill.cpp similarity index 100% rename from src/core/os_akill.cpp rename to modules/core/os_akill.cpp diff --git a/src/core/os_chankill.cpp b/modules/core/os_chankill.cpp similarity index 100% rename from src/core/os_chankill.cpp rename to modules/core/os_chankill.cpp diff --git a/src/core/os_chanlist.cpp b/modules/core/os_chanlist.cpp similarity index 100% rename from src/core/os_chanlist.cpp rename to modules/core/os_chanlist.cpp diff --git a/src/core/os_clearmodes.cpp b/modules/core/os_clearmodes.cpp similarity index 100% rename from src/core/os_clearmodes.cpp rename to modules/core/os_clearmodes.cpp diff --git a/src/core/os_defcon.cpp b/modules/core/os_defcon.cpp similarity index 100% rename from src/core/os_defcon.cpp rename to modules/core/os_defcon.cpp diff --git a/src/core/os_global.cpp b/modules/core/os_global.cpp similarity index 100% rename from src/core/os_global.cpp rename to modules/core/os_global.cpp diff --git a/src/core/os_help.cpp b/modules/core/os_help.cpp similarity index 100% rename from src/core/os_help.cpp rename to modules/core/os_help.cpp diff --git a/src/core/os_ignore.cpp b/modules/core/os_ignore.cpp similarity index 100% rename from src/core/os_ignore.cpp rename to modules/core/os_ignore.cpp diff --git a/src/core/os_jupe.cpp b/modules/core/os_jupe.cpp similarity index 100% rename from src/core/os_jupe.cpp rename to modules/core/os_jupe.cpp diff --git a/src/core/os_kick.cpp b/modules/core/os_kick.cpp similarity index 100% rename from src/core/os_kick.cpp rename to modules/core/os_kick.cpp diff --git a/src/core/os_mode.cpp b/modules/core/os_mode.cpp similarity index 100% rename from src/core/os_mode.cpp rename to modules/core/os_mode.cpp diff --git a/src/core/os_modinfo.cpp b/modules/core/os_modinfo.cpp similarity index 100% rename from src/core/os_modinfo.cpp rename to modules/core/os_modinfo.cpp diff --git a/src/core/os_modlist.cpp b/modules/core/os_modlist.cpp similarity index 100% rename from src/core/os_modlist.cpp rename to modules/core/os_modlist.cpp diff --git a/src/core/os_modload.cpp b/modules/core/os_modload.cpp similarity index 100% rename from src/core/os_modload.cpp rename to modules/core/os_modload.cpp diff --git a/src/core/os_modunload.cpp b/modules/core/os_modunload.cpp similarity index 100% rename from src/core/os_modunload.cpp rename to modules/core/os_modunload.cpp diff --git a/src/core/os_news.cpp b/modules/core/os_news.cpp similarity index 100% rename from src/core/os_news.cpp rename to modules/core/os_news.cpp diff --git a/src/core/os_noop.cpp b/modules/core/os_noop.cpp similarity index 100% rename from src/core/os_noop.cpp rename to modules/core/os_noop.cpp diff --git a/src/core/os_oline.cpp b/modules/core/os_oline.cpp similarity index 100% rename from src/core/os_oline.cpp rename to modules/core/os_oline.cpp diff --git a/src/core/os_quit.cpp b/modules/core/os_quit.cpp similarity index 100% rename from src/core/os_quit.cpp rename to modules/core/os_quit.cpp diff --git a/src/core/os_reload.cpp b/modules/core/os_reload.cpp similarity index 100% rename from src/core/os_reload.cpp rename to modules/core/os_reload.cpp diff --git a/src/core/os_restart.cpp b/modules/core/os_restart.cpp similarity index 100% rename from src/core/os_restart.cpp rename to modules/core/os_restart.cpp diff --git a/src/core/os_session.cpp b/modules/core/os_session.cpp similarity index 100% rename from src/core/os_session.cpp rename to modules/core/os_session.cpp diff --git a/src/core/os_set.cpp b/modules/core/os_set.cpp similarity index 100% rename from src/core/os_set.cpp rename to modules/core/os_set.cpp diff --git a/src/core/os_shutdown.cpp b/modules/core/os_shutdown.cpp similarity index 100% rename from src/core/os_shutdown.cpp rename to modules/core/os_shutdown.cpp diff --git a/src/core/os_snline.cpp b/modules/core/os_snline.cpp similarity index 100% rename from src/core/os_snline.cpp rename to modules/core/os_snline.cpp diff --git a/src/core/os_sqline.cpp b/modules/core/os_sqline.cpp similarity index 100% rename from src/core/os_sqline.cpp rename to modules/core/os_sqline.cpp diff --git a/src/core/os_staff.cpp b/modules/core/os_staff.cpp similarity index 100% rename from src/core/os_staff.cpp rename to modules/core/os_staff.cpp diff --git a/src/core/os_stats.cpp b/modules/core/os_stats.cpp similarity index 100% rename from src/core/os_stats.cpp rename to modules/core/os_stats.cpp diff --git a/src/core/os_svsnick.cpp b/modules/core/os_svsnick.cpp similarity index 100% rename from src/core/os_svsnick.cpp rename to modules/core/os_svsnick.cpp diff --git a/src/core/os_szline.cpp b/modules/core/os_szline.cpp similarity index 100% rename from src/core/os_szline.cpp rename to modules/core/os_szline.cpp diff --git a/src/core/os_umode.cpp b/modules/core/os_umode.cpp similarity index 100% rename from src/core/os_umode.cpp rename to modules/core/os_umode.cpp diff --git a/src/core/os_update.cpp b/modules/core/os_update.cpp similarity index 100% rename from src/core/os_update.cpp rename to modules/core/os_update.cpp diff --git a/src/core/os_userlist.cpp b/modules/core/os_userlist.cpp similarity index 100% rename from src/core/os_userlist.cpp rename to modules/core/os_userlist.cpp diff --git a/src/core/ss_main.cpp b/modules/core/ss_main.cpp similarity index 100% rename from src/core/ss_main.cpp rename to modules/core/ss_main.cpp diff --git a/src/modules/cs_appendtopic.cpp b/modules/extra/cs_appendtopic.cpp similarity index 100% rename from src/modules/cs_appendtopic.cpp rename to modules/extra/cs_appendtopic.cpp diff --git a/src/modules/cs_enforce.cpp b/modules/extra/cs_enforce.cpp similarity index 100% rename from src/modules/cs_enforce.cpp rename to modules/extra/cs_enforce.cpp diff --git a/src/modules/cs_set_misc.cpp b/modules/extra/cs_set_misc.cpp similarity index 100% rename from src/modules/cs_set_misc.cpp rename to modules/extra/cs_set_misc.cpp diff --git a/src/modules/cs_tban.cpp b/modules/extra/cs_tban.cpp similarity index 100% rename from src/modules/cs_tban.cpp rename to modules/extra/cs_tban.cpp diff --git a/src/modules/hs_request.cpp b/modules/extra/hs_request.cpp similarity index 100% rename from src/modules/hs_request.cpp rename to modules/extra/hs_request.cpp diff --git a/src/modules/m_helpchan.cpp b/modules/extra/m_helpchan.cpp similarity index 100% rename from src/modules/m_helpchan.cpp rename to modules/extra/m_helpchan.cpp diff --git a/src/modules/ssl/m_ssl.cpp b/modules/extra/m_ssl.cpp similarity index 100% rename from src/modules/ssl/m_ssl.cpp rename to modules/extra/m_ssl.cpp diff --git a/src/modules/mysql/db_mysql.h b/modules/extra/mysql/db_mysql.h similarity index 99% rename from src/modules/mysql/db_mysql.h rename to modules/extra/mysql/db_mysql.h index 34ae50931..32a2469c9 100644 --- a/src/modules/mysql/db_mysql.h +++ b/modules/extra/mysql/db_mysql.h @@ -181,7 +181,6 @@ class DBMySQL : public Module me = this; this->SetAuthor("Anope"); - this->SetVersion(VERSION_STRING); this->SetType(DATABASE); if (!LoadConfig()) diff --git a/src/modules/mysql/db_mysql_execute.cpp b/modules/extra/mysql/db_mysql_execute.cpp similarity index 100% rename from src/modules/mysql/db_mysql_execute.cpp rename to modules/extra/mysql/db_mysql_execute.cpp diff --git a/src/modules/mysql/db_mysql_read.cpp b/modules/extra/mysql/db_mysql_read.cpp similarity index 100% rename from src/modules/mysql/db_mysql_read.cpp rename to modules/extra/mysql/db_mysql_read.cpp diff --git a/src/modules/mysql/db_mysql_write.cpp b/modules/extra/mysql/db_mysql_write.cpp similarity index 100% rename from src/modules/mysql/db_mysql_write.cpp rename to modules/extra/mysql/db_mysql_write.cpp diff --git a/src/modules/ns_maxemail.cpp b/modules/extra/ns_maxemail.cpp similarity index 100% rename from src/modules/ns_maxemail.cpp rename to modules/extra/ns_maxemail.cpp diff --git a/src/modules/ns_set_misc.cpp b/modules/extra/ns_set_misc.cpp similarity index 100% rename from src/modules/ns_set_misc.cpp rename to modules/extra/ns_set_misc.cpp diff --git a/src/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp similarity index 100% rename from src/protocol/bahamut.cpp rename to modules/protocol/bahamut.cpp diff --git a/src/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp similarity index 100% rename from src/protocol/inspircd11.cpp rename to modules/protocol/inspircd11.cpp diff --git a/src/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp similarity index 100% rename from src/protocol/inspircd12.cpp rename to modules/protocol/inspircd12.cpp diff --git a/src/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp similarity index 100% rename from src/protocol/inspircd20.cpp rename to modules/protocol/inspircd20.cpp diff --git a/src/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp similarity index 100% rename from src/protocol/ratbox.cpp rename to modules/protocol/ratbox.cpp diff --git a/src/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp similarity index 100% rename from src/protocol/unreal32.cpp rename to modules/protocol/unreal32.cpp diff --git a/src/core/m_socketengine_epoll.cpp b/modules/socketengines/m_socketengine_epoll.cpp similarity index 98% rename from src/core/m_socketengine_epoll.cpp rename to modules/socketengines/m_socketengine_epoll.cpp index 95bc60926..c5e152af3 100644 --- a/src/core/m_socketengine_epoll.cpp +++ b/modules/socketengines/m_socketengine_epoll.cpp @@ -1,3 +1,5 @@ +/* RequiredFunctions: epoll_wait */ + #include "module.h" #include #include diff --git a/src/core/m_socketengine_select.cpp b/modules/socketengines/m_socketengine_select.cpp similarity index 100% rename from src/core/m_socketengine_select.cpp rename to modules/socketengines/m_socketengine_select.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b9c082c7b..4853591b7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,23 +2,21 @@ file(GLOB SRC_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP}) -# Don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators -remove_item_from_list(SRC_SRCS win32_memory.cpp) - -# If not using Windows, don't include windows.cpp, as it's Windows-specific -if(NOT WIN32) - remove_item_from_list(SRC_SRCS windows.cpp) -endif(NOT WIN32) -sort_list(SRC_SRCS) - -# If using Windows, remove the pthread threading engine from the list +# If using Windows, include windows.cpp, as it's Windows-specific if(WIN32) - remove_item_from_list(SRC_SRCS threadengine_pthread.cpp) -# If not using Windows, remove the Windows threading engine from the list -else(WIN32) - remove_item_from_list(SRC_SRCS threadengine_win32.cpp) + append_to_list(SRC_SRCS win32/windows.cpp) endif(WIN32) +# If using Windows, add the win32 threading engine to the list +if(WIN32) + append_to_list(SRC_SRCS threadengines/threadengine_win32.cpp) +# If not using Windows, add the pthread threading engine to the list +else(WIN32) + append_to_list(SRC_SRCS threadengines/threadengine_pthread.cpp) +endif(WIN32) + +sort_list(SRC_SRCS) + # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) set_source_files_properties(${SRC_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") @@ -28,8 +26,10 @@ set(EXTRA_INCLUDES) foreach(SRC ${SRC_SRCS}) # Temporary variable for the current source's include directories set(TEMP_INCLUDES) + # Create unused skip variable + set(SKIP) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) + calculate_depends(${SRC} SKIP TEMP_INCLUDES) # If there were some extra include directories, add them to the list if(TEMP_INCLUDES) append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) @@ -44,9 +44,9 @@ endif(EXTRA_INCLUDES) # Under Windows, we also include a resource file to the build if(WIN32) # Make sure that the resource file is seen as an RC file to be compiled with a resource compiler, not a C++ compiler - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc LANGUAGE RC) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC) # Add the resource file to the list of sources - append_to_list(SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32.rc) + append_to_list(SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc) # For MinGW, we have to change the compile flags if(MINGW) set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include") @@ -54,17 +54,17 @@ if(WIN32) if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO") set(RC_CFLAGS "${RC_CFLAGS} -D_DEBUG") endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO") - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc COMPILE_FLAGS "${RC_CFLAGS}") + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "${RC_CFLAGS}") # For anything else, assumingly Visual Studio at this point, use a different set of compile flags else(MINGW) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"") + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"") endif(MINGW) endif(WIN32) -# If compiling with Visual Studio, create a static library out of win32_memory.cpp to be included with everything else, needed to override it's override of new/delete operators +# If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators if(MSVC) - set_source_files_properties(win32_memory.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") - add_library(win32_memory STATIC win32_memory.cpp) + set_source_files_properties(win32/win32_memory.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") + add_library(win32_memory STATIC win32/win32_memory.cpp) set(WIN32_MEMORY win32_memory) else(MSVC) set(WIN32_MEMORY) @@ -93,9 +93,6 @@ configure_file(${Anope_SOURCE_DIR}/include/sysconf.h.cmake ${Anope_BINARY_DIR}/i # Go into the following directories and run their CMakeLists.txt as well add_subdirectory(bin) -add_subdirectory(core) -add_subdirectory(modules) -add_subdirectory(protocol) add_subdirectory(tools) # Set Anope to be installed to the bin directory diff --git a/src/bin/register b/src/bin/register deleted file mode 100755 index 1c236fbe4..000000000 --- a/src/bin/register +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -############################################### -# Set Variables -############################################### - -# CONFIGURATION CACHE (e.g. ../config.cache) -CACHEFILE="../../config.cache" - -# REGISTRATION INFORMATION CACHE FILE (no need to alter this) -REGCACHE="register.cache" - -# SENDMAIL PATH -SENDMAIL="/usr/sbin/sendmail" - -# SCRIPT VERSION NUMBER (DO NOT ALTER) -REGISTERVERSION="1.3" - -# DO NOT CHANGE IF YOU WANT TO REGISTER WITH ANOPE -REGISTRYADDRESS="register@anope.org" - -################################################ -# END OF CONFIGURATION -# YOU ARE NOT REQUIRED TO CHANGE ANYTHING BELOW -################################################ - -if [ $0 != "./register" ] ; then - echo "Warning: Run this file while in the /src/bin/ directory (e.g. ./register)" - exit 1 -fi - -if [ ! -f $CACHEFILE ] ; then - echo "Warning: Configuration cache file missing. Run ./Config first" - exit 1 -fi - -if [ ! -f $SENDMAIL ] ; then - echo "Warning: Sendmail cannot be found. Please open this file and set variable correctly" - exit 1; -fi - -clear - -if [ -f $REGCACHE ] ; then - echo "Previous registration cache file found. Removing..." - rm $REGCACHE -fi - - echo "##################################################" - echo "Anope registration script (v$REGISTERVERSION)" - echo "##################################################" - echo "This script allows you to register your network" - echo "with the Anope central registry. This gives us" - echo "an idea of how many networks use Anope and what options" - echo "they compile with so we can spend more time developing" - echo "options that are more widely used. Note: The options" - echo "you selected in ./Config will be sent." - echo "You will be asked a series of questions, if you wish" - echo "to be listed in the public network database all the" - echo "information will be required." - echo "NOTE: NO PRIVATE OR SENSITIVE INFORMATION WILL BE SENT" - echo "##################################################" - echo "Would you like to register? [Type YES to continue]" - read answer - -if [ $answer = "YES" ] || [ $answer = "yes" ] || [ $answer = "Yes" ] ; then - - echo "Beginning registration..." - echo "1. What is your network name? (e.g. Anope IRC Network)" - read NETWORKNAME - echo CONNECTADDRESS=\"$NETWORKNAME\" >> $REGCACHE - echo "2. What is your network's connection address (e.g. irc.anope.org)" - read CONNECTADDRESS - echo CONNECTADDRESS=\"$CONNECTADDRESS\" >> $REGCACHE - echo "3. Primary contact email address? (e.g. irc-admin@anope.org)" - read CONTACTEMAIL - echo CONTACTEMAIL=\"$CONTACTEMAIL\" >> $REGCACHE - echo "4. What is your network's website address (e.g. http://www.anope.org)" - read WEBSITEADDRESS - echo WEBSITEADDRESS=\"$WEBSITEADDRESS\" >> $REGCACHE - echo "5. Would you like your network to be listed in a public database?" - echo "[Please type YES if you would like to be listed]" - read LISTED - echo LISTED=\"$LISTED\" >> $REGCACHE - echo "6. (Bonus Devel-Only Question) Why did the chicken cross the road?!" - read BONUS - echo BONUS=\"$BONUS\" >> $REGCACHE - echo >> $REGCACHE - echo "Processing registration..." - cat $CACHEFILE >> $REGCACHE - $SENDMAIL $REGISTRYADDRESS < $REGCACHE - if [ -f $REGCACHE ] ; then - echo "Cleaning up..." - rm $REGCACHE - fi - echo "Registration Completed. Thank you for registering Anope." - exit 0; - -fi - -echo "Registration Cancelled" diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt deleted file mode 100644 index 2af2b3ea9..000000000 --- a/src/core/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -# Find all the *.cpp files within the current source directory, and sort the list -file(GLOB CORE_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") -set(CORE_SRCS ${CORE_SRCS_C} ${CORE_SRCS_CPP}) -sort_list(CORE_SRCS) - -# If using Windows, add the MODULE_COMPILE define -if(WIN32) - add_definitions(-DMODULE_COMPILE) -endif(WIN32) - -# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) -set_source_files_properties(${CORE_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") - -# Create an empty list to store extra include directories -set(EXTRA_INCLUDES) - -# Iterate through all the source files -foreach(SRC ${CORE_SRCS}) - # Convert the source file extension to have a .so extension - string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC}) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) - # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators - if(MSVC) - set(WIN32_MEMORY win32_memory) - else(MSVC) - set(WIN32_MEMORY) - endif(MSVC) - # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_library(${SO} MODULE ${SRC}) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${LDFLAGS}") - add_dependencies(${SO} ${PROGRAM_NAME}) - # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version - if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY}) - set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") - endif(WIN32) - # Set the module to be installed to the module directory under the data directory - install(TARGETS ${SO} - DESTINATION data/modules - ) -endforeach(SRC) - -# If there were extra include directories, remove the duplicates and add the directories to the include path -if(EXTRA_INCLUDES) - remove_list_duplicates(EXTRA_INCLUDES) - include_directories(${EXTRA_INCLUDES}) -endif(EXTRA_INCLUDES) diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index e13b3310a..3698ef565 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -8,7 +8,6 @@ * for use in Anope. */ -#include "services.h" #include "hashcomp.h" /****************************************************** diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt deleted file mode 100644 index a7feab5d0..000000000 --- a/src/modules/CMakeLists.txt +++ /dev/null @@ -1,144 +0,0 @@ -# Find all the *.cpp files within the current source directory, and sort the list -file(GLOB MODULES_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") -set(MODULES_SRCS ${MODULES_SRCS_C} ${MODULES_SRCS_CPP}) -sort_list(MODULES_SRCS) - -# If using Windows, add the MODULE_COMPILE define -if(WIN32) - add_definitions(-DMODULE_COMPILE) -endif(WIN32) - -# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) -set_source_files_properties(${MODULES_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") - -# Create an empty list to store extra include directories -set(EXTRA_INCLUDES) - -# Iterate through all the source files -foreach(SRC ${MODULES_SRCS}) - # Convert the source file extension to have a .so extension - string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC}) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) - # Reset linker flags - set(TEMP_LDFLAGS) - # Reset extra dependencies - set(TEMP_DEPENDENCIES) - # Calculate the library dependencies for the given source file - calculate_libraries(${SRC} TEMP_LDFLAGS TEMP_DEPENDENCIES) - # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators - if(MSVC) - set(WIN32_MEMORY win32_memory) - else(MSVC) - set(WIN32_MEMORY) - endif(MSVC) - # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_library(${SO} MODULE ${SRC}) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS}") - add_dependencies(${SO} ${PROGRAM_NAME}) - # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version - if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES}) - set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") - endif(WIN32) - # Set the module to be installed to the module directory under the data directory - install(TARGETS ${SO} - DESTINATION data/modules - ) -endforeach(SRC) - -# Get a list of ALL files and directories within the current directory -file(GLOB MODULES_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*") -remove_item_from_list(MODULES_FILES "CMakeFiles") -remove_item_from_list(MODULES_FILES "mysql") -remove_item_from_list(MODULES_FILES "ssl") - -# Iterate through this directory searching for subdirectories, and creating modules for those subdirectories -foreach(FILE ${MODULES_FILES}) - if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}") - file(GLOB MODULES_SUBDIR_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${FILE}/*.c") - file(GLOB MODULES_SUBDIR_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${FILE}/*.cpp") - set(MODULES_SUBDIR_SRCS ${MODULES_SUBDIR_SRCS_C} ${MODULES_SUBDIR_SRCS_CPP}) - sort_list(MODULES_SUBDIR_SRCS) - - # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) - set_source_files_properties(${MODULES_SUBDIR_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") - - # Add .so to the end of the directory name, this will be the module's name - set(SO "${FILE}.so") - - # Temporary linker flags for this subdirectory - set(SUBDIR_LDFLAGS "${LDFLAGS}") - # Temporary extra dependencies for this subdirectory - set(SUBDIR_EXTRA_DEPENDS) - - # Iterate through the source files in the subdirectory - foreach(SRC ${MODULES_SUBDIR_SRCS}) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) - # Reset linker flags - set(TEMP_LDFLAGS) - # Reset extra dependencies - set(TEMP_DEPENDENCIES) - # Calculate the library dependencies for the given source file - calculate_libraries(${SRC} TEMP_LDFLAGS TEMP_DEPENDENCIES) - - # Append this source file's linker flags to the subdirectoy's linker flags, if there are any to append - if(TEMP_LDFLAGS) - set(SUBDIR_LDFLAGS "${SUBDIR_LDFLAGS} ${TEMP_LDFLAGS}") - endif(TEMP_LDFLAGS) - # Append this source file's extra dependencies to the subdirector's extra dependencies, if there are any to append - if(TEMP_DEPENDENCIES) - append_to_list(SUBDIR_EXTRA_DEPENDS ${TEMP_DEPENDENCIES}) - endif(TEMP_DEPENDENCIES) - endforeach(SRC) - - # Remove duplicates from the linker flags - if(SUBDIR_LDFLAGS) - remove_list_duplicates(SUBDIR_LDFLAGS) - endif(SUBDIR_LDFLAGS) - # Remove duplicates from the extra dependencies - if(SUBDIR_EXTRA_DEPENDS) - remove_list_duplicates(SUBDIR_EXTRA_DEPENDS) - endif(SUBDIR_EXTRA_DEPENDS) - - # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators - if(MSVC) - set(WIN32_MEMORY win32_memory) - else(MSVC) - set(WIN32_MEMORY) - endif(MSVC) - - # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS}) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}") - add_dependencies(${SO} ${PROGRAM_NAME}) - # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version - if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS}) - set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") - endif(WIN32) - # Set the module to be installed to the module directory under the data directory - install(TARGETS ${SO} - DESTINATION data/modules - ) - endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}") -endforeach(FILE) - -# If there were extra include directories, remove the duplicates and add the directories to the include path -if(EXTRA_INCLUDES) - remove_list_duplicates(EXTRA_INCLUDES) - include_directories(${EXTRA_INCLUDES}) -endif(EXTRA_INCLUDES) diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt deleted file mode 100644 index abca56caf..000000000 --- a/src/protocol/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -# Find all the *.cpp files within the current source directory, and sort the list -file(GLOB PROTOCOL_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") -set(PROTOCOL_SRCS ${PROTOCOL_SRCS_C} ${PROTOCOL_SRCS_CPP}) -sort_list(PROTOCOL_SRCS) - -# If using Windows, add the MODULE_COMPILE define -if(WIN32) - add_definitions(-DMODULE_COMPILE) -endif(WIN32) - -# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) -set_source_files_properties(${PROTOCOL_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") - -# Create an empty list to store extra include directories -set(EXTRA_INCLUDES) - -# Iterate through all the source files -foreach(SRC ${PROTOCOL_SRCS}) - # Convert the source file extension to have a .so extension - string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC}) - # Temporary variable for the current source's include directories - set(TEMP_INCLUDES) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC} TEMP_INCLUDES) - # If there were some extra include directories, add them to the list - if(TEMP_INCLUDES) - append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) - endif(TEMP_INCLUDES) - # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators - if(MSVC) - set(WIN32_MEMORY win32_memory) - else(MSVC) - set(WIN32_MEMORY) - endif(MSVC) - # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_library(${SO} MODULE ${SRC}) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${LDFLAGS}") - add_dependencies(${SO} ${PROGRAM_NAME}) - # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version - if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY}) - set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") - endif(WIN32) - # Set the module to be installed to the module directory under the data directory - install(TARGETS ${SO} - DESTINATION data/modules - ) -endforeach(SRC) - -# If there were extra include directories, remove the duplicates and add the directories to the include path -if(EXTRA_INCLUDES) - remove_list_duplicates(EXTRA_INCLUDES) - include_directories(${EXTRA_INCLUDES}) -endif(EXTRA_INCLUDES) diff --git a/src/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp similarity index 100% rename from src/threadengine_pthread.cpp rename to src/threadengines/threadengine_pthread.cpp diff --git a/src/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp similarity index 100% rename from src/threadengine_win32.cpp rename to src/threadengines/threadengine_win32.cpp diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index b22a796a4..e96b3523e 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,7 +1,5 @@ -# Find all the *.c and *.cpp files within the current source directory, and sort the list -file(GLOB TOOLS_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") -file(GLOB TOOLS_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") -set(TOOLS_SRCS ${TOOLS_SRCS_C} ${TOOLS_SRCS_CPP}) +# Find all the *.cpp files within the current source directory, and sort the list +file(GLOB TOOLS_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") sort_list(TOOLS_SRCS) # Set all the files to use C++ as well as set their compile flags @@ -10,25 +8,30 @@ set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS # Iterate through all the source files foreach(SRC ${TOOLS_SRCS}) # Convert the source file extension to have no extension - string(REGEX REPLACE "\\.(c|cpp)$" "" EXE ${SRC}) + string(REGEX REPLACE "\\.cpp$" "" EXE ${SRC}) + # Create skip variable + set(SKIP) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC}) - # For anoptsmtp, we also want hashcomp.cpp included, so we force it into the sources - if(SRC STREQUAL anopesmtp.cpp) - set(SRC ${SRC} ${Anope_SOURCE_DIR}/src/hashcomp.cpp) - endif(SRC STREQUAL anopesmtp.cpp) - # Generate the executable and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_executable(${EXE} ${SRC}) - set_target_properties(${EXE} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}") - add_dependencies(${EXE} ${PROGRAM_NAME}) - # Set the executable to be installed to the bin directory under the main directory - install(TARGETS ${EXE} - DESTINATION bin - ) - # 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) + calculate_depends(${SRC} SKIP) + # Only continue if this file isn't skipped + if(NOT SKIP) + # For anoptsmtp, we also want hashcomp.cpp included, so we force it into the sources + if(SRC STREQUAL anopesmtp.cpp) + set(SRC ${SRC} ${Anope_SOURCE_DIR}/src/hashcomp.cpp) + endif(SRC STREQUAL anopesmtp.cpp) + # Generate the executable and set its linker flags, also set it to depend on the main Anope executable to be built beforehand + add_executable(${EXE} ${SRC}) + set_target_properties(${EXE} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}") + add_dependencies(${EXE} ${PROGRAM_NAME}) + # Set the executable to be installed to the bin directory under the main directory + install(TARGETS ${EXE} + DESTINATION bin + ) + # 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(NOT SKIP) endforeach(SRC) # Only for Windows, set anopesmtp to require the wsock32 library diff --git a/src/tools/smtp.h b/src/tools/smtp.h index 426d5bc9d..b7c9ef249 100644 --- a/src/tools/smtp.h +++ b/src/tools/smtp.h @@ -12,7 +12,6 @@ #define SMTP_H #include "sysconf.h" -#define CoreExport #include "hashcomp.h" /*************************************************************************/ diff --git a/src/anope-icon.ico b/src/win32/anope-icon.ico similarity index 100% rename from src/anope-icon.ico rename to src/win32/anope-icon.ico diff --git a/anope.bat b/src/win32/anope.bat similarity index 100% rename from anope.bat rename to src/win32/anope.bat diff --git a/vsvars32.bat b/src/win32/vsvars32.bat similarity index 100% rename from vsvars32.bat rename to src/win32/vsvars32.bat diff --git a/src/win32.rc.cmake b/src/win32/win32.rc.cmake similarity index 98% rename from src/win32.rc.cmake rename to src/win32/win32.rc.cmake index aef19223c..e8434109f 100644 --- a/src/win32.rc.cmake +++ b/src/win32/win32.rc.cmake @@ -75,7 +75,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -ICON_APP ICON "@Anope_SOURCE_DIR@/src/anope-icon.ico" +ICON_APP ICON "@Anope_SOURCE_DIR@/src/win32/anope-icon.ico" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/win32_memory.cpp b/src/win32/win32_memory.cpp similarity index 100% rename from src/win32_memory.cpp rename to src/win32/win32_memory.cpp diff --git a/src/windows.cpp b/src/win32/windows.cpp similarity index 100% rename from src/windows.cpp rename to src/win32/windows.cpp