summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3rdparty/cmake/FindMYSQL.cmake2
-rw-r--r--3rdparty/cmake/FindPCRE.cmake5
-rw-r--r--CMakeLists.txt41
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/common/socket.c3
5 files changed, 46 insertions, 7 deletions
diff --git a/3rdparty/cmake/FindMYSQL.cmake b/3rdparty/cmake/FindMYSQL.cmake
index 0a07f3612..c18e8d637 100644
--- a/3rdparty/cmake/FindMYSQL.cmake
+++ b/3rdparty/cmake/FindMYSQL.cmake
@@ -10,6 +10,7 @@ find_path( MYSQL_INCLUDE_DIRS "mysql.h"
PATHS
"/usr/include/mysql"
"/usr/local/include/mysql"
+ "/usr/mysql/include/mysql"
"$ENV{PROGRAMFILES}/MySQL/*/include"
"$ENV{SYSTEMDRIVE}/MySQL/*/include" )
@@ -18,6 +19,7 @@ find_library( MYSQL_LIBRARIES
PATHS
"/usr/lib/mysql"
"/usr/local/lib/mysql"
+ "/usr/mysql/lib/mysql"
"$ENV{PROGRAMFILES}/MySQL/*/lib"
"$ENV{SYSTEMDRIVE}/MySQL/*/lib" )
mark_as_advanced( MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS )
diff --git a/3rdparty/cmake/FindPCRE.cmake b/3rdparty/cmake/FindPCRE.cmake
index cb4d9177b..2215451d1 100644
--- a/3rdparty/cmake/FindPCRE.cmake
+++ b/3rdparty/cmake/FindPCRE.cmake
@@ -6,8 +6,9 @@
# PCRE_FOUND - True if pcre found.
-find_path( PCRE_INCLUDE_DIR pcre.h )
-
+find_path( PCRE_INCLUDE_DIR pcre.h
+ PATHS
+ "/usr/include/pcre" )
set( PCRE_NAMES pcre )
find_library( PCRE_LIBRARY NAMES ${PCRE_NAMES} )
mark_as_advanced( PCRE_LIBRARY PCRE_INCLUDE_DIR )
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b6d3ebc6..41752f489 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,11 +40,12 @@ elseif( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" )
message( FATAL_ERROR
"Do not use the source directory to build your files, instead delete CMakeCache.txt, create a separate folder and build there.\n"
"Example: (build in subdir 'build' and install to source dir)\n"
+ " rm -f CMakeCache.txt\n"
" mkdir build && cd build\n"
- " cmake -G\"Unix Makefiles\" -DINSTALL_TO_SOURCE:bool=ON ..\n"
+ " cmake -G\"Unix Makefiles\" -DINSTALL_TO_SOURCE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\n"
" make install\n"
" cd .. && rm -rf build\n"
- "To skip this check, set ALLOW_SAME_DIRECTORY to ON (-DALLOW_SAME_DIRECTORY:bool=ON)" )
+ "To skip this check, set ALLOW_SAME_DIRECTORY to ON (-DALLOW_SAME_DIRECTORY=ON)" )
endif()
@@ -96,17 +97,23 @@ endif()
# SVNVERSION
#
if( SVNVERSION_EXECUTABLE )
+ message( STATUS "Getting svn version" )
execute_process( COMMAND ${SVNVERSION_EXECUTABLE} ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE SVNVERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
string( REGEX REPLACE "[^1234567890MSexported]" "_" SVNVERSION ${SVNVERSION} )
+ message( STATUS "Found version: ${SVNVERSION}" )
+ message( STATUS "Getting svn version - done" )
endif()
if( Subversion_FOUND AND SVNVERSION )
+ message( STATUS "Getting svn branch" )
Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} eAthena )
if( eAthena_WC_URL )
string( REGEX MATCH "[^/]+$" BRANCH ${eAthena_WC_URL} )
set( SVNVERSION "${BRANCH}-${SVNVERSION}" )
+ message( STATUS "Found branch: ${BRANCH}" )
endif()
+ message( STATUS "Getting svn branch - done" )
endif()
@@ -115,15 +122,19 @@ endif()
#
add_subdirectory( 3rdparty )
include( FindFunctionLibrary )
+include( CheckIncludeFile )
#
-# math library (FreeBSD/Linux)
+# math library (FreeBSD/Linux/Solaris)
#
message( STATUS "Detecting m library (math)" )
+CHECK_INCLUDE_FILE( math.h HAVE_MATH_H )
+if( NOT HAVE_MATH_H )
+ message( FATAL_ERROR "math.h not found" )
+endif()
set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} )
find_function_library( floor FUNCTION_FLOOR_LIBRARIES m )
-mark_as_advanced( FUNCTION_FLOOR_LIBRARIES )
if( FUNCTION_FLOOR_LIBRARIES )
message( STATUS "Adding global library: ${FUNCTION_FLOOR_LIBRARIES}" )
list( APPEND GLOBAL_LIBRARIES ${FUNCTION_FLOOR_LIBRARIES} )
@@ -138,7 +149,6 @@ if( NOT WIN32 )
message( STATUS "Detecting dl library (dynamic loading)" )
set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} )
find_function_library( dlopen FUNCTION_DLOPEN_LIBRARIES dl )
-mark_as_advanced( FUNCTION_DLOPEN_LIBRARIES )
if( FUNCTION_DLOPEN_LIBRARIES )
message( STATUS "Adding global library: ${FUNCTION_DLOPEN_LIBRARIES}" )
list( APPEND GLOBAL_LIBRARIES ${FUNCTION_DLOPEN_LIBRARIES} )
@@ -147,6 +157,27 @@ message( STATUS "Detecting dl library (dynamic loading) - done" )
endif()
+#
+# socket/nsl library (Solaris)
+#
+if( NOT WIN32 )
+message( STATUS "Detecting socket/nsl library (networking)" )
+set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} )
+find_function_library( bind FUNCTION_BIND_LIBRARIES socket )
+if( FUNCTION_BIND_LIBRARIES )
+ message( STATUS "Adding global library: ${FUNCTION_BIND_LIBRARIES}" )
+ list( APPEND GLOBAL_LIBRARIES ${FUNCTION_BIND_LIBRARIES} )
+endif()
+set( CMAKE_REQUIRED_LIBRARIES ${GLOBAL_LIBRARIES} )
+find_function_library( gethostbyname FUNCTION_GETHOSTBYNAME_LIBRARIES nsl )
+if( FUNCTION_GETHOSTBYNAME_LIBRARIES )
+ message( STATUS "Adding global library: ${FUNCTION_GETHOSTBYNAME_LIBRARIES}" )
+ list( APPEND GLOBAL_LIBRARIES ${FUNCTION_GETHOSTBYNAME_LIBRARIES} )
+endif()
+message( STATUS "Detecting socket/nsl library (networking) - done" )
+endif()
+
+
#####################################################################
# package stuff
#
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 24de77fcb..14ec4601f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -2,6 +2,8 @@ Date Added
2011/07/12
* CMake: set project language to C, added module FindFunctionLibrary, added search for dl library. (tested with debian-wheezy-i386) [FlavioJS]
+ * CMake: added search for math.h, added search for socket/nsl library. (tested with Solaris-201011-x86)
+ * Added missing include to socket.c.
2011/07/11
* Rev. 14901 Added bonus3 bAddClassDropItem, care of Epoque. [L0ne_W0lf]
2011/07/10
diff --git a/src/common/socket.c b/src/common/socket.c
index 81ea19468..84cbaf1ea 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -32,6 +32,9 @@
#ifndef SIOCGIFCONF
#include <sys/sockio.h> // SIOCGIFCONF on Solaris, maybe others? [Shinomori]
#endif
+ #ifndef FIONBIO
+ #include <sys/filio.h> // FIONBIO on Solaris [FlavioJS]
+ #endif
#ifdef HAVE_SETRLIMIT
#include <sys/resource.h>