Override default package for path resolution.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Wed, 30 Jan 2008 04:01:49 +0000 (04:01 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Wed, 30 Jan 2008 04:01:49 +0000 (04:01 +0000)
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
shibsp/SPConfig.cpp
shibsp/base.h
shibsp/paths.h.in

index ae4df5b..cb13ffb 100644 (file)
@@ -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 \
 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' \
            -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
            -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
            -e 's:@-XMLTOOLINGXMLDIR-@:${XMLTOOLINGXMLDIR}:g' \
index bba30cb..f2dfe8a 100644 (file)
@@ -61,6 +61,7 @@
 #endif
 
 #include <xmltooling/util/NDC.h>
 #endif
 
 #include <xmltooling/util/NDC.h>
+#include <xmltooling/util/PathResolver.h>
 #include <xmltooling/util/TemplateEngine.h>
 
 using namespace shibsp;
 #include <xmltooling/util/TemplateEngine.h>
 
 using namespace shibsp;
@@ -133,8 +134,9 @@ bool SPInternalConfig::init(const char* catalog_path)
         log.fatal("failed to initialize XMLTooling library");
         return false;
     }
         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");
     
     XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
     XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
     
index 648fce4..6dc2d89 100644 (file)
 /**
  * Default catalog path on Windows.
  */
 /**
  * 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.
  */
 
 /**
  * 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.
  */
 
 /**
  * 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 <shibsp/paths.h>
 
 #else
 # include <shibsp/paths.h>
index 0237517..3511b89 100644 (file)
@@ -38,4 +38,9 @@
  */\r
 #define SHIBSP_LOGGING "@-PKGSYSCONFDIR-@/console.logger"\r
 \r
  */\r
 #define SHIBSP_LOGGING "@-PKGSYSCONFDIR-@/console.logger"\r
 \r
+/**\r
+ * Default prefix for installation (used to resolve relative paths).\r
+ */\r
+#define SHIBSP_PREFIX  "@-PREFIX-@"\r
+\r
 #endif /* __shibsp_paths_h__ */\r
 #endif /* __shibsp_paths_h__ */\r