From d60c28ca0359efdc382ccc58853f925c97bcd4fd Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 25 Aug 2014 21:49:04 -0700 Subject: Suppress OpenSSL deprecation warnings on OSX --- Makefile.am | 3 +++ configure.ac | 4 ++++ librabbitmq/CMakeLists.txt | 5 +++++ librabbitmq/amqp_openssl.c | 4 ---- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8cd767a..9df689a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,6 +53,9 @@ librabbitmq_librabbitmq_la_SOURCES += \ librabbitmq/amqp_hostcheck.c \ librabbitmq/amqp_hostcheck.h \ librabbitmq/amqp_openssl.c +if OS_APPLE +librabbitmq_librabbitmq_la_CFLAGS += -Wno-deprecated-declarations +endif endif if SSL_POLARSSL diff --git a/configure.ac b/configure.ac index 7692c54..df9338d 100644 --- a/configure.ac +++ b/configure.ac @@ -61,13 +61,17 @@ AC_SUBST([LT_AGE]) # OS setup os_unix=no +os_apple=no os_win32=no AS_CASE([$host], [*-*-mingw*], [os_win32=yes], + [*-apple-darwin*], + [os_apple=yes; os_unix=yes], [*], [os_unix=yes]) AM_CONDITIONAL([OS_UNIX], [test "x$os_unix" = xyes]) +AM_CONDITIONAL([OS_APPLE], [test "x$os_apple" = xyes]) AM_CONDITIONAL([OS_WIN32], [test "x$os_win32" = xyes]) AC_DEFINE([ENABLE_THREAD_SAFETY], [1], [Define to 1 to enable thread safety]) diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt index d3623b3..2c3032e 100644 --- a/librabbitmq/CMakeLists.txt +++ b/librabbitmq/CMakeLists.txt @@ -88,6 +88,11 @@ if (ENABLE_SSL_SUPPORT) ) include_directories(${OPENSSL_INCLUDE_DIR}) set(AMQP_SSL_LIBS ${OPENSSL_LIBRARIES}) + if (APPLE) + # Apple has deprecated OpenSSL in 10.7+. This disables that warning. + set_source_files_properties(${AMQP_SSL_SRCS} + PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) + endif() elseif (SSL_ENGINE STREQUAL "cyaSSL") set(AMQP_SSL_SRCS ${AMQP_SSL_SOCKET_H_PATH} amqp_cyassl.c) diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c index 43018c9..9066d23 100644 --- a/librabbitmq/amqp_openssl.c +++ b/librabbitmq/amqp_openssl.c @@ -25,10 +25,6 @@ #include "config.h" #endif -#if defined(__APPLE__) && defined(__MACH__) -# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6 -#endif - #include "amqp_ssl_socket.h" #include "amqp_socket.h" #include "amqp_hostcheck.h" -- cgit v1.2.1