Added files and configure option for server monitor; nothing done yet

This commit is contained in:
Pauli Nieminen 2008-01-23 19:48:33 +00:00
parent cb2248e93a
commit de8a7e66c6
4 changed files with 69 additions and 3 deletions

View file

@ -244,6 +244,12 @@ AC_ARG_WITH([server-gid],
[servergid=""])
AC_SUBST([servergid])
AC_ARG_ENABLE([server-monitor],
AS_HELP_STRING([--enable-server-monitor], [enable server monitor thread; libgtop2 is required]),
[servermonitor=$enableval],
[servermonitor=no])
AC_ARG_ENABLE([campaign_server],
AS_HELP_STRING([--enable-campaign-server], [enable compilation of campaign server]),
[campaignserver=$enableval],
@ -314,6 +320,7 @@ AM_CONDITIONAL([STATIC], [test x$static = xyes])
AM_CONDITIONAL([PYTHON_INSTALL], [test x$python_install = xyes])
AM_CONDITIONAL([GAME], [test x$game = xyes])
AM_CONDITIONAL([SERVER], [test x$server = xyes])
AM_CONDITIONAL([SERVER_MONITOR], [test x$servermonitor = xyes])
AM_CONDITIONAL([CAMPAIGNSERVER], [test x$campaignserver = xyes])
AM_CONDITIONAL([TESTS], [test x$tests = xyes])
AM_CONDITIONAL([EDITOR], [test x$editor = xyes])
@ -900,6 +907,17 @@ if test "x$lite" = "xno"; then
fi
fi
#######################################################################
# Check for libgtop2 if server monitor enabled #
#######################################################################
GTOP_LIBS=""
GTOP_CFLAGS=""
if test "x$servermonitor" = "xyes"; then
PKG_CHECK_MODULES([GTOP], [libgtop-2.0 >= 2.10])
fi
#######################################################################
# Check for boost iostreams #
#######################################################################
@ -968,6 +986,7 @@ m4_pattern_allow([^BOOST_AUTO_TEST$])
AM_CONDITIONAL([BOOST_TEST_DYN_LINK], [test x"$boost_test_dyn_link" = xyes])
AM_CONDITIONAL([BOOST_AUTO_TEST], [test x"$boost_auto_test" = xyes])
#######################################################################
# Tune gettext stuff for our needs #
#######################################################################

View file

@ -151,11 +151,12 @@ wesnothd_SOURCES = \
server/player.cpp \
server/proxy.cpp \
server/server.cpp \
server/monitor.cpp \
network.cpp \
network_worker.cpp \
loadscreen_empty.cpp
wesnothd_LDADD = -L. -lwesnoth-core $(BOOST_IOSTREAMS_LIBS) @SDL_NET_LIBS@ @SDL_LIBS@ $(LIBINTL)
wesnothd_LDADD = -L. -lwesnoth-core $(GTOP_LIBS) $(BOOST_IOSTREAMS_LIBS) @SDL_NET_LIBS@ @SDL_LIBS@ $(LIBINTL)
wesnothd_DEPENDENCIES=libwesnoth-core.a
#############################################################################
@ -449,10 +450,11 @@ FORCE:
endif
AM_CXXFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) -DFIFODIR=\"$(fifodir)\"
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) -DFIFODIR=\"$(fifodir)\"\
$(GTOP_CFLAGS)
AM_CFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR)
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) $(GTOP_CFGLAGS)
if PYTHON
AM_CXXFLAGS += @PYTHON_CFLAGS@

25
src/server/monitor.cpp Normal file
View file

@ -0,0 +1,25 @@
/*
Copyright (C) 2008 by Pauli Nieminen <paniemin@cc.hut.fi>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
or at your option any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
//! Here is implementation for server monitoring thread
//! Initial target is to have ti usefull in posix systems
//! and later add support for windows if possible
//! If system doesn't support monitoring it is not compilied
#include "monitor.hpp"
#ifdef SERVER_MONITOR
#else // SERVER_MONITOR
// We need to define monitor hooks anyway as NOP so code will compile
#endif // SERVER_MONITOR

20
src/server/monitor.hpp Normal file
View file

@ -0,0 +1,20 @@
/*
Copyright (C) 2008 by Pauli Nieminen <paniemin@cc.hut.fi>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
or at your option any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#ifndef SERVER_MONITOR_HPP_INCLUDED
#define SERVER_MONITOR_HPP_INCLUDED
#ifdef SERVER_MONITOR
#endif //SERVER_MONITOR
#endif // SERVER_MONITOR_HPP_INCLUDED