From d6979236a63704882486ed9654e67701ce46f723 Mon Sep 17 00:00:00 2001 From: lotodore Date: Fri, 16 May 2008 18:47:44 +0000 Subject: [PATCH] Trying to fix broken MacOS build. --- pokerth_game.pro | 7 ++++--- pokerth_server.pro | 9 +++++---- src/core/openssl_wrapper.h | 12 ++++++++++-- src/net/common/socket_startup_cmn.cpp | 6 ++++++ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/pokerth_game.pro b/pokerth_game.pro index 6b45ef86..0c1548b0 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -391,10 +391,11 @@ mac{ LIBS += -framework SDL_mixer # standard path for darwinports # make sure you have a universal version of boost - LIBS += /usr/local/lib/libboost_thread-mt-1_34_1.a - LIBS += /usr/local/lib/libboost_filesystem-mt-1_34_1.a + LIBS += /usr/local/lib/libboost_thread-mt-1_35.a + LIBS += /usr/local/lib/libboost_filesystem-mt-1_35.a + LIBS += /usr/local/lib/libboost_iostreams-mt-1_35.a # libraries installed on every mac - LIBS += -lgnutls-openssl -lgcrypt -lz -lcurl -framework Carbon + LIBS += -lcrypto -lz -lcurl -framework Carbon # set the application icon RC_FILE = pokerth.icns LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib diff --git a/pokerth_server.pro b/pokerth_server.pro index 37dbf0f7..615746be 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -227,11 +227,12 @@ mac{ LIBS += -lpokerth_lib # standard path for darwinports # make sure you have a universal version of boost - LIBS += /usr/local/lib/libboost_thread-mt-1_34_1.a - LIBS += /usr/local/lib/libboost_filesystem-mt-1_34_1.a - LIBS += /usr/local/lib/libboost_program_options-mt-1_34_1.a + LIBS += /usr/local/lib/libboost_thread-mt-1_35.a + LIBS += /usr/local/lib/libboost_filesystem-mt-1_35.a + LIBS += /usr/local/lib/libboost_iostreams-mt-1_35.a + LIBS += /usr/local/lib/libboost_program_options-mt-1_35.a # libraries installed on every mac - LIBS += -lgnutls-openssl -lgcrypt -liconv + LIBS += -lcrypto -lz -lcurl -liconv # set the application icon RC_FILE = pokerth.icns LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib diff --git a/src/core/openssl_wrapper.h b/src/core/openssl_wrapper.h index dc1fc5e7..deb6b581 100644 --- a/src/core/openssl_wrapper.h +++ b/src/core/openssl_wrapper.h @@ -16,7 +16,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -/* Wrapper for GnuTLS openssl include. Needed for Windows compatibility. */ +/* Wrapper for GnuTLS openssl include. Needed for Windows/MacOS compatibility. */ #ifndef _OPENSSL_WRAPPER_H_ #define _OPENSSL_WRAPPER_H_ @@ -40,6 +40,14 @@ #undef X509_NAME // Again for Windows - conflict with WinCrypt.h. #endif -#include +#if defined(__APPLE__) || defined(__OpenBSD__) || (defined(__FreeBSD__) + // For BSD-Systems, we assume that OpenSSL is part of the operating system. + #include + #include +#else + // For all other systems, we use GnuTLS. + #include + #define PKTH_USE_GNUTLS +#endif #endif diff --git a/src/net/common/socket_startup_cmn.cpp b/src/net/common/socket_startup_cmn.cpp index 18713a81..3b6129be 100644 --- a/src/net/common/socket_startup_cmn.cpp +++ b/src/net/common/socket_startup_cmn.cpp @@ -20,6 +20,9 @@ #include #include #include + +#ifdef PKTH_USE_GNUTLS + #include #include #include // solve compatibility issues @@ -62,12 +65,15 @@ extern "C" { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; } +#endif // PKTH_USE_GNUTLS bool internal_socket_startup() { +#ifdef PKTH_USE_GNUTLS gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_boost); gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); +#endif return SSL_library_init() == 1; }