From 206db796dcc5bfeba864bf08c06e584ee189b4c6 Mon Sep 17 00:00:00 2001 From: cantor Date: Wed, 30 Jan 2008 04:01:49 +0000 Subject: [PATCH] Override default package for path resolution. Set up a variable for installation prefix to use in path resolution. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2710 cb58f699-b61c-0410-a6fe-9272a202ed29 --- shibsp/Makefile.am | 1 + shibsp/SPConfig.cpp | 6 ++++-- shibsp/base.h | 11 ++++++++--- shibsp/paths.h.in | 5 +++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am index ae4df5b..cb13ffb 100644 --- a/shibsp/Makefile.am +++ b/shibsp/Makefile.am @@ -193,6 +193,7 @@ libshibsp_lite_la_CPPFLAGS = -DSHIBSP_LITE paths.h: ${srcdir}/paths.h.in Makefile ${top_builddir}/config.status rm -f $@.tmp sed < ${srcdir}/$@.in > $@.tmp \ + -e 's:@-PREFIX-@:${prefix}:g' \ -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \ -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \ -e 's:@-XMLTOOLINGXMLDIR-@:${XMLTOOLINGXMLDIR}:g' \ diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp index bba30cb..f2dfe8a 100644 --- a/shibsp/SPConfig.cpp +++ b/shibsp/SPConfig.cpp @@ -61,6 +61,7 @@ #endif #include +#include #include using namespace shibsp; @@ -133,8 +134,9 @@ bool SPInternalConfig::init(const char* catalog_path) log.fatal("failed to initialize XMLTooling library"); return false; } -#endif - +#endif + XMLToolingConfig::getConfig().getPathResolver()->setDefaultPackageName(PACKAGE_NAME); + XMLToolingConfig::getConfig().getPathResolver()->setDefaultPrefix(getenv("SHIBSP_PREFIX") ? getenv("SHIBSP_PREFIX") : SHIBSP_PREFIX); XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine()); XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp"); diff --git a/shibsp/base.h b/shibsp/base.h index 648fce4..6dc2d89 100644 --- a/shibsp/base.h +++ b/shibsp/base.h @@ -71,18 +71,23 @@ /** * Default catalog path on Windows. */ -# define SHIBSP_SCHEMAS "c:\\opt\\shibboleth-sp\\share\\xml\\xmltooling\\catalog.xml;c:\\opt\\shibboleth-sp\\share\\xml\\opensaml\\saml20-catalog.xml;c:\\opt\\shibboleth-sp\\share\\xml\\opensaml\\saml11-catalog.xml;c:\\opt\\shibboleth-sp\\share\\xml\\shibboleth\\catalog.xml" +# define SHIBSP_SCHEMAS "c:/opt/shibboleth-sp/share/xml/xmltooling/catalog.xml;c:/opt/shibboleth-sp/share/xml/opensaml/saml20-catalog.xml;c:/opt/shibboleth-sp/share/xml/opensaml/saml11-catalog.xml;c:/opt/shibboleth-sp/share/xml/shibboleth/catalog.xml" /** * Default path to configuration file on Windows. */ -# define SHIBSP_CONFIG "c:\\opt\\shibboleth-sp\\etc\\shibboleth\\shibboleth2.xml" +# define SHIBSP_CONFIG "c:/opt/shibboleth-sp/etc/shibboleth/shibboleth2.xml" /** * Controls default logging level of console tools and other situations * where fully-configured logging isn't used. */ -#define SHIBSP_LOGGING "c:\\opt\\shibboleth-sp\\etc\\shibboleth\\console.logger" +#define SHIBSP_LOGGING "c:/opt/shibboleth-sp/etc/shibboleth/console.logger" + +/** + * Default prefix for installation (used to resolve relative paths). + */ +#define SHIBSP_PREFIX "c:/opt/shibboleth-sp" #else # include diff --git a/shibsp/paths.h.in b/shibsp/paths.h.in index 0237517..3511b89 100644 --- a/shibsp/paths.h.in +++ b/shibsp/paths.h.in @@ -38,4 +38,9 @@ */ #define SHIBSP_LOGGING "@-PKGSYSCONFDIR-@/console.logger" +/** + * Default prefix for installation (used to resolve relative paths). + */ +#define SHIBSP_PREFIX "@-PREFIX-@" + #endif /* __shibsp_paths_h__ */ -- 2.1.4