diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-02-01 20:58:10 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-02-01 21:42:50 +0200 |
commit | 954ceb91ddd94985594996d6d3c50be7b5652626 (patch) | |
tree | 95b9a13368a5c561b380f34df95850276ec205ac | |
parent | ba1c188f7a1850761eb7d63fbaaeece6dfb2a256 (diff) | |
download | mv-954ceb91ddd94985594996d6d3c50be7b5652626.tar.gz mv-954ceb91ddd94985594996d6d3c50be7b5652626.tar.bz2 mv-954ceb91ddd94985594996d6d3c50be7b5652626.tar.xz mv-954ceb91ddd94985594996d6d3c50be7b5652626.zip |
Add ability to enable/disable manaserv with embedded enet.
Set manaserv disabled in automake and cmake by default but enabled in build scripts.
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rwxr-xr-x | bmake | 3 | ||||
-rwxr-xr-x | configure.ac | 11 | ||||
-rw-r--r-- | src/CMakeLists.txt | 52 | ||||
-rw-r--r-- | src/Makefile.am | 43 | ||||
-rw-r--r-- | src/gui/serverdialog.cpp | 2 | ||||
-rw-r--r-- | src/net/net.cpp | 5 | ||||
-rw-r--r-- | src/net/serverinfo.h | 3 | ||||
-rw-r--r-- | toolchain.cmake | 2 |
9 files changed, 75 insertions, 47 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 737ac5cc6..a560cb7d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ FIND_PACKAGE(Gettext) OPTION(WITH_OPENGL "Enable OpenGL support" ON) OPTION(ENABLE_NLS "Enable building of tranlations" ON) +OPTION(ENABLE_MANASERV "Enable Manaserv support" ON) IF (WIN32) SET(PKG_DATADIR ".") @@ -38,7 +38,8 @@ autoreconf -i ./configure --prefix=$dir/run \ --datadir=$dir/run/share/games \ --bindir=$dir/run/bin \ - --mandir=$dir/run/share/man + --mandir=$dir/run/share/man \ + --enable-manaserv=yes cd po #make -j5 update-po 2>../make1.log diff --git a/configure.ac b/configure.ac index bb1085f77..7315832c5 100755 --- a/configure.ac +++ b/configure.ac @@ -134,6 +134,17 @@ AC_MSG_ERROR([ *** Unable to find SDL_net library])) AC_CHECK_LIB(rt, shm_open, , AC_MSG_ERROR([ *** Unable to find librt library])) +# Enable manaserv +AC_ARG_ENABLE(manaserv, +[ --enable-manaserv Turn on manaserv], +[case "${enableval}" in + yes) with_manaserv=true ;; + no) with_manaserv=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-manaserv) ;; +esac],[with_manaserv=false]) + +AM_CONDITIONAL(ENABLE_MANASERV, test x$with_manaserv = xtrue) + AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2dfbfcb7c..d807e9a1c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,6 +33,10 @@ IF (ENABLE_NLS) SET(FLAGS "${FLAGS} -DENABLE_NLS=1") ENDIF() +IF (ENABLE_MANASERV) + SET(FLAGS "${FLAGS} -DMANASERV_SUPPORT=1") +ENDIF() + IF (CMAKE_BUILD_TYPE) STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug OR @@ -111,24 +115,6 @@ MARK_AS_ADVANCED(SDL_INCLUDE_DIR) MARK_AS_ADVANCED(SDL_LIBRARY) SET(SRCS - enet/callbacks.c - enet/callbacks.h - enet/compress.c - enet/enet.h - enet/host.c - enet/list.c - enet/list.h - enet/packet.c - enet/peer.c - enet/protocol.c - enet/protocol.h - enet/time.h - enet/types.h - enet/unix.c - enet/unix.h - enet/utility.h - enet/win32.c - enet/win32.h gui/widgets/avatarlistbox.cpp gui/widgets/avatarlistbox.h gui/widgets/battletab.cpp @@ -635,7 +621,25 @@ SET(SRCS_TMWA net/tmwa/tradehandler.h ) -SET(SRCS_MANAPLUS +SET(SRCS_MANASERV + enet/callbacks.c + enet/callbacks.h + enet/compress.c + enet/enet.h + enet/host.c + enet/list.c + enet/list.h + enet/packet.c + enet/peer.c + enet/protocol.c + enet/protocol.h + enet/time.h + enet/types.h + enet/unix.c + enet/unix.h + enet/utility.h + enet/win32.c + enet/win32.h net/manaserv/attributes.cpp net/manaserv/attributes.h net/manaserv/adminhandler.cpp @@ -689,8 +693,8 @@ SET(SRCS_MANAPLUS ) IF (WIN32) - SET(SRCS_MANAPLUS - ${SRCS_MANAPLUS} + SET(SRCS + ${SRCS} utils/specialfolder.cpp utils/specialfolder.h mana.rc @@ -699,7 +703,11 @@ ENDIF () SET (PROGRAMS manaplus) -ADD_EXECUTABLE(manaplus WIN32 ${SRCS} ${SRCS_MANAPLUS} ${SRCS_TMWA}) +IF (ENABLE_MANASERV) + ADD_EXECUTABLE(manaplus WIN32 ${SRCS} ${SRCS_MANASERV} ${SRCS_TMWA}) +ELSE(ENABLE_MANASERV) + ADD_EXECUTABLE(manaplus WIN32 ${SRCS} ${SRCS_TMWA}) +ENDIF(ENABLE_MANASERV) TARGET_LINK_LIBRARIES(manaplus ${SDLGFX_LIBRARIES} diff --git a/src/Makefile.am b/src/Makefile.am index 29520258b..4ff75d1a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,26 +6,7 @@ manaplus_CXXFLAGS = -DPKG_DATADIR=\""$(pkgdatadir)/"\" \ -DLOCALEDIR=\""$(localedir)"\" \ -Wall -manaplus_SOURCES = enet/callbacks.c \ - enet/compress.c \ - enet/host.c \ - enet/list.c \ - enet/packet.c \ - enet/peer.c \ - enet/protocol.c \ - enet/unix.c \ - enet/win32.c \ - enet/callbacks.h \ - enet/enet.h \ - enet/list.h \ - enet/protocol.h \ - enet/time.h \ - enet/types.h \ - enet/unix.h \ - enet/utility.h \ - enet/win32.h - -manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ +manaplus_SOURCES = gui/widgets/avatarlistbox.cpp \ gui/widgets/avatarlistbox.h \ gui/widgets/battletab.cpp \ gui/widgets/battletab.h \ @@ -482,7 +463,26 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ vector.h \ winver.h -manaplus_SOURCES += \ +if ENABLE_MANASERV +manaplus_CXXFLAGS += -DMANASERV_SUPPORT +manaplus_SOURCES += enet/callbacks.c \ + enet/compress.c \ + enet/host.c \ + enet/list.c \ + enet/packet.c \ + enet/peer.c \ + enet/protocol.c \ + enet/unix.c \ + enet/win32.c \ + enet/callbacks.h \ + enet/enet.h \ + enet/list.h \ + enet/protocol.h \ + enet/time.h \ + enet/types.h \ + enet/unix.h \ + enet/utility.h \ + enet/win32.h \ net/manaserv/attributes.cpp \ net/manaserv/attributes.h \ net/manaserv/adminhandler.cpp \ @@ -533,6 +533,7 @@ manaplus_SOURCES += \ net/manaserv/specialhandler.h \ net/manaserv/tradehandler.cpp \ net/manaserv/tradehandler.h +endif manaplus_SOURCES += \ net/tmwa/gui/guildtab.cpp \ diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index b31bc7ba8..0e6f1d5b8 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -122,8 +122,10 @@ std::string TypeListModel::getElementAt(int elementIndex) { if (elementIndex == 0) return "TmwAthena"; +#ifdef MANASERV_SUPPORT else if (elementIndex == 1) return "ManaServ"; +#endif else return "Unknown"; } diff --git a/src/net/net.cpp b/src/net/net.cpp index 36e414643..862505fdb 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -41,7 +41,9 @@ #include "net/tmwa/generalhandler.h" +#ifdef MANASERV_SUPPORT #include "net/manaserv/generalhandler.h" +#endif Net::AdminHandler *adminHandler = NULL; Net::CharHandler *charHandler = NULL; @@ -157,10 +159,11 @@ void connectToServer(const ServerInfo &server) switch (server.type) { +#ifdef MANASERV_SUPPORT case ServerInfo::MANASERV: new ManaServ::GeneralHandler; break; - +#endif case ServerInfo::TMWATHENA: new TmwAthena::GeneralHandler; break; diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index 113d8a9b2..74d537b80 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -105,9 +105,10 @@ public: // Used for backward compatibility else if (compareStrI(type, "eathena") == 0) return TMWATHENA; +#ifdef MANASERV_SUPPORT else if (compareStrI(type, "manaserv") == 0) return MANASERV; - +#endif return UNKNOWN; } }; diff --git a/toolchain.cmake b/toolchain.cmake index dd2e1a90e..31d4bc6ba 100644 --- a/toolchain.cmake +++ b/toolchain.cmake @@ -19,7 +19,7 @@ SET(SDLMIXER_INCLUDE_DIR ../mana_win/libs/include/SDL) SET(SDLNET_INCLUDE_DIR ../mana_win/libs/include/SDL) SET(SDLTTF_INCLUDE_DIR ../mana_win/libs/include/SDL) SET(SDL_INCLUDE_DIR ../mana_win/libs/include/SDL) - +SET(ENABLE_MANASERV ON) # here is the target environment located SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc /../mana_win/libs ) |