Fix broken compilation in mingw32

This commit is contained in:
Eduardo Bart 2012-08-04 12:35:39 -03:00
parent 156ab9b879
commit 521adc308b
8 changed files with 42 additions and 81 deletions

View File

@ -172,7 +172,7 @@ if(WIN32)
endif()
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(Boost COMPONENTS system filesystem thread chrono REQUIRED)
#find lua
if(LUAJIT)
@ -444,7 +444,7 @@ if(FRAMEWORK_XML)
endif()
if(FRAMEWORK_SQL)
find_package(Mysql REQUIRED)
find_package(MySQL REQUIRED)
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIR})
set(framework_LIBRARIES ${framework_LIBRARIES} ${MYSQL_LIBRARY})

View File

@ -0,0 +1,16 @@
# Try to find the mysql library
# MYSQL_FOUND - system has mysql
# MYSQL_INCLUDE_DIR - the mysql include directory
# MYSQL_LIBRARY - the mysql library
FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h PATH_SUFFIXES mysql)
SET(_MYSQL_STATIC_LIBS mysqlclient.a mysqlclient_r.a)
SET(_MYSQL_SHARED_LIBS mysqlclient mysqlclient_r)
IF(USE_STATIC_LIBS)
FIND_LIBRARY(MYSQL_LIBRARY NAMES ${_MYSQL_STATIC_LIBS} ${_MYSQL_SHARED_LIBS})
ELSE()
FIND_LIBRARY(MYSQL_LIBRARY NAMES ${_MYSQL_SHARED_LIBS} ${_MYSQL_STATIC_LIBS})
ENDIF()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQL DEFAULT_MSG MYSQL_LIBRARY MYSQL_INCLUDE_DIR)
MARK_AS_ADVANCED(MYSQL_LIBRARY MYSQL_INCLUDE_DIR)

View File

@ -1,49 +0,0 @@
# - Find mysqlclient
# Find the native MySQL includes and library
#
# MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
# MYSQL_LIBRARIES - List of libraries when using MySQL.
# MYSQL_FOUND - True if MySQL found.
IF (MYSQL_INCLUDE_DIR)
# Already in cache, be silent
SET(MYSQL_FIND_QUIETLY TRUE)
ENDIF (MYSQL_INCLUDE_DIR)
FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h
PATH_SUFFIXES mysql
/usr/local/include/mysql
/usr/include/mysql
)
SET(MYSQL_NAMES mysqlclient mysqlclient_r libmysql.a)
FIND_LIBRARY(MYSQL_LIBRARY
NAMES ${MYSQL_NAMES}
PATHS /usr/lib /usr/local/lib
PATH_SUFFIXES mysql
)
IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND TRUE)
SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND FALSE)
SET( MYSQL_LIBRARIES )
ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
IF (MYSQL_FOUND)
IF (NOT MYSQL_FIND_QUIETLY)
MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
ENDIF (NOT MYSQL_FIND_QUIETLY)
ELSE (MYSQL_FOUND)
IF (MYSQL_FIND_REQUIRED)
MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
ENDIF (MYSQL_FIND_REQUIRED)
ENDIF (MYSQL_FOUND)
MARK_AS_ADVANCED(
MYSQL_LIBRARY
MYSQL_INCLUDE_DIR
)

View File

@ -0,0 +1,21 @@
# Try to find the OpenSSL library
# OPENSSL_FOUND - system has OpenSSL
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARY - the OpenSSL library
FIND_PATH(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h)
SET(_OPENSSL_STATIC_LIBS libssl.a)
SET(_OPENSSL_SHARED_LIBS ssl.dll ssl)
SET(_OPENSSL_CRYPTO_STATIC_LIBS libcrypto.a)
SET(_OPENSSL_CRYPTO_SHARED_LIBS libcrypto.dll crypto)
IF(USE_STATIC_LIBS)
FIND_LIBRARY(OPENSSL_LIBRARY NAMES ${_OPENSSL_STATIC_LIBS} ${_OPENSSL_SHARED_LIBS})
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY NAMES ${_OPENSSL_CRYPTO_STATIC_LIBS} ${_OPENSSL_CRYPTO_SHARED_LIBS})
ELSE()
FIND_LIBRARY(OPENSSL_LIBRARY NAMES ${_OPENSSL_SHARED_LIBS} ${_OPENSSL_STATIC_LIBS})
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY NAMES ${_OPENSSL_CRYPTO_SHARED_LIBS} ${_OPENSSL_CRYPTO_STATIC_LIBS})
ENDIF()
SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENSSL DEFAULT_MSG OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
MARK_AS_ADVANCED(OPENSSL_LIBRARIES OPENSSL_LIBRARY OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)

View File

@ -37,29 +37,4 @@
#error "Sorry, you must enable C++0x to compile."
#endif
// hack to enable std::thread on mingw32 4.6
/*
#if !defined(_GLIBCXX_HAS_GTHREADS) && defined(__GNUG__)
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/condition_variable.hpp>
namespace std {
using boost::thread;
using boost::mutex;
using boost::timed_mutex;
using boost::recursive_mutex;
using boost::recursive_timed_mutex;
using boost::lock_guard;
using boost::unique_lock;
using boost::condition_variable;
using boost::condition_variable_any;
}
#endif
*/
#endif

View File

@ -23,15 +23,12 @@
#ifndef COROUTINE_H
#define COROUTINE_H
#include <thread>
#include <mutex>
#include "thread.h"
#include <functional>
#include <condition_variable>
#include <cassert>
namespace stdext {
//
class coroutine
{
struct codata : public stdext::shared_object {

View File

@ -27,6 +27,7 @@
#include <boost/uuid/uuid.hpp>
#include <boost/functional/hash.hpp>
#include <openssl/rsa.h>
#include <openssl/sha.h>
#include <openssl/md5.h>
#include <openssl/bn.h>

View File

@ -26,7 +26,7 @@
#include "../stdext/types.h"
#include <string>
#include <openssl/rsa.h>
typedef struct rsa_st RSA;
class Crypt
{