fix cmake/ACE for freeBSD and Mac OSX
--HG-- branch : trunk
This commit is contained in:
@@ -136,6 +136,11 @@ endif(ACE_FOUND)
|
|||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
SET(OSX_LIBS -lcrypto)
|
||||||
|
add_definitions(-D__ASSERTMACROS__)
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
|
||||||
|
|
||||||
add_definitions(--no-warnings) #to make build look nice, no gcc nazi warnings.
|
add_definitions(--no-warnings) #to make build look nice, no gcc nazi warnings.
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@
|
|||||||
#define PATH_MAX 260
|
#define PATH_MAX 260
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__APPLE_CC__)
|
||||||
|
#define lseek64 lseek
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LIBMPQ_MAJOR_VERSION 0 /* Major version number... maybe sometimes we reach version 1 :) */
|
#define LIBMPQ_MAJOR_VERSION 0 /* Major version number... maybe sometimes we reach version 1 :) */
|
||||||
#define LIBMPQ_MINOR_VERSION 3 /* Minor version number - increased only for small changes */
|
#define LIBMPQ_MINOR_VERSION 3 /* Minor version number - increased only for small changes */
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ ACE_OS::gethostbyaddr_r (const char *addr,
|
|||||||
*h_errnop = h_errno;
|
*h_errnop = h_errno;
|
||||||
return (struct hostent *) 0;
|
return (struct hostent *) 0;
|
||||||
}
|
}
|
||||||
# elif defined (__GLIBC__)
|
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||||
// GNU C library has a different signature
|
// GNU C library has a different signature
|
||||||
ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
|
ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ ACE_OS::gethostbyname_r (const char *name,
|
|||||||
*h_errnop = h_errno;
|
*h_errnop = h_errno;
|
||||||
return (struct hostent *) 0;
|
return (struct hostent *) 0;
|
||||||
}
|
}
|
||||||
# elif defined (__GLIBC__)
|
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||||
// GNU C library has a different signature
|
// GNU C library has a different signature
|
||||||
ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
|
ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
|
||||||
|
|
||||||
@@ -528,7 +528,7 @@ ACE_OS::getprotobyname_r (const char *name,
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
//FUZZ: enable check_for_lack_ACE_OS
|
//FUZZ: enable check_for_lack_ACE_OS
|
||||||
# elif defined (__GLIBC__)
|
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||||
// GNU C library has a different signature
|
// GNU C library has a different signature
|
||||||
//FUZZ: disable check_for_lack_ACE_OS
|
//FUZZ: disable check_for_lack_ACE_OS
|
||||||
if (::getprotobyname_r (name,
|
if (::getprotobyname_r (name,
|
||||||
@@ -609,7 +609,7 @@ ACE_OS::getprotobynumber_r (int proto,
|
|||||||
//FUZZ: enable check_for_lack_ACE_OS
|
//FUZZ: enable check_for_lack_ACE_OS
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
# elif defined (__GLIBC__)
|
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||||
// GNU C library has a different signature
|
// GNU C library has a different signature
|
||||||
//FUZZ: disable check_for_lack_ACE_OS
|
//FUZZ: disable check_for_lack_ACE_OS
|
||||||
if (::getprotobynumber_r (proto,
|
if (::getprotobynumber_r (proto,
|
||||||
@@ -695,7 +695,7 @@ ACE_OS::getservbyname_r (const char *svc,
|
|||||||
//FUZZ: enable check_for_lack_ACE_OS
|
//FUZZ: enable check_for_lack_ACE_OS
|
||||||
else
|
else
|
||||||
return (struct servent *) 0;
|
return (struct servent *) 0;
|
||||||
# elif defined (__GLIBC__)
|
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||||
// GNU C library has a different signature
|
// GNU C library has a different signature
|
||||||
ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA));
|
ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA));
|
||||||
|
|
||||||
|
|||||||
@@ -383,6 +383,10 @@ add_library(trinityscript SHARED ${trinityscript_LIB_SRCS})
|
|||||||
|
|
||||||
add_definitions(-D_TRINITY_SCRIPT_CONFIG='"${CONF_DIR}/trinitycore.conf"')
|
add_definitions(-D_TRINITY_SCRIPT_CONFIG='"${CONF_DIR}/trinitycore.conf"')
|
||||||
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
SET_TARGET_PROPERTIES(trinityscript PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
|
||||||
target_link_libraries(trinityscript)
|
target_link_libraries(trinityscript)
|
||||||
|
|
||||||
set_target_properties(trinityscript PROPERTIES VERSION 4.2.0 SOVERSION 4)
|
set_target_properties(trinityscript PROPERTIES VERSION 4.2.0 SOVERSION 4)
|
||||||
|
|||||||
@@ -60,8 +60,13 @@
|
|||||||
# else
|
# else
|
||||||
# define TRINITY_IMPORT __attribute__ ((cdecl))
|
# define TRINITY_IMPORT __attribute__ ((cdecl))
|
||||||
# endif //__APPLE_CC__ && BIG_ENDIAN
|
# endif //__APPLE_CC__ && BIG_ENDIAN
|
||||||
# define TRINITY_SCRIPT_EXT ".so"
|
# if defined(__APPLE_CC__)
|
||||||
# define TRINITY_SCRIPT_NAME "libtrinityscript"
|
# define TRINITY_SCRIPT_EXT ".dylib"
|
||||||
|
# define TRINITY_SCRIPT_NAME "../lib/libtrinityscript"
|
||||||
|
# else
|
||||||
|
# define TRINITY_SCRIPT_EXT ".so"
|
||||||
|
# define TRINITY_SCRIPT_NAME "libtrinityscript"
|
||||||
|
# endif //__APPLE_CC__
|
||||||
# define TRINITY_PATH_MAX PATH_MAX
|
# define TRINITY_PATH_MAX PATH_MAX
|
||||||
#endif //PLATFORM
|
#endif //PLATFORM
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,23 @@ WorldRunnable.cpp
|
|||||||
WorldRunnable.h
|
WorldRunnable.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SET(trinity-core_LINK_FLAGS "")
|
||||||
|
|
||||||
add_executable(trinity-core ${trinity-core_SRCS})
|
add_executable(trinity-core ${trinity-core_SRCS})
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/trinitycore.conf"'
|
-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/trinitycore.conf"'
|
||||||
)
|
)
|
||||||
IF (DO_MYSQL)
|
IF (DO_MYSQL)
|
||||||
SET_TARGET_PROPERTIES(trinity-core PROPERTIES LINK_FLAGS "-pthread")
|
SET(trinity-core_LINK_FLAGS "-pthread ${trinity-core_LINK_FLAGS}")
|
||||||
ENDIF(DO_MYSQL)
|
ENDIF(DO_MYSQL)
|
||||||
|
|
||||||
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
SET(trinity-core_LINK_FLAGS "-framework Carbon ${trinity-core_LINK_FLAGS}")
|
||||||
|
SET(SCRIPT_LIB "")
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
|
||||||
|
SET_TARGET_PROPERTIES(trinity-core PROPERTIES LINK_FLAGS "${trinity-core_LINK_FLAGS}")
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
trinity-core
|
trinity-core
|
||||||
@@ -42,6 +50,7 @@ ${POSTGRE_LIBS}
|
|||||||
${SSLLIB}
|
${SSLLIB}
|
||||||
${ACE_LIBRARY}
|
${ACE_LIBRARY}
|
||||||
${ZLIB}
|
${ZLIB}
|
||||||
|
${OSX_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS trinity-core DESTINATION bin)
|
install(TARGETS trinity-core DESTINATION bin)
|
||||||
|
|||||||
@@ -9,18 +9,24 @@ RealmList.cpp
|
|||||||
RealmList.h
|
RealmList.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SET(trinity-realm_LINK_FLAGS "")
|
||||||
|
|
||||||
add_executable(trinity-realm ${trinity-realm_SRCS})
|
add_executable(trinity-realm ${trinity-realm_SRCS})
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/trinityrealm.conf"'
|
-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/trinityrealm.conf"'
|
||||||
)
|
)
|
||||||
IF (DO_MYSQL)
|
IF (DO_MYSQL)
|
||||||
#SET_TARGET_PROPERTIES(mangos-realmd PROPERTIES LINK_FLAGS ${MYSQL_LIBS})
|
SET(trinity-realm_LINK_FLAGS "-pthread ${trinity-realm_LINK_FLAGS}")
|
||||||
SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "-pthread")
|
|
||||||
ENDIF(DO_MYSQL)
|
ENDIF(DO_MYSQL)
|
||||||
IF (DO_POSTGRE)
|
IF (DO_POSTGRE)
|
||||||
SET_TARGET_PROPERTIES(trinity-realmd PROPERTIES LINK_FLAGS ${POSTGRE_LIBS})
|
SET(trinity-realm_LINK_FLAGS "${POSTGRE_LIBS} ${trinity-realm_LINK_FLAGS}")
|
||||||
ENDIF(DO_POSTGRE)
|
ENDIF(DO_POSTGRE)
|
||||||
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
SET(trinity-realm_LINK_FLAGS "-framework Carbon ${trinity-realm_LINK_FLAGS}")
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
|
||||||
|
SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "${trinity-realm_LINK_FLAGS}")
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
trinity-realm
|
trinity-realm
|
||||||
@@ -34,11 +40,11 @@ ZThread
|
|||||||
zlib
|
zlib
|
||||||
${SSLLIB}
|
${SSLLIB}
|
||||||
${MYSQL_LIBRARIES}
|
${MYSQL_LIBRARIES}
|
||||||
|
${OSX_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS trinity-realm DESTINATION bin)
|
install(TARGETS trinity-realm DESTINATION bin)
|
||||||
|
|
||||||
|
|
||||||
########### install files ###############
|
########### install files ###############
|
||||||
|
|
||||||
install(FILES trinityrealm.conf.dist DESTINATION etc)
|
install(FILES trinityrealm.conf.dist DESTINATION etc)
|
||||||
|
|||||||
Reference in New Issue
Block a user