Skip to content

Commit

Permalink
Introducing Hercules Plugin Mananger
Browse files Browse the repository at this point in the history
  • Loading branch information
shennetsind committed May 2, 2013
1 parent 219a4f5 commit a2c45a8
Show file tree
Hide file tree
Showing 50 changed files with 2,664 additions and 1,086 deletions.
6 changes: 6 additions & 0 deletions Hercules-9.sln
Expand Up @@ -8,6 +8,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map-server", "vcproj-9\map-
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapcache", "vcproj-9\mapcache.vcproj", "{D356871D-58E1-450B-967A-E7E9646175AF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin-sample", "vcproj-9\plugin-sample.vcproj", "{D356871D-58E1-450B-967A-E7E9646175AF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand All @@ -30,6 +32,10 @@ Global
{D356871D-58E1-450B-967A-E7E9646175AF}.Debug|Win32.Build.0 = Debug|Win32
{D356871D-58E1-450B-967A-E7E9646175AF}.Release|Win32.ActiveCfg = Release|Win32
{D356871D-58E1-450B-967A-E7E9646175AF}.Release|Win32.Build.0 = Release|Win32
{D356871D-58E1-450B-967A-E6E9646175AF}.Debug|Win32.ActiveCfg = Debug|Win32
{D356871D-58E1-450B-967A-E6E9646175AF}.Debug|Win32.Build.0 = Debug|Win32
{D356871D-58E1-450B-967A-E6E9646175AF}.Release|Win32.ActiveCfg = Release|Win32
{D356871D-58E1-450B-967A-E6E9646175AF}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 17 additions & 0 deletions Makefile.in
Expand Up @@ -18,6 +18,14 @@ else
MAP_SQL_DEPENDS=needs_mysql
endif

WITH_PLUGINS=@WITH_PLUGINS@
ifeq ($(WITH_PLUGINS),yes)
ALL_DEPENDS+=plugins
PLUGIN_DEPENDS=common_sql
else
PLUGIN_DEPENDS=no_plugins
endif


#####################################################################
.PHONY: sql \
Expand All @@ -27,6 +35,7 @@ endif
char_sql \
map_sql \
tools \
plugins \
import \
test \
clean help
Expand Down Expand Up @@ -59,6 +68,9 @@ tools:
test:
@$(MAKE) -C src/test

plugins: $(PLUGIN_DEPENDS)
@$(MAKE) -C src/plugins

import:
# 1) create conf/import folder
# 2) add missing files
Expand All @@ -75,6 +87,7 @@ clean:
@$(MAKE) -C src/login $@
@$(MAKE) -C src/char $@
@$(MAKE) -C src/map $@
@$(MAKE) -C src/plugins $@
@$(MAKE) -C src/tool $@
@$(MAKE) -C src/test $@

Expand Down Expand Up @@ -102,6 +115,10 @@ needs_mysql:
@echo "MySQL not found or disabled by the configure script"
@exit 1

no_plugins:
@echo "Plugins disabled by the configure script"
@exit 1

#####################################################################
# TODO

Expand Down
15 changes: 15 additions & 0 deletions conf/plugins.conf
@@ -0,0 +1,15 @@
//====================================================
//= _ _ _
//= | | | | | |
//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
//=
//= http://hercules.ws/board/
//====================================================
// == http://hercules.ws/board/topic/549-introducing-hercules-plugin-manager/
plugins_list:[
//"sample"
//"other"
]
241 changes: 241 additions & 0 deletions configure
Expand Up @@ -604,6 +604,8 @@ MYSQL_CFLAGS
MYSQL_VERSION
HAVE_MYSQL
MYSQL_CONFIG_HOME
WITH_PLUGINS
SOFLAGS
AR
SET_MAKE
EGREP
Expand Down Expand Up @@ -2127,6 +2129,8 @@ ac_config_files="$ac_config_files 3rdparty/mt19937ar/Makefile 3rdparty/libconfig
ac_config_files="$ac_config_files src/char/Makefile src/login/Makefile"
ac_config_files="$ac_config_files src/plugins/Makefile"
ac_config_files="$ac_config_files src/map/Makefile src/tool/Makefile"
ac_config_files="$ac_config_files src/test/Makefile"
Expand Down Expand Up @@ -4425,6 +4429,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wno-sign-compare"
CPPFLAGS="$CPPFLAGS -I../common"
# flags used for compiling shared objects
SOFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
Expand Down Expand Up @@ -4947,6 +4953,240 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$OLD_CFLAGS"
#
# option for shared objects
#
echo "$as_me:$LINENO: checking how to make shared objects" >&5
echo $ECHO_N "checking how to make shared objects... $ECHO_C" >&6
OLD_CFLAGS="$CFLAGS"
compiler_shared_objects=""
if test "$compiler_supports_pic" = "yes" ; then
my_shared_test_flags="$CFLAGS -fPIC"
fi
# default
CFLAGS="$my_shared_test_flags -shared"
cat >conftest.$ac_ext <<_ACEOF
int bar = 0;
int foo(void)
{
return bar;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
compiler_shared_objects="-shared"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
# BeOS specific
CFLAGS="$my_shared_test_flags -nostart"
cat >conftest.$ac_ext <<_ACEOF
int bar = 0;
int foo(void)
{
return bar;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
compiler_shared_objects="-nostart"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
my_shared_test_flags=""
CFLAGS="$OLD_CFLAGS"
if test "$compiler_supports_shared_objects" = "no" ; then
echo "$as_me:$LINENO: result: not supported" >&5
echo "${ECHO_T}not supported" >&6
{ echo "$as_me:$LINENO: compiler is unable to generate shared objects, disabled plugins (optional)" >&5
echo "$as_me: compiler is unable to generate shared objects, disabled plugins (optional)" >&6;}
WITH_PLUGINS="no"
else
echo "$as_me:$LINENO: result: $compiler_shared_objects" >&5
echo "${ECHO_T}$compiler_shared_objects" >&6
SOFLAGS="$SOFLAGS $compiler_shared_objects"
#
# shared objects need position independent code; some platforms emit
# it always, others need -fPIC
#
echo "$as_me:$LINENO: checking whether $CC needs -fPIC for shared objects" >&5
echo $ECHO_N "checking whether $CC needs -fPIC for shared objects... $ECHO_C" >&6
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $SOFLAGS"
WITH_PLUGINS="yes"
cat >conftest.$ac_ext <<_ACEOF
int bar = 0;
int foo(void)
{
return bar;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
CFLAGS="$OLD_CFLAGS"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
if test "$compiler_supports_pic" = "yes" ; then
# Verify if -shared really fails due to lack of -fPIC or something else
CFLAGS="$CFLAGS -fPIC"
cat >conftest.$ac_ext <<_ACEOF
int bar = 0;
int foo(void)
{
return bar;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
CFLAGS="$OLD_CFLAGS -fPIC"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no, but fails for another reason" >&5
echo "${ECHO_T}no, but fails for another reason" >&6
{ { echo "$as_me:$LINENO: error: compiler is unable to compile shared objects for an unhandled reason, please report this with attached config.log... stopping" >&5
echo "$as_me: error: compiler is unable to compile shared objects for an unhandled reason, please report this with attached config.log... stopping" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
else
# Disable compilation of plugins (optional), so 'make all' does not fail
echo "$as_me:$LINENO: result: yes, but unsupported" >&5
echo "${ECHO_T}yes, but unsupported" >&6
{ echo "$as_me:$LINENO: compiler is unable to generate position independent code, disabled plugins (optional)" >&5
echo "$as_me: compiler is unable to generate position independent code, disabled plugins (optional)" >&6;}
WITH_PLUGINS="no"
fi
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
#
# -O2 implies -fstrict-aliasing, but the code is not safe for that
Expand Down Expand Up @@ -6754,6 +6994,7 @@ do
"src/char/Makefile") CONFIG_FILES="$CONFIG_FILES src/char/Makefile" ;;
"src/login/Makefile") CONFIG_FILES="$CONFIG_FILES src/login/Makefile" ;;
"src/map/Makefile") CONFIG_FILES="$CONFIG_FILES src/map/Makefile" ;;
"src/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/Makefile" ;;
"src/tool/Makefile") CONFIG_FILES="$CONFIG_FILES src/tool/Makefile" ;;
"src/test/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;;
Expand Down

0 comments on commit a2c45a8

Please sign in to comment.