enable_debug=$enableval, enable_debug=no)
if test "$enable_debug" = "yes" ; then
- GCC_CFLAGS="$CFLAGS -Wall -g -D_DEBUG"
- GCC_CXXFLAGS="$CXXFLAGS -Wall -g -D_DEBUG"
+ GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
+ GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
else
- GCC_CFLAGS="$CFLAGS -Wall -O2 -DNDEBUG"
- GCC_CXXFLAGS="$CXXFLAGS -Wall -O2 -DNDEBUG"
+ GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
+ GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
fi
AC_PROG_CC([gcc gcc3 cc])
# GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
# GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
# ])
- CFLAGS="$GCC_CFLAGS"
- CXXFLAGS="$GCC_CXXFLAGS"
+ CFLAGS="-Wall $GCC_CFLAGS"
+ CXXFLAGS="-Wall $GCC_CXXFLAGS"
else
# Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
case "${host_cpu}-${host_os}" in
AC_CHECK_FUNCS([pthread_rwlock_init])
-# libcurl settings
-AC_PATH_PROG(CURL_CONFIG,curl-config)
-AC_ARG_WITH(curl,
- AC_HELP_STRING([--with-curl=PATH], [where curl-config is installed]),
- [
- CURL_CONFIG="${with_curl}"
- if ! test -f "${CURL_CONFIG}" ; then
- CURL_CONFIG="${with_curl}/bin/curl-config"
- fi
- ])
-if test -f "${CURL_CONFIG}" ; then
- LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
- CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
-else
- AC_MSG_ERROR([curl-config not found, may need to use --with-curl option])
-fi
-AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
-AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
-AC_MSG_CHECKING([for CURLOPT_SSL_CTX_FUNCTION in curl.h])
-AC_EGREP_HEADER([CURLOPT_SSL_CTX_FUNCTION], [curl/curl.h],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_ERROR([need libcurl that supports CURLOPT_SSL_CTX_FUNCTION])])
-
-
AC_LANG(C++)
# C++ requirements
AC_LANG(C)
+ # libcurl settings
+ AC_PATH_PROG(CURL_CONFIG,curl-config)
+ AC_ARG_WITH(curl,
+ AC_HELP_STRING([--with-curl=PATH], [where curl-config is installed]),
+ [
+ CURL_CONFIG="${with_curl}"
+ if ! test -f "${CURL_CONFIG}" ; then
+ CURL_CONFIG="${with_curl}/bin/curl-config"
+ fi
+ ])
+ if test -f "${CURL_CONFIG}" ; then
+ CPPFLAGS="`${CURL_CONFIG} --cflags`"
+ XMLSEC_LIBS="`${CURL_CONFIG} --libs` $XMLSEC_LIBS"
+ else
+ AC_MSG_ERROR([curl-config not found, may need to use --with-curl option])
+ fi
+
+ # save and append master libs
+ save_LIBS="$LIBS"
+ LIBS="$XMLSEC_LIBS $LIBS"
+
+ AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
+ AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
+ AC_MSG_CHECKING([for CURLOPT_SSL_CTX_FUNCTION in curl.h])
+ AC_EGREP_HEADER([CURLOPT_SSL_CTX_FUNCTION], [curl/curl.h],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_ERROR([need libcurl that supports CURLOPT_SSL_CTX_FUNCTION])])
+
+ # restore master libs
+ LIBS="$save_LIBS"
+
# OpenSSL settings
AC_ARG_WITH(openssl,
AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
#endif
#include <stdexcept>
-#include <curl/curl.h>
#include <log4cpp/Category.hh>
#include <log4cpp/PropertyConfigurator.hh>
#include <log4cpp/OstreamAppender.hh>
#include <xercesc/util/PlatformUtils.hpp>
#ifndef XMLTOOLING_NO_XMLSEC
- #include <xsec/framework/XSECProvider.hpp>
- #include <openssl/err.h>
+# include <curl/curl.h>
+# include <openssl/err.h>
+# include <xsec/framework/XSECProvider.hpp>
#endif
using namespace soap11;
try {
log.debug("library initialization started");
+#ifndef XMLTOOLING_NO_XMLSEC
if (curl_global_init(CURL_GLOBAL_ALL)) {
log.fatal("failed to initialize libcurl, OpenSSL, or Winsock");
return false;
}
log.debug("libcurl %s initialization complete", LIBCURL_VERSION);
+#endif
XMLPlatformUtils::Initialize();
log.debug("Xerces initialization complete");
registerCredentialResolvers();
registerTrustEngines();
registerXMLAlgorithms();
-#endif
registerSOAPTransports();
initSOAPTransports();
+#endif
registerStorageServices();
m_urlEncoder = new URLEncoder();
}
catch (const xercesc::XMLException&) {
log.fatal("caught exception while initializing Xerces");
+#ifndef XMLTOOLING_NO_XMLSEC
curl_global_cleanup();
+#endif
return false;
}
AttributeExtensibleXMLObject::deregisterIDAttributes();
StorageServiceManager.deregisterFactories();
- termSOAPTransports();
- SOAPTransportManager.deregisterFactories();
#ifndef XMLTOOLING_NO_XMLSEC
+ termSOAPTransports();
+ SOAPTransportManager.deregisterFactories();
TrustEngineManager.deregisterFactories();
CredentialResolverManager.deregisterFactories();
KeyInfoResolverManager.deregisterFactories();
m_lock=NULL;
XMLPlatformUtils::Terminate();
+#ifndef XMLTOOLING_NO_XMLSEC
curl_global_cleanup();
-
- #ifdef _DEBUG
+#endif
+#ifdef _DEBUG
xmltooling::NDC ndc("term");
#endif
Category::getInstance(XMLTOOLING_LOGCAT".XMLToolingConfig").info("library shutdown complete");