From 84f06d3cbd786ac660cc8b4d1d7d6aa27f67f9fa Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 23 Jan 2012 20:36:15 +0000 Subject: [PATCH] - bugfix to compile with libircclient 1.6 and beyond --- mk/linux/makedata-source.sh | 16 ++++++------- source/shared_lib/CMakeLists.txt | 24 +++++++++++++++++++ .../sources/platform/posix/ircclient.cpp | 5 ++++ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/mk/linux/makedata-source.sh b/mk/linux/makedata-source.sh index 9bca7958..77507341 100755 --- a/mk/linux/makedata-source.sh +++ b/mk/linux/makedata-source.sh @@ -19,16 +19,16 @@ mkdir -p "$RELEASEDIR" project_parent_dir="$(basename $(readlink -f -- "$(dirname -- "$0")/../../") )" # echo "$project_parent_dir" -if [[ $project_parent_dir == trunk* ]] ; -then - echo 'this is the trunk!' -else - echo '*NOTE: This script currently only works on the trunk, aborting!' - exit -fi +#if [[ $project_parent_dir == trunk* ]] ; +#then +# echo 'this is the trunk!' +#else +# echo '*NOTE: This script currently only works on the trunk, aborting!' +# exit +#fi # copy data -svn export --force "$CURRENTDIR/../../../trunk-data-source" "$RELEASEDIR/data-source/" +svn export --force "$CURRENTDIR/../../../../tags/release-data-source-3.6.0.3" "$RELEASEDIR/data-source/" echo "creating $PACKAGE" [[ -f "$release/$PACKAGE" ]] && rm "release/$PACKAGE" diff --git a/source/shared_lib/CMakeLists.txt b/source/shared_lib/CMakeLists.txt index c6b37971..3700b6d2 100644 --- a/source/shared_lib/CMakeLists.txt +++ b/source/shared_lib/CMakeLists.txt @@ -293,6 +293,30 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER OR BUILD_MEGAGLEST_MAP_EDITOR OR BUILD_MEGAGLEST SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${IRCCLIENT_LIBRARY}) endif() + set(CMAKE_REQUIRED_INCLUDES "${IRCCLIENT_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${IRCCLIENT_LIBRARY}") + check_cxx_source_runs(" + #include + #include + #include + int main() + { + unsigned int high = 0; + unsigned int low = 0; + irc_get_version(&high,&low); + if( (high == 1 && low >= 6) || (high > 1)) { + return 0; + } + throw 1; + }" + HAS_LIBIRCCLIENT_1_6) + + IF(HAS_LIBIRCCLIENT_1_6) + message(STATUS "Found HAS_LIBIRCCLIENT_1_6: ${HAS_LIBIRCCLIENT_1_6}") + ELSE() + ADD_DEFINITIONS(-DLIBIRCCLIENT_PRE1_6) + ENDIF() + IF(WIN32) SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/socket.cpp) SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/ircclient.cpp) diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index b09c972d..764f6236 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -15,6 +15,11 @@ #include "platform_common.h" #include "libircclient.h" +// upstream moved some defines into new headers as of 1.6 +#ifndef LIBIRCCLIENT_PRE1_6 +#include "libirc_rfcnumeric.h" +#endif + #include #include #include