projects
/
shibboleth
/
cpp-xmltooling.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cdc547f
)
Cleaned up source for dual build
author
Scott Cantor
<cantor.2@osu.edu>
Thu, 17 May 2007 03:20:27 +0000
(
03:20
+0000)
committer
Scott Cantor
<cantor.2@osu.edu>
Thu, 17 May 2007 03:20:27 +0000
(
03:20
+0000)
configure.ac
patch
|
blob
|
history
xmltooling/Makefile.am
patch
|
blob
|
history
xmltooling/XMLToolingConfig.cpp
patch
|
blob
|
history
xmltooling/XMLToolingConfig.h
patch
|
blob
|
history
xmltooling/base.h
patch
|
blob
|
history
xmltooling/impl/UnknownElement.cpp
patch
|
blob
|
history
xmltooling/soap/impl/CURLSOAPTransport.cpp
patch
|
blob
|
history
xmltooling/util/TemplateEngine.cpp
patch
|
blob
|
history
xmltoolingtest/Makefile.am
patch
|
blob
|
history
diff --git
a/configure.ac
b/configure.ac
index
fe8c241
..
39563a8
100644
(file)
--- a/
configure.ac
+++ b/
configure.ac
@@
-175,8
+175,8
@@
AC_ARG_WITH(xmlsec,
if test x_$with_xmlsec != x_no; then
if test x_$with_xmlsec != x_/usr; then
if test x_$with_xmlsec != x_no; then
if test x_$with_xmlsec != x_/usr; then
- CPPFLAGS="-I${with_xmlsec}/include"
- LDFLAGS="-L${with_xmlsec}/lib"
+ CPPFLAGS="-I${with_xmlsec}/include
$CPPFLAGS
"
+ LDFLAGS="-L${with_xmlsec}/lib
$LDFLAGS
"
fi
XMLSEC_LIBS="-lxml-security-c"
fi
XMLSEC_LIBS="-lxml-security-c"
diff --git
a/xmltooling/Makefile.am
b/xmltooling/Makefile.am
index
07d52d8
..
b8f756b
100644
(file)
--- a/
xmltooling/Makefile.am
+++ b/
xmltooling/Makefile.am
@@
-1,9
+1,9
@@
AUTOMAKE_OPTIONS = foreign
if BUILD_XMLSEC
AUTOMAKE_OPTIONS = foreign
if BUILD_XMLSEC
-lib_LTLIBRARIES = libxmltooling-lite.la
-else
lib_LTLIBRARIES = libxmltooling-lite.la libxmltooling.la
lib_LTLIBRARIES = libxmltooling-lite.la libxmltooling.la
+else
+lib_LTLIBRARIES = libxmltooling-lite.la
endif
libxmltoolingincludedir = $(includedir)/xmltooling
endif
libxmltoolingincludedir = $(includedir)/xmltooling
@@
-172,23
+172,19
@@
common_sources = \
util/URLEncoder.cpp \
util/XMLConstants.cpp \
util/XMLHelper.cpp \
util/URLEncoder.cpp \
util/XMLConstants.cpp \
util/XMLHelper.cpp \
- validation/ValidatorSuite.cpp \
- ${xmlsec_sources} \
+ validation/ValidatorSuite.cpp \
$(thread_sources)
libxmltooling_lite_la_SOURCES = \
${common_sources}
$(thread_sources)
libxmltooling_lite_la_SOURCES = \
${common_sources}
-
+libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
libxmltooling_lite_la_LDFLAGS = -version-info 1:0:0
if BUILD_XMLSEC
libxmltooling_lite_la_LDFLAGS = -version-info 1:0:0
if BUILD_XMLSEC
-libxmltooling_la_CPPFLAGS = "$(CPPFLAGS) $(XMLSEC_CPPFLAGS)"
-libxmltooling_la_LDFLAGS = "$(LDFLAGS) $(XMLSEC_LDFLAGS) $(XMLSEC_LIBS)"
+libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
libxmltooling_la_SOURCES = \
${common_sources} \
libxmltooling_la_SOURCES = \
${common_sources} \
- ${xmlsec_sources} \
- $(thread_sources)
-libxmltooling_la_LDFLAGS = -version-info 1:0:0
+ ${xmlsec_sources}
endif
install-exec-hook:
endif
install-exec-hook:
diff --git
a/xmltooling/XMLToolingConfig.cpp
b/xmltooling/XMLToolingConfig.cpp
index
f1e929e
..
468a29c
100644
(file)
--- a/
xmltooling/XMLToolingConfig.cpp
+++ b/
xmltooling/XMLToolingConfig.cpp
@@
-23,6
+23,7
@@
#include "internal.h"
#include "exceptions.h"
#include "XMLToolingConfig.h"
#include "internal.h"
#include "exceptions.h"
#include "XMLToolingConfig.h"
+#include "encryption/Encryption.h"
#include "encryption/Encrypter.h"
#include "impl/UnknownElement.h"
#include "security/TrustEngine.h"
#include "encryption/Encrypter.h"
#include "impl/UnknownElement.h"
#include "security/TrustEngine.h"
@@
-80,6
+81,7
@@
DECL_XMLTOOLING_EXCEPTION_FACTORY(IOException,xmltooling);
namespace xmltooling {
static XMLToolingInternalConfig g_config;
namespace xmltooling {
static XMLToolingInternalConfig g_config;
+#ifndef XMLTOOLING_NO_XMLSEC
static vector<Mutex*> g_openssl_locks;
extern "C" void openssl_locking_callback(int mode,int n,const char *file,int line)
static vector<Mutex*> g_openssl_locks;
extern "C" void openssl_locking_callback(int mode,int n,const char *file,int line)
@@
-90,12
+92,13
@@
namespace xmltooling {
g_openssl_locks[n]->unlock();
}
g_openssl_locks[n]->unlock();
}
-
#
ifndef WIN32
+
#
ifndef WIN32
extern "C" unsigned long openssl_thread_id(void)
{
return (unsigned long)(pthread_self());
}
extern "C" unsigned long openssl_thread_id(void)
{
return (unsigned long)(pthread_self());
}
- #endif
+# endif
+#endif
}
XMLToolingConfig& XMLToolingConfig::getConfig()
}
XMLToolingConfig& XMLToolingConfig::getConfig()
@@
-260,7
+263,9
@@
bool XMLToolingInternalConfig::init()
registerStorageServices();
m_urlEncoder = new URLEncoder();
registerStorageServices();
m_urlEncoder = new URLEncoder();
+#ifndef XMLTOOLING_NO_XMLSEC
m_keyInfoResolver = KeyInfoResolverManager.newPlugin(INLINE_KEYINFO_RESOLVER,NULL);
m_keyInfoResolver = KeyInfoResolverManager.newPlugin(INLINE_KEYINFO_RESOLVER,NULL);
+#endif
// Register xml:id as an ID attribute.
static const XMLCh xmlid[] = UNICODE_LITERAL_2(i,d);
// Register xml:id as an ID attribute.
static const XMLCh xmlid[] = UNICODE_LITERAL_2(i,d);
@@
-272,12
+277,14
@@
bool XMLToolingInternalConfig::init()
return false;
}
return false;
}
+#ifndef XMLTOOLING_NO_XMLSEC
// Set up OpenSSL locking.
for (int i=0; i<CRYPTO_num_locks(); i++)
g_openssl_locks.push_back(Mutex::create());
CRYPTO_set_locking_callback(openssl_locking_callback);
// Set up OpenSSL locking.
for (int i=0; i<CRYPTO_num_locks(); i++)
g_openssl_locks.push_back(Mutex::create());
CRYPTO_set_locking_callback(openssl_locking_callback);
-#ifndef WIN32
+#
ifndef WIN32
CRYPTO_set_id_callback(openssl_thread_id);
CRYPTO_set_id_callback(openssl_thread_id);
+# endif
#endif
log.info("library initialization complete");
#endif
log.info("library initialization complete");
@@
-286,9
+293,11
@@
bool XMLToolingInternalConfig::init()
void XMLToolingInternalConfig::term()
{
void XMLToolingInternalConfig::term()
{
+#ifndef XMLTOOLING_NO_XMLSEC
CRYPTO_set_locking_callback(NULL);
for_each(g_openssl_locks.begin(), g_openssl_locks.end(), xmltooling::cleanup<Mutex>());
g_openssl_locks.clear();
CRYPTO_set_locking_callback(NULL);
for_each(g_openssl_locks.begin(), g_openssl_locks.end(), xmltooling::cleanup<Mutex>());
g_openssl_locks.clear();
+#endif
SchemaValidators.destroyValidators();
XMLObjectBuilder::destroyBuilders();
SchemaValidators.destroyValidators();
XMLObjectBuilder::destroyBuilders();
@@
-298,15
+307,16
@@
void XMLToolingInternalConfig::term()
StorageServiceManager.deregisterFactories();
termSOAPTransports();
SOAPTransportManager.deregisterFactories();
StorageServiceManager.deregisterFactories();
termSOAPTransports();
SOAPTransportManager.deregisterFactories();
+
#ifndef XMLTOOLING_NO_XMLSEC
TrustEngineManager.deregisterFactories();
CredentialResolverManager.deregisterFactories();
KeyInfoResolverManager.deregisterFactories();
m_algorithmMap.clear();
#ifndef XMLTOOLING_NO_XMLSEC
TrustEngineManager.deregisterFactories();
CredentialResolverManager.deregisterFactories();
KeyInfoResolverManager.deregisterFactories();
m_algorithmMap.clear();
-#endif
delete m_keyInfoResolver;
m_keyInfoResolver = NULL;
delete m_keyInfoResolver;
m_keyInfoResolver = NULL;
+#endif
delete m_replayCache;
m_replayCache = NULL;
delete m_replayCache;
m_replayCache = NULL;
diff --git
a/xmltooling/XMLToolingConfig.h
b/xmltooling/XMLToolingConfig.h
index
f9f1946
..
1cbb650
100644
(file)
--- a/
xmltooling/XMLToolingConfig.h
+++ b/
xmltooling/XMLToolingConfig.h
@@
-60,10
+60,14
@@
namespace xmltooling {
{
MAKE_NONCOPYABLE(XMLToolingConfig);
protected:
{
MAKE_NONCOPYABLE(XMLToolingConfig);
protected:
+#ifndef XMLTOOLING_NO_XMLSEC
XMLToolingConfig() : m_keyInfoResolver(NULL), m_replayCache(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {}
XMLToolingConfig() : m_keyInfoResolver(NULL), m_replayCache(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {}
-
+
/** Global KeyInfoResolver instance. */
KeyInfoResolver* m_keyInfoResolver;
/** Global KeyInfoResolver instance. */
KeyInfoResolver* m_keyInfoResolver;
+#else
+ XMLToolingConfig() : m_replayCache(NULL), m_templateEngine(NULL), m_urlEncoder(NULL), clock_skew_secs(180) {}
+#endif
/** Global ReplayCache instance. */
ReplayCache* m_replayCache;
/** Global ReplayCache instance. */
ReplayCache* m_replayCache;
@@
-146,6
+150,7
@@
namespace xmltooling {
*/
virtual ParserPool& getValidatingParser() const=0;
*/
virtual ParserPool& getValidatingParser() const=0;
+#ifndef XMLTOOLING_NO_XMLSEC
/**
* Sets the global KeyInfoResolver instance.
* This method must be externally synchronized with any code that uses the object.
/**
* Sets the global KeyInfoResolver instance.
* This method must be externally synchronized with any code that uses the object.
@@
-163,6
+168,7
@@
namespace xmltooling {
const KeyInfoResolver* getKeyInfoResolver() const {
return m_keyInfoResolver;
}
const KeyInfoResolver* getKeyInfoResolver() const {
return m_keyInfoResolver;
}
+#endif
/**
* Sets the global ReplayCache instance.
/**
* Sets the global ReplayCache instance.
diff --git
a/xmltooling/base.h
b/xmltooling/base.h
index
cb13d98
..
237f798
100644
(file)
--- a/
xmltooling/base.h
+++ b/
xmltooling/base.h
@@
-30,6
+30,10
@@
#include <xmltooling/config_pub.h>
#endif
#include <xmltooling/config_pub.h>
#endif
+#ifdef XMLTOOLING_LITE
+# define XMLTOOLING_NO_XMLSEC 1
+#endif
+
// Windows and GCC4 Symbol Visibility Macros
#ifdef WIN32
#define XMLTOOL_IMPORT __declspec(dllimport)
// Windows and GCC4 Symbol Visibility Macros
#ifdef WIN32
#define XMLTOOL_IMPORT __declspec(dllimport)
diff --git
a/xmltooling/impl/UnknownElement.cpp
b/xmltooling/impl/UnknownElement.cpp
index
83ba6b8
..
5a6c2c9
100644
(file)
--- a/
xmltooling/impl/UnknownElement.cpp
+++ b/
xmltooling/impl/UnknownElement.cpp
@@
-34,7
+34,9
@@
using namespace xmltooling;
using namespace log4cpp;
using namespace std;
using namespace xmltooling;
using namespace log4cpp;
using namespace std;
+#ifndef XMLTOOLING_NO_XMLSEC
using xmlsignature::Signature;
using xmlsignature::Signature;
+#endif
void UnknownElementImpl::releaseDOM() const
{
void UnknownElementImpl::releaseDOM() const
{
diff --git
a/xmltooling/soap/impl/CURLSOAPTransport.cpp
b/xmltooling/soap/impl/CURLSOAPTransport.cpp
index
796b313
..
6f599f4
100644
(file)
--- a/
xmltooling/soap/impl/CURLSOAPTransport.cpp
+++ b/
xmltooling/soap/impl/CURLSOAPTransport.cpp
@@
-412,7
+412,11
@@
void CURLSOAPTransport::send(istream& in)
// Set request headers.
curl_easy_setopt(m_handle,CURLOPT_HTTPHEADER,m_headers);
// Set request headers.
curl_easy_setopt(m_handle,CURLOPT_HTTPHEADER,m_headers);
+#ifndef XMLTOOLING_NO_XMLSEC
if (m_ssl_callback || m_cred || m_trustEngine) {
if (m_ssl_callback || m_cred || m_trustEngine) {
+#else
+ if (m_ssl_callback) {
+#endif
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_FUNCTION,xml_ssl_ctx_callback);
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_DATA,this);
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_FUNCTION,xml_ssl_ctx_callback);
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_DATA,this);
diff --git
a/xmltooling/util/TemplateEngine.cpp
b/xmltooling/util/TemplateEngine.cpp
index
510a8f1
..
c9f44b8
100644
(file)
--- a/
xmltooling/util/TemplateEngine.cpp
+++ b/
xmltooling/util/TemplateEngine.cpp
@@
-23,8
+23,6
@@
#include "internal.h"
#include "util/TemplateEngine.h"
#include "internal.h"
#include "util/TemplateEngine.h"
-#include <ctime>
-
using namespace xmltooling;
using namespace std;
using namespace xmltooling;
using namespace std;
@@
-86,15
+84,6
@@
void TemplateEngine::process(
const XMLToolingException* e
) const
{
const XMLToolingException* e
) const
{
- // Create a timestamp
- time_t now = time(NULL);
-#ifdef HAVE_CTIME_R
- char nowbuf[32];
- ctime_r(&now);
-#else
- const char* nowbuf = ctime(&now);
-#endif
-
const char* line = buf.c_str();
const char* thispos;
const char* line = buf.c_str();
const char* thispos;
diff --git
a/xmltoolingtest/Makefile.am
b/xmltoolingtest/Makefile.am
index
6705fd9
..
ea120ed
100644
(file)
--- a/
xmltoolingtest/Makefile.am
+++ b/
xmltoolingtest/Makefile.am
@@
-1,10
+1,20
@@
AUTOMAKE_OPTIONS = foreign
if BUILD_UNITTEST
AUTOMAKE_OPTIONS = foreign
if BUILD_UNITTEST
+
bin_PROGRAMS = xmltoolingtest
bin_PROGRAMS = xmltoolingtest
-xmltoolingtest_CXXFLAGS = $(CXXFLAGS) $(CXXTESTFLAGS)
+xmltoolingtest_CXXFLAGS = $(CXXTESTFLAGS)
+if BUILD_XMLSEC
+xmltoolingtest_LDFLAGS = $(XMLSEC_LIBS)
+xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling.la
+else
+xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling-lite.la
+endif
+
else
else
+
bin_PROGRAMS =
bin_PROGRAMS =
+
endif
if BUILD_XMLSEC
endif
if BUILD_XMLSEC
@@
-45,10
+55,4
@@
do-cxxtestgen:
$(nodist_xmltoolingtest_SOURCES): %.cpp: %.h
$(MAKE) do-cxxtestgen HFILE=$< CPPFILE=$@
$(nodist_xmltoolingtest_SOURCES): %.cpp: %.h
$(MAKE) do-cxxtestgen HFILE=$< CPPFILE=$@
-if BUILD_XMLSEC
-xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling.la
-else
-xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling-lite.la
-endif
-
EXTRA_DIST = xmltoolingtest.vcproj $(xmltoolingtest_h) data
EXTRA_DIST = xmltoolingtest.vcproj $(xmltoolingtest_h) data