Merge pull request #86 from vcrhonek/ssl-thread-safe

Fix SSL library usage is not thread safe
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb616a6..d1fda33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -378,6 +378,10 @@
   SET(HAVE_ALLOCA 0)
   SET(C_ALLOCA 0)
   CHECK_INCLUDE_FILE( "alloca.h" HAVE_ALLOCA_H )
+ELSE (NOT HAVE_ALLOCA)
+  SET(HAVE_ALLOCA 1)
+  SET(C_ALLOCA 1)
+  SET(HAVE_ALLOCA_H 0)
 ENDIF (NOT HAVE_ALLOCA)
 
 #
diff --git a/autoconfiscate.sh b/autoconfiscate.sh
index 254ccf5..3c09572 100755
--- a/autoconfiscate.sh
+++ b/autoconfiscate.sh
@@ -1,8 +1,18 @@
-#!/bin/sh 
+#!/bin/sh
 
-echo "*** Autoconf/automake is deprecated for Openwsman"
-echo "*** and might not fully work."
-echo "*** Use cmake instead !"
+cat <<EOS >&2
+*** Autoconf/automake is deprecated for Openwsman and might not fully work.
+*** Please use CMake instead!
+*** Pull requests welcome ;-)
+EOS
+
+if [ "$1" != "--ignore-deprecation-warning" ]; then
+  cat <<EOS >&2
+*** To ignore this warning and proceed regardless, re-run as follows:
+***   $0 --ignore-deprecation-warning
+EOS
+  exit 1
+fi
 
 UNAME=`uname`
 
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 59f60aa..e27b70e 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -12,7 +12,7 @@
 
 add_subdirectory(tests)
 
-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" OUTPUT_VARIABLE PYTHON_LIB_DIR)
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))" OUTPUT_VARIABLE PYTHON_LIB_DIR)
 STRING(REPLACE "\n" "" PYTHON_LIB_DIR "${PYTHON_LIB_DIR}")
 
 MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}")
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index d625c47..2e23b27 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -53,6 +53,9 @@
 SET( wsman_curl_client_transport_SOURCES wsman-client-transport.c wsman-curl-client-transport.c )
 ADD_LIBRARY( ${WSMAN_CLIENT_TRANSPORT_PKG} SHARED ${wsman_curl_client_transport_SOURCES} )
 TARGET_LINK_LIBRARIES( ${WSMAN_CLIENT_TRANSPORT_PKG} ${CURL_LIBRARIES} )
+IF( ENABLE_EVENTING_SUPPORT )
+TARGET_LINK_LIBRARIES( ${WSMAN_CLIENT_TRANSPORT_PKG} ${OPENSSL_LIBRARIES} )
+ENDIF( ENABLE_EVENTING_SUPPORT )
 SET_TARGET_PROPERTIES( ${WSMAN_CLIENT_TRANSPORT_PKG} PROPERTIES VERSION 1.0.0 SOVERSION 1)
 INSTALL(TARGETS ${WSMAN_CLIENT_TRANSPORT_PKG} DESTINATION ${LIB_INSTALL_DIR})
 
diff --git a/src/lib/wsman-curl-client-transport.c b/src/lib/wsman-curl-client-transport.c
index d58fd72..cd7f517 100644
--- a/src/lib/wsman-curl-client-transport.c
+++ b/src/lib/wsman-curl-client-transport.c
@@ -46,8 +46,10 @@
 #include <curl/curl.h>
 #include <curl/easy.h>
 
+#ifdef ENABLE_EVENTING_SUPPORT
 #include <openssl/opensslv.h>
 #include <openssl/ssl.h>
+#endif
 
 #include "u/libu.h"
 #include "wsman-types.h"